@ComponentProfile(summary="Extract additional metadata values from an item of metadata", since="3.9.0", tag="service,metadata") public class ExtractMetadataService extends MetadataServiceImpl
Given a metadata key url
containing /record/zeus/apollo
if you have a regular expression
/record/(.*)/(.*)
with metadata keys recordId, childId
then parentId=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.
MetadataServiceImpl.LogWrapper
DEBUG, ERROR, INFO, TRACE, WARN
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
ExtractMetadataService() |
Modifier and Type | Method and 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.util.List<java.lang.String> keys) |
ExtractMetadataService |
withMetadataKeys(java.lang.String... keys) |
ExtractMetadataService |
withRegularExpression(java.lang.String s) |
ExtractMetadataService |
withSourceKey(java.lang.String s) |
closeService, getMetadataLogger, logMetadata, logMetadata, logMetadata, logMetadata, 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 void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
prepare
in class MetadataServiceImpl
CoreException
protected void initService() throws CoreException
initService
in class MetadataServiceImpl
CoreException
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.lang.String getSourceKey()
public void setSourceKey(java.lang.String sourceKey)
public ExtractMetadataService withSourceKey(java.lang.String s)
public java.lang.String getRegularExpression()
public void setRegularExpression(java.lang.String regExp)
public ExtractMetadataService withRegularExpression(java.lang.String s)
public java.util.List<java.lang.String> getMetadataKeys()
public void setMetadataKeys(java.util.List<java.lang.String> metadataKeys)
public ExtractMetadataService withMetadataKeys(java.util.List<java.lang.String> keys)
public ExtractMetadataService withMetadataKeys(java.lang.String... keys)