Package net.shibboleth.metadata.pipeline
Class SerializationStage<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.AbstractStage<T>
net.shibboleth.metadata.pipeline.SerializationStage<T>
- Type Parameters:
T- type of items upon which this stage operates
- All Implemented Interfaces:
Stage<T>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.IdentifiableComponent,net.shibboleth.shared.component.IdentifiedComponent,net.shibboleth.shared.component.InitializableComponent
A stage which writes the given item collection out to a file using a provided
ItemCollectionSerializer.
This stage requires the following properties be set prior to initialization:
outputFileserializer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.LoggerClass logger.private FileFile to which the item will be written.private booleanWhether an existing output file should be overwritten.private ItemCollectionSerializer<T>Serializer used to write the collection to the output stream. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerforms the stage processing on the given Item collection.protected voidfinal FileGets the file to which the item will be written.final ItemCollectionSerializer<T>Gets the serializer used to write item to the output file.final booleanGets whether an existing output file should be overwritten.voidsetOutputFile(File file) Sets the file to which the item will be written.voidsetOverwritingExistingOutputFile(boolean isOverwriting) Sets whether an existing output file should be overwritten.voidsetSerializer(ItemCollectionSerializer<T> itemSerializer) Sets the serializer used to write item to the output file.Methods inherited from class net.shibboleth.metadata.pipeline.AbstractStage
execute, getCollectionPredicate, setCollectionPredicateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGClass logger. -
outputFile
File to which the item will be written. -
overwritingExistingOutputFile
private boolean overwritingExistingOutputFileWhether an existing output file should be overwritten. Default value:true -
serializer
Serializer used to write the collection to the output stream.
-
-
Constructor Details
-
SerializationStage
public SerializationStage()
-
-
Method Details
-
getOutputFile
Gets the file to which the item will be written.- Returns:
- file to which the item will be written
-
setOutputFile
Sets the file to which the item will be written.- Parameters:
file- file to which the item will be written
-
isOverwritingExistingOutputFile
public final boolean isOverwritingExistingOutputFile()Gets whether an existing output file should be overwritten.- Returns:
- whether an existing output file should be overwritten
-
setOverwritingExistingOutputFile
public void setOverwritingExistingOutputFile(boolean isOverwriting) Sets whether an existing output file should be overwritten.- Parameters:
isOverwriting- whether an existing output file should be overwritten
-
getSerializer
Gets the serializer used to write item to the output file.- Returns:
- serializer used to write item to the output file
-
setSerializer
Sets the serializer used to write item to the output file.- Parameters:
itemSerializer- serializer used to write item to the output file
-
doExecute
protected void doExecute(@Nonnull @NonnullElements List<Item<T>> items) throws StageProcessingException Description copied from class:AbstractStagePerforms the stage processing on the given Item collection.The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
- Specified by:
doExecutein classAbstractStage<T>- Parameters:
items- collection to be processed- Throws:
StageProcessingException- thrown if there is an unrecoverable problem when processing the stage
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.shared.component.AbstractIdentifiedInitializableComponent- Throws:
net.shibboleth.shared.component.ComponentInitializationException
-