@ComponentProfile(summary="Extract data from the message via a regular expression and store it as metadata", tag="service,metadata") public class RegexpMetadataService extends MetadataServiceImpl
Service
which information from the message payload and sets it as metadata. Multiple items of metadata may be set,
each with its own RegexpMetadataQuery
.
In the adapter configuration file this class is aliased as regexp-metadata-service which is the preferred alternative to the fully qualified classname when building your configuration.
MetadataServiceImpl.LogWrapper
DEBUG, ERROR, INFO, TRACE, WARN
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
RegexpMetadataService() |
RegexpMetadataService(java.util.List<RegexpMetadataQuery> list) |
Modifier and Type | Method and Description |
---|---|
void |
addRegexpMetadataQuery(RegexpMetadataQuery query)
Adds a
RegexpMetadataQuery to the list be applied. |
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
java.lang.Boolean |
getAddNullValues() |
java.util.List<RegexpMetadataQuery> |
getRegexpMetadataQueries() |
void |
setAddNullValues(java.lang.Boolean b)
If set to true then null values will be added as metadata in the event that a regular expression doesn't match but
RegexpMetadataQuery.getAllowNulls() is true. |
void |
setRegexpMetadataQueries(java.util.List<RegexpMetadataQuery> l)
Sets the
List of RegexpMetadataQuery instances that will be applied by this service. |
closeService, getMetadataLogger, initService, logMetadata, logMetadata, logMetadata, logMetadata, prepare, setMetadataLogger, withMetadataLogger
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public RegexpMetadataService()
public RegexpMetadataService(java.util.List<RegexpMetadataQuery> 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 void addRegexpMetadataQuery(RegexpMetadataQuery query)
RegexpMetadataQuery
to the list be applied.public java.util.List<RegexpMetadataQuery> getRegexpMetadataQueries()
public void setRegexpMetadataQueries(java.util.List<RegexpMetadataQuery> l)
List
of RegexpMetadataQuery
instances that will be applied by this service.public java.lang.Boolean getAddNullValues()
public void setAddNullValues(java.lang.Boolean b)
RegexpMetadataQuery.getAllowNulls()
is true.b
- true to add possible null values to metadata; default is true.RegexpMetadataQuery.setAllowNulls(Boolean)