com.mindtree.techworks.insight.reporting.verifiers
Class AbstractVerifier

java.lang.Object
  extended by com.mindtree.techworks.insight.reporting.verifiers.AbstractVerifier
All Implemented Interfaces:
DefaultImplDeserializable, Verifier, java.io.Serializable

public abstract class AbstractVerifier
extends java.lang.Object
implements Verifier, DefaultImplDeserializable

An abstract implementation of the Verifier interface. It provides common services required by verifiers at a single location. Some of those include maintaining a registry of Jobs currently registered to be called when this Verifier is triggered.

Since:
Insight 1.5
Version:
$Revision: 27 $ $Date: 2007-12-16 04:58:03 -0700 (Sun, 16 Dec 2007) $
Author:
Bindul Bhowmik
See Also:
Verifier, Job, Serialized Form

Field Summary
protected  java.util.List _jobs
          The lists of jobs to be invoked when the verifier is triggered.
 
Constructor Summary
AbstractVerifier()
          Creates a new AbstractVerifier instance.
AbstractVerifier(java.lang.String displayName)
          Creates a new AbstractVerifier instance, with the display name provided.
 
Method Summary
 VerifierDeserializer getDeserializer()
          Returns the default implementation of VerifierDeserializer.
 java.lang.String getDisplayName()
          Returns the display name of the verifier to be displayed in the UI of the application to the user.
protected abstract  java.util.Map getFieldMap()
          The implementing verifiers should return a map of the fields that they require to be serialized as a map.
 java.lang.String getUID()
          Returns the unique identifier for this Verifier - the fully qualified name of the class implementing the interface.
 void registerJob(Job job)
          Registers a job to be executed when the Verifier is triggered.
 java.lang.String serialize()
          Generates a default serialized form of the Verifier.
protected abstract  boolean serializeJobs()
          Returns true if the Jobs registered for this Verifier are to be serialized.
protected  void setDisplayName(java.lang.String displayName)
          Sets the display name of the Verifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.mindtree.techworks.insight.reporting.verifiers.Verifier
notifyEndAction, notifyStartAction, verify
 
Methods inherited from interface com.mindtree.techworks.insight.reporting.verifiers.DefaultImplDeserializable
deserializeField
 

Field Detail

_jobs

protected java.util.List _jobs
The lists of jobs to be invoked when the verifier is triggered.

Constructor Detail

AbstractVerifier

public AbstractVerifier(java.lang.String displayName)
Creates a new AbstractVerifier instance, with the display name provided.

Parameters:
displayName - The display name of the Verifier.

AbstractVerifier

public AbstractVerifier()
Creates a new AbstractVerifier instance.

Method Detail

getFieldMap

protected abstract java.util.Map getFieldMap()
The implementing verifiers should return a map of the fields that they require to be serialized as a map. All field values need to have proper implementation of the toString() method, or they need to be arrays or Collections. In the latter case, the values in the array or Collection need to return serializable data from the toString() method.

Returns:
A map containing the name and value pairs of each of the fields.

serializeJobs

protected abstract boolean serializeJobs()
Returns true if the Jobs registered for this Verifier are to be serialized.

Returns:
true if Jobs are to be serialized or false

registerJob

public void registerJob(Job job)
Registers a job to be executed when the Verifier is triggered.

Specified by:
registerJob in interface Verifier
Parameters:
job - The Job to be registered.
Throws:
java.lang.IllegalArgumentException - If the job passed in is null
See Also:
Verifier.registerJob(com.mindtree.techworks.insight.reporting.jobs.Job)

serialize

public java.lang.String serialize()
Generates a default serialized form of the Verifier. Only fields returned by the #getFieldMap() method are serialized. Verifiers serialized using this method may be deserialized using the VerifierDeserializerImpl.

For a format of the serialized Verifier see VerifierDeserializer documentation.

Verifiers extending this class may override this method and provide their own VerifierDeserializer instances.

Specified by:
serialize in interface Verifier
Returns:
The String form of the Verifier.
See Also:
Verifier.serialize()

getDeserializer

public VerifierDeserializer getDeserializer()
Returns the default implementation of VerifierDeserializer. Subclasses using a different VerifierDeserializer implementation should override this method.

Specified by:
getDeserializer in interface Verifier
Returns:
The VerifierDeserializer to be used for the Verifier.
See Also:
Verifier.getDeserializer()

getDisplayName

public java.lang.String getDisplayName()
Description copied from interface: Verifier
Returns the display name of the verifier to be displayed in the UI of the application to the user.

Specified by:
getDisplayName in interface Verifier
Returns:
The display name of the Verifier.
See Also:
Verifier.getDisplayName()

getUID

public java.lang.String getUID()
Description copied from interface: Verifier
Returns the unique identifier for this Verifier - the fully qualified name of the class implementing the interface.

Specified by:
getUID in interface Verifier
Returns:
The unique identifier of the Verifier.
See Also:
Verifier.getUID()

setDisplayName

protected void setDisplayName(java.lang.String displayName)
Sets the display name of the Verifier. Sub classes, which do not use the constructor to set the display name of the Verifier, may use this method to set the display name.

Parameters:
displayName - The display name of the Verifier.


Copyright © 2003-2008 MindTree Consulting Ltd.. All Rights Reserved.