Class PayloadHashingService
- java.lang.Object
- 
- com.adaptris.core.ServiceImp
- 
- com.adaptris.core.services.metadata.PayloadHashingService
 
 
- 
- All Implemented Interfaces:
- AdaptrisComponent,- ComponentLifecycle,- ComponentLifecycleExtension,- MessageEventGenerator,- Service,- StateManagedComponent
 
 @ComponentProfile(summary="Hash the payload and store the hash against a metadata key", tag="service,metadata") public class PayloadHashingService extends ServiceImpCreate a hash of the payload based on the configurable algorithm and stores it as metadata.In the adapter configuration file this class is aliased as payload-hashing-service which is the preferred alternative to the fully qualified classname when building your configuration. 
- 
- 
Field Summary- 
Fields inherited from class com.adaptris.core.ServiceImplog
 
- 
 - 
Constructor SummaryConstructors Constructor Description PayloadHashingService()PayloadHashingService(java.lang.String hash, java.lang.String metadataKey)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseService()voiddoService(AdaptrisMessage msg)Apply the service to the message.ByteTranslatorgetByteTranslator()java.lang.StringgetHashAlgorithm()java.lang.StringgetMetadataKey()protected voidinitService()voidprepare()Prepare for initialisation.voidsetByteTranslator(ByteTranslator t)voidsetHashAlgorithm(java.lang.String hashAlgorithm)Set the hashing algorithm to use.voidsetMetadataKey(java.lang.String metadataKey)Set the metadata key against which the one way hash is stored.- 
Methods inherited from class com.adaptris.core.ServiceImpchangeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
 
- 
 
- 
- 
- 
Method Detail- 
doServicepublic void doService(AdaptrisMessage msg) throws ServiceException Description copied from interface:ServiceApply the service to the message. - Parameters:
- msg- the- AdaptrisMessageto process
- Throws:
- ServiceException- wrapping any underlying- Exceptions
 
 - 
initServiceprotected void initService() throws CoreException- Specified by:
- initServicein class- ServiceImp
- Throws:
- CoreException
 
 - 
closeServiceprotected void closeService() - Specified by:
- closeServicein class- ServiceImp
 
 - 
getHashAlgorithmpublic java.lang.String getHashAlgorithm() 
 - 
setHashAlgorithmpublic void setHashAlgorithm(java.lang.String hashAlgorithm) Set the hashing algorithm to use.- Parameters:
- hashAlgorithm- the algorithm, for example SHA256
 
 - 
getMetadataKeypublic java.lang.String getMetadataKey() 
 - 
setMetadataKeypublic void setMetadataKey(java.lang.String metadataKey) Set the metadata key against which the one way hash is stored.- Parameters:
- metadataKey- the metadata key
 
 - 
preparepublic void prepare() throws CoreExceptionDescription copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Throws:
- CoreException
 
 - 
getByteTranslatorpublic ByteTranslator getByteTranslator() 
 - 
setByteTranslatorpublic void setByteTranslator(ByteTranslator t) 
 
- 
 
-