Class ExtractMetadataService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.metadata.MetadataServiceImpl
-
- com.adaptris.core.services.metadata.ExtractMetadataService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Extract additional metadata values from an item of metadata", since="3.9.0", tag="service,metadata") public class ExtractMetadataService extends MetadataServiceImpl
Extract additional metadata values from an item of metadata.Given a metadata key
url
containing/record/zeus/apollo
if you have a regular expression/record/(.*)/(.*)
with metadata keysrecordId, childId
thenparentId=zeus
,childId=apollo
will be set when this service executes.In the adapter configuration file this class is aliased as extract-metadata-from-metadata 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 ExtractMetadataService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doService(AdaptrisMessage msg)
Apply the service to the message.java.util.List<java.lang.String>
getMetadataKeys()
java.lang.String
getRegularExpression()
java.lang.String
getSourceKey()
protected void
initService()
void
prepare()
Prepare for initialisation.void
setMetadataKeys(java.util.List<java.lang.String> metadataKeys)
void
setRegularExpression(java.lang.String regExp)
void
setSourceKey(java.lang.String sourceKey)
ExtractMetadataService
withMetadataKeys(java.lang.String... keys)
ExtractMetadataService
withMetadataKeys(java.util.List<java.lang.String> keys)
ExtractMetadataService
withRegularExpression(java.lang.String s)
ExtractMetadataService
withSourceKey(java.lang.String s)
-
Methods inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
closeService, getMetadataLogger, logMetadata, logMetadata, logMetadata, logMetadata, 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
-
-
-
-
Method Detail
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Overrides:
prepare
in classMetadataServiceImpl
- Throws:
CoreException
-
initService
protected void initService() throws CoreException
- Overrides:
initService
in classMetadataServiceImpl
- Throws:
CoreException
-
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
-
getSourceKey
public java.lang.String getSourceKey()
-
setSourceKey
public void setSourceKey(java.lang.String sourceKey)
-
withSourceKey
public ExtractMetadataService withSourceKey(java.lang.String s)
-
getRegularExpression
public java.lang.String getRegularExpression()
-
setRegularExpression
public void setRegularExpression(java.lang.String regExp)
-
withRegularExpression
public ExtractMetadataService withRegularExpression(java.lang.String s)
-
getMetadataKeys
public java.util.List<java.lang.String> getMetadataKeys()
-
setMetadataKeys
public void setMetadataKeys(java.util.List<java.lang.String> metadataKeys)
-
withMetadataKeys
public ExtractMetadataService withMetadataKeys(java.util.List<java.lang.String> keys)
-
withMetadataKeys
public ExtractMetadataService withMetadataKeys(java.lang.String... keys)
-
-