de.phleisch.app.itsucks.persistence
Interface JobSerialization

All Known Implementing Classes:
AbstractJobSerialization, BinaryObjectJobSerialization, JAXBJobSerialization, XMLJobSerialization

public interface JobSerialization

Interface for the job serialization. This interface provides functionality to serialize and deserialize multiple jobs. After an job is deserialized, the job factory is used to reinject the dependencies.

Author:
olli

Method Summary
 SerializableJobPackage deserialize(java.io.File pTargetFile)
          Deserializes a job list from the given file.
 SerializableJobPackage deserialize(java.io.InputStream pInputStream)
          Deserializes a job list from the given input stream.
 void serialize(SerializableJobPackage pJobList, java.io.File pTargetFile)
          Serializes the given job list to the target file.
 void serialize(SerializableJobPackage pJobList, java.io.OutputStream pOutputStream)
          Serializes the given job list to the given output stream.
 void setJobFactory(DownloadJobFactory pJobFactory)
          Sets the factory to reinject the dependencies back to the deserialzed jobs.
 

Method Detail

serialize

void serialize(SerializableJobPackage pJobList,
               java.io.File pTargetFile)
               throws java.lang.Exception
Serializes the given job list to the target file.

Parameters:
pJobList -
pTargetFile -
Throws:
java.io.IOException
java.lang.Exception

serialize

void serialize(SerializableJobPackage pJobList,
               java.io.OutputStream pOutputStream)
               throws java.lang.Exception
Serializes the given job list to the given output stream. The list is only written to the stream, the stream will not be closed.

Parameters:
pJobList -
pOutputStream -
Throws:
java.io.IOException
java.lang.Exception

deserialize

SerializableJobPackage deserialize(java.io.File pTargetFile)
                                   throws java.lang.Exception
Deserializes a job list from the given file.

Parameters:
pTargetFile -
Returns:
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.Exception

deserialize

SerializableJobPackage deserialize(java.io.InputStream pInputStream)
                                   throws java.lang.Exception
Deserializes a job list from the given input stream.

Parameters:
pInputStream -
Returns:
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.Exception

setJobFactory

void setJobFactory(DownloadJobFactory pJobFactory)
Sets the factory to reinject the dependencies back to the deserialzed jobs. FIXME JobFactory should be an generic interface

Parameters:
pJobFactory -


Copyright © 2010. All Rights Reserved.