Package net.shibboleth.metadata.pipeline
Class FilesInDirectoryMultiOutputStrategy<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.metadata.pipeline.FilesInDirectoryMultiOutputStrategy<T>
- Type Parameters:
T- the type ofItemto operate on
- All Implemented Interfaces:
MultiOutputSerializationStage.OutputStrategy<T>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.InitializableComponent
@ThreadSafe
public class FilesInDirectoryMultiOutputStrategy<T>
extends net.shibboleth.shared.component.AbstractInitializableComponent
implements MultiOutputSerializationStage.OutputStrategy<T>
An output strategy for use with the
MultiOutputSerializationStage which generates
individual files within a directory.
The files are named by a combination of:
- Since:
- 0.9.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classClass implementing the returnedMultiOutputSerializationStage.Destinationobjects. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileDirectory into which to write files.private static final org.slf4j.LoggerClass logger.private StringString to use as a prefix for file names generated by this strategy.private StringString to use as a suffix for file names generated by this strategy. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgetDestination(Item<T> item) Gets aMultiOutputSerializationStage.Destinationto which an item should be serialized.final FileGets the directory in use.final StringGets the name prefix in use.final StringGets the name suffix in use.Gets the name transformer in use.voidsetDirectory(File dir) Sets the directory to use.voidsetNamePrefix(String prefix) Sets the name prefix to use.voidsetNameSuffix(String suffix) Sets the name suffix to use.voidsetNameTransformer(Function<String, String> transformer) Sets the name transformer to use.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGClass logger. -
namePrefix
String to use as a prefix for file names generated by this strategy. Default value: empty string. -
nameTransformer
-
nameSuffix
String to use as a suffix for file names generated by this strategy. Default value: empty string. -
directory
Directory into which to write files.
-
-
Constructor Details
-
FilesInDirectoryMultiOutputStrategy
public FilesInDirectoryMultiOutputStrategy()
-
-
Method Details
-
getNamePrefix
Gets the name prefix in use.- Returns:
- the name prefix in use
-
setNamePrefix
Sets the name prefix to use.- Parameters:
prefix- the name prefix to use
-
getNameTransformer
Gets the name transformer in use.- Returns:
- the name transformer in use.
-
setNameTransformer
Sets the name transformer to use.- Parameters:
transformer- the name transformer to use
-
getNameSuffix
Gets the name suffix in use.- Returns:
- the name suffix in use
-
setNameSuffix
Sets the name suffix to use.- Parameters:
suffix- the name suffix to use
-
getDirectory
Gets the directory in use.- Returns:
- the directory in use
-
setDirectory
Sets the directory to use.- Parameters:
dir- the directory to use
-
getDestination
@Nonnull public MultiOutputSerializationStage.Destination getDestination(@Nonnull Item<T> item) throws StageProcessingException Description copied from interface:MultiOutputSerializationStage.OutputStrategyGets aMultiOutputSerializationStage.Destinationto which an item should be serialized.- Specified by:
getDestinationin interfaceMultiOutputSerializationStage.OutputStrategy<T>- Parameters:
item-Itemfor which to generate aMultiOutputSerializationStage.Destination- Returns:
MultiOutputSerializationStage.Destinationfor the item- Throws:
StageProcessingException- if an output stream cannot be generated for theItem
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.shared.component.AbstractInitializableComponent- Throws:
net.shibboleth.shared.component.ComponentInitializationException
-