Class ReadMetadataFromFilesystem
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.metadata.MetadataServiceImpl
-
- com.adaptris.core.services.metadata.ReadMetadataFromFilesystem
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Read a set of metadata from the filesystem and add/replace current metadata", tag="service,metadata") public class ReadMetadataFromFilesystem extends MetadataServiceImpl
Implementation of
Service
that reads metadata from the filesystem.Used in conjunction with
WriteMetadataToFilesystem
to allow preservation of metadata across integration points that make use of the filesystem.- See Also:
WriteMetadataToFilesystem
In the adapter configuration file this class is aliased as read-metadata-from-filesystem which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReadMetadataFromFilesystem.InputStyle
-
Nested classes/interfaces inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
MetadataServiceImpl.LogWrapper
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
DEBUG, ERROR, INFO, TRACE, WARN
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description ReadMetadataFromFilesystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doService(AdaptrisMessage msg)
Apply the service to the message.java.lang.String
getBaseUrl()
FileNameCreator
getFilenameCreator()
ReadMetadataFromFilesystem.InputStyle
getInputStyle()
java.lang.Boolean
getOverwriteExistingMetadata()
protected void
initService()
boolean
overwriteExistingMetadata()
void
setBaseUrl(java.lang.String baseUrl)
void
setFilenameCreator(FileNameCreator creator)
Set the filename creator implementation used to determine the filename to read..void
setInputStyle(ReadMetadataFromFilesystem.InputStyle style)
Set the output style for the metadata.void
setOverwriteExistingMetadata(java.lang.Boolean b)
Overwrite any existing metadata with the contents of the file.-
Methods inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
closeService, getMetadataLogger, logMetadata, logMetadata, logMetadata, logMetadata, prepare, setMetadataLogger, withMetadataLogger
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
initService
protected void initService() throws CoreException
- Overrides:
initService
in classMetadataServiceImpl
- Throws:
CoreException
-
setBaseUrl
public void setBaseUrl(java.lang.String baseUrl)
-
getInputStyle
public ReadMetadataFromFilesystem.InputStyle getInputStyle()
-
setInputStyle
public void setInputStyle(ReadMetadataFromFilesystem.InputStyle style)
Set the output style for the metadata.- Parameters:
style
- one of Text or XML (default is null, which means Text)- See Also:
ReadMetadataFromFilesystem.InputStyle
-
getOverwriteExistingMetadata
public java.lang.Boolean getOverwriteExistingMetadata()
- Returns:
- the overwriteIfExists
-
setOverwriteExistingMetadata
public void setOverwriteExistingMetadata(java.lang.Boolean b)
Overwrite any existing metadata with the contents of the file.- Parameters:
b
- true or false (default false).
-
overwriteExistingMetadata
public boolean overwriteExistingMetadata()
-
getFilenameCreator
public FileNameCreator getFilenameCreator()
-
setFilenameCreator
public void setFilenameCreator(FileNameCreator creator)
Set the filename creator implementation used to determine the filename to read..- Parameters:
creator
-
-
getBaseUrl
public java.lang.String getBaseUrl()
-
-