Package org.xwiki.extension.job.history
Interface ExtensionJobHistorySerializer
-
@Role public interface ExtensionJobHistorySerializer
The interface used to serialize and deserialize theExtensionJobHistory
.- Since:
- 7.1RC1
- Version:
- $Id: 9666c0523a60e1d938c3c36b21e0776f42cacafd $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
append(ExtensionJobHistoryRecord record, File historyFile)
Appends the serialization of a given history record to a specified partial history file.List<ExtensionJobHistoryRecord>
clone(List<ExtensionJobHistoryRecord> records)
Clones a list of history records by serializing and deserializing it.List<ExtensionJobHistoryRecord>
deserialize(String serializedRecords)
Deserializes a list of history records.List<ExtensionJobHistoryRecord>
read(File historyFile)
Deserializes all the history records that have been serialized in the given file.List<ExtensionJobHistoryRecord>
read(Reader reader)
Deserializes a list of history records from a given reader.String
serialize(ExtensionJobHistoryRecord record)
Serializes a given history record.void
write(ExtensionJobHistoryRecord record, Writer writer)
Serializes a given history record and passes the result to the given writer.
-
-
-
Method Detail
-
serialize
String serialize(ExtensionJobHistoryRecord record)
Serializes a given history record.- Parameters:
record
- the history record to serialize- Returns:
- the string serialization of the given history record
-
write
void write(ExtensionJobHistoryRecord record, Writer writer)
Serializes a given history record and passes the result to the given writer.- Parameters:
record
- the history record to serializewriter
- where to write the serialized history record
-
append
void append(ExtensionJobHistoryRecord record, File historyFile) throws IOException
Appends the serialization of a given history record to a specified partial history file.- Parameters:
record
- the history record to serializehistoryFile
- the history file where to append the result- Throws:
IOException
- if it fails to append the serialized history record to the specified file
-
deserialize
List<ExtensionJobHistoryRecord> deserialize(String serializedRecords)
Deserializes a list of history records.- Parameters:
serializedRecords
- the string containing the serialized history records- Returns:
- the list of history records that have been deserialized
-
read
List<ExtensionJobHistoryRecord> read(Reader reader)
Deserializes a list of history records from a given reader.- Parameters:
reader
- from where to read the history records- Returns:
- the list of history records that have been deserialized
-
read
List<ExtensionJobHistoryRecord> read(File historyFile) throws IOException
Deserializes all the history records that have been serialized in the given file.- Parameters:
historyFile
- the history file containing the serialized history records- Returns:
- the list of history records that have been deserialized
- Throws:
IOException
- if it fails to read from the specified file
-
clone
List<ExtensionJobHistoryRecord> clone(List<ExtensionJobHistoryRecord> records)
Clones a list of history records by serializing and deserializing it.- Parameters:
records
- the list of history records to clone- Returns:
- the cloned list
-
-