T - type of items upon which this stage operates@ThreadSafe public class SerializationStage<T> extends BaseStage<T>
ItemCollectionSerializer.
This stage requires the following properties be set prior to initialization:
outputFileserializer| Modifier and Type | Field and Description |
|---|---|
private Logger |
log
Class logger.
|
private File |
outputFile
File to which the item will be written.
|
private boolean |
overwritingExistingOutputFile
Whether an existing output file should be overwritten.
|
private ItemCollectionSerializer<T> |
serializer
Serializer used to write the collection to the output stream.
|
| Constructor and Description |
|---|
SerializationStage() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doExecute(Collection<Item<T>> itemCollection)
Performs the stage processing on the given Item collection.
|
protected void |
doInitialize() |
File |
getOutputFile()
Gets the file to which the item will be written.
|
ItemCollectionSerializer<T> |
getSerializer()
Gets the serializer used to write item to the output file.
|
boolean |
isOverwritingExistingOutputFile()
Gets whether an existing output file should be overwritten.
|
void |
setOutputFile(File file)
Sets the file to which the item will be written.
|
void |
setOverwritingExistingOutputFile(boolean isOverwriting)
Sets whether an existing output file should be overwritten.
|
void |
setSerializer(ItemCollectionSerializer<T> itemSerializer)
Sets the serializer used to write item to the output file.
|
execute, getCollectionPredicate, setCollectionPredicatesetIdgetIddestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isDestroyedprivate final Logger log
private File outputFile
private boolean overwritingExistingOutputFile
trueprivate ItemCollectionSerializer<T> serializer
@Nullable public File getOutputFile()
public void setOutputFile(@Nonnull File file)
file - file to which the item will be writtenpublic boolean isOverwritingExistingOutputFile()
public void setOverwritingExistingOutputFile(boolean isOverwriting)
isOverwriting - whether an existing output file should be overwritten@Nullable public ItemCollectionSerializer<T> getSerializer()
public void setSerializer(@Nonnull ItemCollectionSerializer<T> itemSerializer)
itemSerializer - serializer used to write item to the output fileprotected void doExecute(@Nonnull@NonnullElements Collection<Item<T>> itemCollection) throws StageProcessingException
The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
doExecute in class BaseStage<T>itemCollection - collection to be processedStageProcessingException - thrown if there is an unrecoverable problem when processing the stageprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionCopyright © 1999–2016. All rights reserved.