Package org.jppf.job.persistence
Class PersistenceInfoImpl
java.lang.Object
org.jppf.job.persistence.PersistenceInfoImpl
- All Implemented Interfaces:
Serializable,PersistenceInfo
Implementation of the
PersistenceInfo interface.- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPersistenceInfoImpl(String jobUuid, JPPFDistributedJob job, PersistenceObjectType type, int taskPosition, DataLocation dataLocation) Initialize this persistence information object. -
Method Summary
Modifier and TypeMethodDescriptionGet an input stream for the persisted object.getJob()Get the related job information.Get the job uuid.intGet the position of the task in the job.intgetSize()Get the size in bytes of the persisted object.getType()Get the type of persisted object.toString()
-
Constructor Details
-
PersistenceInfoImpl
public PersistenceInfoImpl(String jobUuid, JPPFDistributedJob job, PersistenceObjectType type, int taskPosition, DataLocation dataLocation) Initialize this persistence information object.- Parameters:
jobUuid- the job uuid.job- the job information, if applicable.type- the type of persisted object.taskPosition- the position of the task in the job, if applicable.dataLocation- the location of the persisted object's data.
-
-
Method Details
-
getJobUuid
Description copied from interface:PersistenceInfoGet the job uuid.- Specified by:
getJobUuidin interfacePersistenceInfo- Returns:
- the uuid of the related job as a string.
-
getJob
Description copied from interface:PersistenceInfoGet the related job information.- Specified by:
getJobin interfacePersistenceInfo- Returns:
- a
JPPFDistributedJobinstance, ornullif the job is not loaded.
-
getType
Description copied from interface:PersistenceInfoGet the type of persisted object.- Specified by:
getTypein interfacePersistenceInfo- Returns:
- one of the possible values of the
PersistenceObjectTypeenum.
-
getPosition
public int getPosition()Description copied from interface:PersistenceInfoGet the position of the task in the job.- Specified by:
getPositionin interfacePersistenceInfo- Returns:
- the position of the task in the job, starting at
0, or-1if the persisted object is neither atasknor atask result.
-
getInputStream
Description copied from interface:PersistenceInfoGet an input stream for the persisted object.- Specified by:
getInputStreamin interfacePersistenceInfo- Returns:
- an
InputStreaminstance, ornullif the object has not yet been loaded. - Throws:
Exception- if any error occurs.
-
toString
-
getSize
public int getSize()Description copied from interface:PersistenceInfoGet the size in bytes of the persisted object.- Specified by:
getSizein interfacePersistenceInfo- Returns:
- the size of the persisted data, or
-1if the size is not known.
-