@ComponentProfile(summary="Identify a message, and set a metadata key based on the identifier", tag="service,routing") public class SyntaxRoutingService extends ServiceImp
This is somewhat similar to the available MetadataService, however it uses a list of SyntaxIdentifiers
in order to
determine the value that should be stored against a particular metadata key.
Each SyntaxIdentifier
is tried in turn, until true is returned by the method
isThisSyntax(AdaptrisMessage)
. At this point, the value returned by getDestination()
is stored against
the configured key.
In the adapter configuration file this class is aliased as syntax-routing-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
SyntaxRoutingService() |
Modifier and Type | Method and Description |
---|---|
void |
addSyntaxIdentifier(SyntaxIdentifier ident)
Add a SyntaxIdentifier to the configured list.
|
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.String |
getRoutingKey()
Get the metadata key that the value will be stored against.
|
java.util.List<SyntaxIdentifier> |
getSyntaxIdentifiers()
Return the list of configured SyntaxIdentifers.
|
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setRoutingKey(java.lang.String key)
Set the metadata key that the value will be stored against.
|
void |
setSyntaxIdentifiers(java.util.List<SyntaxIdentifier> l)
Sets the list of configured SyntaxIdentifers.
|
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsConfirmation, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isConfirmation, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, rethrowServiceException, retrieveComponentState, setContinueOnFail, setIsConfirmation, setIsTrackingEndpoint, setLookupName, 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 void addSyntaxIdentifier(SyntaxIdentifier ident)
ident
- the SyntaxIdentifier.public java.util.List<SyntaxIdentifier> getSyntaxIdentifiers()
public void setSyntaxIdentifiers(java.util.List<SyntaxIdentifier> l)
l
- the list.public void setRoutingKey(java.lang.String key)
key
- the key.public java.lang.String getRoutingKey()
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public void prepare() throws CoreException
ComponentLifecycleExtension
CoreException