|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindtree.techworks.insight.reporting.jobs.JobPersistanceHandler
public class JobPersistanceHandler
Handles the serialization and deserialization of Job
s.
The fields that are to be serialized are got from the
Job#getSerializableFields()
method.
Unlike Verifier
s the Job
's serialization is
kept simple. No Array
or Collection
fields are
allowed for serialization. Infact, the serialization algorithm does not even
bother to check the type of the field being serialized, and simply calls the
toString()
method on it.
For deserialization the
Job#setDeserializedField (String, String)
method is used to set the field value with the name, the particular
Job
is supposed to set the field accordingly.
The format to serialize a Job
is as below:
<job> <!-- The class that implements the Job interface --> <class>the.implementing.class.of.the.Job</class> <!-- The display name of the job --> <name>Job Display Name</name> <fields> <field> <name>field</name> <value>Some Value</value> </field> <field> <name>someOtherField</name> <value>Some Other Value</value> </field> </fields> </job>Unlike
Verifier
s, the format cannot be varied by the Job
implementations.
Job
Field Summary | |
---|---|
static java.lang.String |
SERIALIZED_JOB_ROOT_TAG
The root tag of the XML serialized Job |
Constructor Summary | |
---|---|
JobPersistanceHandler()
|
Method Summary | |
---|---|
static Job |
deserializeJob(java.lang.String serializedJob)
Deserializes a job from the persistant format. |
static java.lang.String |
serializeJob(Job job)
Creates a serialized form of the Job . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SERIALIZED_JOB_ROOT_TAG
Constructor Detail |
---|
public JobPersistanceHandler()
Method Detail |
---|
public static java.lang.String serializeJob(Job job)
Job
. For the format of
the serialized Job
see documentation for this class.
job
- The job to be serialized.
public static Job deserializeJob(java.lang.String serializedJob) throws JobInitializationException
serializedJob
- The string representing the serialized Job
Job
JobInitializationException
- If the Job
cannot be deserialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |