@ComponentProfile(summary="Verify a message has all the required metadata keys", tag="service,metadata") public class ValidateMetadataService extends ServiceImp
If any of the required keys does not have a values stored against it, a ServiceException
is thrown.
In the adapter configuration file this class is aliased as validate-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
ValidateMetadataService()
Creates a new instance.
|
ValidateMetadataService(java.util.List<java.lang.String> list) |
Modifier and Type | Method and Description |
---|---|
void |
addRequiredKey(java.lang.String key)
Add a key to the
List . |
protected void |
closeService() |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.util.List<java.lang.String> |
getRequiredKeys()
Returns the
List of keys which must be present and have non
empty values. |
protected void |
initService() |
void |
prepare()
Prepare for initialisation.
|
void |
setRequiredKeys(java.util.List<java.lang.String> l)
Sets the
List of keys which must be present and have non empty
values. |
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public ValidateMetadataService()
Creates a new instance.
public ValidateMetadataService(java.util.List<java.lang.String> list)
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
spublic java.util.List<java.lang.String> getRequiredKeys()
Returns the List
of keys which must be present and have non
empty values.
List
of keys which must be present and have non
empty valuespublic void setRequiredKeys(java.util.List<java.lang.String> l)
Sets the List
of keys which must be present and have non empty
values.
l
- the List
of keys which must be present and have non
empty valuespublic void addRequiredKey(java.lang.String key)
Add a key to the List
.
key
- the key to addprotected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public void prepare() throws CoreException
ComponentLifecycleExtension
CoreException