@ComponentProfile(summary="Change a metadata value based on a regular expression match", tag="service,metadata") public class MapMetadataService extends MetadataServiceImpl
It supports the special syntax of {n} as the replacement value. This indicates that the corresponding match group should be used as the replacement value.
There are similiarities between this service and ReplaceMetadataValue
. This service could be easily replaced with
multiple instances of ReplaceMetadataValue
and you should consider using that if you have to use match groups.
Pattern
In the adapter configuration file this class is aliased as map-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
MetadataServiceImpl.LogWrapper
DEBUG, ERROR, INFO, TRACE, WARN
log
Constructor and Description |
---|
MapMetadataService() |
Modifier and Type | Method and Description |
---|---|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.String |
getMetadataKey() |
KeyValuePairList |
getMetadataKeyMap()
Returns a
KeyValuePairList in which the key is the regular
expression to match the metadata value against, and the value is the
replacement value. |
void |
setMetadataKey(java.lang.String s) |
void |
setMetadataKeyMap(KeyValuePairList m)
Sets a
KeyValuePairList in which the key is the regular expression to match the metadata value against, and the value
is the replacement value (the replacement value may be an expression a-la %message{metadataKey} . |
closeService, getMetadataLogger, initService, logMetadata, logMetadata, logMetadata, logMetadata, prepare, setMetadataLogger, withMetadataLogger
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
sService.doService(AdaptrisMessage)
public KeyValuePairList getMetadataKeyMap()
Returns a KeyValuePairList
in which the key is the regular
expression to match the metadata value against, and the value is the
replacement value.
It supports the special syntax of {n} which indicates that the corresponding match group should be used as the replacement value
KeyValuePairList
public void setMetadataKeyMap(KeyValuePairList m)
Sets a KeyValuePairList
in which the key is the regular expression to match the metadata value against, and the value
is the replacement value (the replacement value may be an expression a-la %message{metadataKey}
.
m
- a KeyValuePairList
public java.lang.String getMetadataKey()
public void setMetadataKey(java.lang.String s)
s
- the metadataKey to set