@ComponentProfile(summary="Write the current set of metadata to the filesystem", tag="service,metadata") public class WriteMetadataToFilesystem extends ServiceImp
Implementation of Service
that writes metadata to the filesystem.
Used in conjunction with ReadMetadataFromFilesystem
to allow preservation of metadata across integration points that make
use of the filesystem.
In the adapter configuration file this class is aliased as write-metadata-to-filesystem which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
static class |
WriteMetadataToFilesystem.OutputStyle |
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
WriteMetadataToFilesystem() |
WriteMetadataToFilesystem(MessageDrivenDestination d) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
MessageDrivenDestination |
getDestination() |
FileNameCreator |
getFilenameCreator() |
MetadataFilter |
getMetadataFilter() |
WriteMetadataToFilesystem.OutputStyle |
getOutputStyle() |
java.lang.Boolean |
getOverwriteIfExists() |
protected void |
initService() |
boolean |
overwriteIfExists() |
void |
prepare()
Prepare for initialisation.
|
void |
setDestination(MessageDrivenDestination d)
Set the destination where things are written.
|
void |
setFilenameCreator(FileNameCreator creator)
Set the filename creator implementation used to create the filename.
|
void |
setMetadataFilter(MetadataFilter filter)
Set a metadata filter that will filter out metadata before it is written to filesystem
|
void |
setOutputStyle(WriteMetadataToFilesystem.OutputStyle style)
Set the output style for the metadata.
|
void |
setOverwriteIfExists(java.lang.Boolean b)
If the file already exists then overwrite it with the current message in transit.
|
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public WriteMetadataToFilesystem()
public WriteMetadataToFilesystem(MessageDrivenDestination d)
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
sprotected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public FileNameCreator getFilenameCreator()
public void setFilenameCreator(FileNameCreator creator)
creator
- public WriteMetadataToFilesystem.OutputStyle getOutputStyle()
public void setOutputStyle(WriteMetadataToFilesystem.OutputStyle style)
style
- one of Text or XML (default is null, which means Text)WriteMetadataToFilesystem.OutputStyle
public MessageDrivenDestination getDestination()
public void setDestination(MessageDrivenDestination d)
d
- the destination.public java.lang.Boolean getOverwriteIfExists()
public void setOverwriteIfExists(java.lang.Boolean b)
In reality, this performs a delete of the file (which fails silently if the file does not exist) prior to attempting to write the file with the payload.
b
- true or false (default false).public boolean overwriteIfExists()
public MetadataFilter getMetadataFilter()
public void setMetadataFilter(MetadataFilter filter)
filter
- the filter.public void prepare() throws CoreException
ComponentLifecycleExtension
CoreException