@ComponentProfile(summary="Add a formatted metadata item to a Message", tag="service,metadata") public class AddFormattedMetadataService extends ServiceImp
Allows you to add a new metadata key using String.format()
as the syntax.
In the adapter configuration file this class is aliased as add-formatted-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
AddFormattedMetadataService() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.util.List<java.lang.String> |
getArgumentMetadataKeys() |
ElementFormatter |
getElementFormatter()
Get the element formatter.
|
java.lang.String |
getFormatString() |
java.lang.String |
getMetadataKey() |
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setArgumentMetadataKeys(java.util.List<java.lang.String> l) |
void |
setElementFormatter(ElementFormatter elementFormatter)
Set the element formatter.
|
void |
setFormatString(java.lang.String formatString)
Set the format string that complies with
String.format(String, Object...) . |
void |
setMetadataKey(java.lang.String metadatakey) |
AddFormattedMetadataService |
withArgumentMetadataKeys(java.util.List<java.lang.String> s) |
AddFormattedMetadataService |
withArgumentMetadataKeys(java.lang.String... s) |
AddFormattedMetadataService |
withFormatString(java.lang.String s) |
AddFormattedMetadataService |
withMetadataKey(java.lang.String s) |
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
spublic void prepare() throws CoreException
ComponentLifecycleExtension
CoreException
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public java.lang.String getFormatString()
public void setFormatString(java.lang.String formatString)
String.format(String, Object...)
.formatString
- the formatString to setpublic AddFormattedMetadataService withFormatString(java.lang.String s)
public java.util.List<java.lang.String> getArgumentMetadataKeys()
public void setArgumentMetadataKeys(java.util.List<java.lang.String> l)
l
- the argumentMetadataKeys to setpublic AddFormattedMetadataService withArgumentMetadataKeys(java.util.List<java.lang.String> s)
public AddFormattedMetadataService withArgumentMetadataKeys(java.lang.String... s)
public java.lang.String getMetadataKey()
public void setMetadataKey(java.lang.String metadatakey)
metadatakey
- the metadatakey to setpublic AddFormattedMetadataService withMetadataKey(java.lang.String s)
public ElementFormatter getElementFormatter()
public void setElementFormatter(ElementFormatter elementFormatter)
elementFormatter
- The element formatter.