Class CopyMetadataService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.metadata.MetadataServiceImpl
-
- com.adaptris.core.services.metadata.CopyMetadataService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Copy metadata values to other metadata keys", tag="service,metadata") public class CopyMetadataService extends MetadataServiceImpl
Copies metadata from one key to another.Updates message metadata by
- obtaining the metadata value stored against the 'original' key configured as the key in the metadata-keys section
- copying this value to the 'new' key configured as the value of the associated metadata-keys element .
If the configured 'original' metadata key does not exist, then metadata is not copied, if the 'new' metadata key already exists, it is overwritten.
In the adapter configuration file this class is aliased as copy-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Nested Class Summary
-
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 CopyMetadataService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doService(AdaptrisMessage msg)
Apply the service to the message.KeyValuePairCollection
getMetadataKeys()
Returns a KeyValuePairCollection in which the key is the key to look up, and the value is the key to store whatever was found against.void
setMetadataKeys(KeyValuePairCollection m)
Sets a KeyValuePairCollection in which the key is the key to look up, and the value is the key to store whatever was found against the key.-
Methods inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
closeService, getMetadataLogger, initService, 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
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
getMetadataKeys
public KeyValuePairCollection getMetadataKeys()
Returns a KeyValuePairCollection in which the key is the key to look up, and the value is the key to store whatever was found against.
- Returns:
- a KeyValuePairCollection
-
setMetadataKeys
public void setMetadataKeys(KeyValuePairCollection m)
Sets a KeyValuePairCollection in which the key is the key to look up, and the value is the key to store whatever was found against the key.
- Parameters:
m
- a KeyValuePairCollection
-
-