Class RegexpMetadataService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.metadata.MetadataServiceImpl
-
- com.adaptris.core.services.metadata.RegexpMetadataService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@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 ownRegexpMetadataQuery
.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
MetadataServiceImpl.LogWrapper
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
DEBUG, ERROR, INFO, TRACE, WARN
-
Fields inherited from class com.adaptris.core.ServiceImp
log
-
-
Constructor Summary
Constructors Constructor Description RegexpMetadataService()
RegexpMetadataService(java.util.List<RegexpMetadataQuery> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRegexpMetadataQuery(RegexpMetadataQuery query)
Adds aRegexpMetadataQuery
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 butRegexpMetadataQuery.getAllowNulls()
is true.void
setRegexpMetadataQueries(java.util.List<RegexpMetadataQuery> l)
Sets theList
ofRegexpMetadataQuery
instances that will be applied by this service.-
Methods inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
closeService, getMetadataLogger, initService, logMetadata, logMetadata, logMetadata, logMetadata, prepare, setMetadataLogger, withMetadataLogger
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Constructor Detail
-
RegexpMetadataService
public RegexpMetadataService()
-
RegexpMetadataService
public RegexpMetadataService(java.util.List<RegexpMetadataQuery> list)
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
addRegexpMetadataQuery
public void addRegexpMetadataQuery(RegexpMetadataQuery query)
Adds aRegexpMetadataQuery
to the list be applied.
-
getRegexpMetadataQueries
public java.util.List<RegexpMetadataQuery> getRegexpMetadataQueries()
-
setRegexpMetadataQueries
public void setRegexpMetadataQueries(java.util.List<RegexpMetadataQuery> l)
Sets theList
ofRegexpMetadataQuery
instances that will be applied by this service.
-
getAddNullValues
public java.lang.Boolean getAddNullValues()
-
setAddNullValues
public 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 butRegexpMetadataQuery.getAllowNulls()
is true.- Parameters:
b
- true to add possible null values to metadata; default is true.- See Also:
RegexpMetadataQuery.setAllowNulls(Boolean)
-
-