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 MetadataServiceImplExtract additional metadata values from an item of metadata.Given a metadata key
urlcontaining/record/zeus/apolloif you have a regular expression/record/(.*)/(.*)with metadata keysrecordId, childIdthenparentId=zeus,childId=apollowill 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 voiddoService(AdaptrisMessage msg)Apply the service to the message.java.util.List<java.lang.String>getMetadataKeys()java.lang.StringgetRegularExpression()java.lang.StringgetSourceKey()protected voidinitService()voidprepare()Prepare for initialisation.voidsetMetadataKeys(java.util.List<java.lang.String> metadataKeys)voidsetRegularExpression(java.lang.String regExp)voidsetSourceKey(java.lang.String sourceKey)ExtractMetadataServicewithMetadataKeys(java.lang.String... keys)ExtractMetadataServicewithMetadataKeys(java.util.List<java.lang.String> keys)ExtractMetadataServicewithRegularExpression(java.lang.String s)ExtractMetadataServicewithSourceKey(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 CoreExceptionDescription copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Specified by:
preparein interfaceComponentLifecycleExtension- Overrides:
preparein classMetadataServiceImpl- Throws:
CoreException
-
initService
protected void initService() throws CoreException- Overrides:
initServicein classMetadataServiceImpl- Throws:
CoreException
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:ServiceApply the service to the message.
- Parameters:
msg- theAdaptrisMessageto process- Throws:
ServiceException- wrapping any underlyingExceptions
-
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)
-
-