Class MetadataHashingService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.metadata.MetadataServiceImpl
-
- com.adaptris.core.services.metadata.ReformatMetadata
-
- com.adaptris.core.services.metadata.MetadataHashingService
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,MessageEventGenerator,Service,MetadataReformatter,StateManagedComponent
@ComponentProfile(summary="Hash a metadata value, and store it", tag="service,metadata") public class MetadataHashingService extends ReformatMetadataHashes the metadata value stored against a metadata key.Each matching metadata key from
ReformatMetadata.getMetadataKeyRegexp()will be hashed, and the value overwitten with the hash after translating it into a String with the specifiedByteTranslatorIn the adapter configuration file this class is aliased as metadata-hashing-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 MetadataHashingService()MetadataHashingService(java.lang.String regexp)MetadataHashingService(java.lang.String regexp, java.lang.String hash, ByteTranslator translator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteTranslatorgetByteTranslator()java.lang.StringgetHashAlgorithm()protected voidinitService()java.lang.Stringreformat(java.lang.String s, java.lang.String charEncoding)Reformat a metadata valuevoidsetByteTranslator(ByteTranslator translator)Specify how to translate the resulting byte array from the hash into a String.voidsetHashAlgorithm(java.lang.String hashAlg)-
Methods inherited from class com.adaptris.core.services.metadata.ReformatMetadata
doService, getMetadataKeyRegexp, setMetadataKeyRegexp
-
Methods inherited from class com.adaptris.core.services.metadata.MetadataServiceImpl
closeService, getMetadataLogger, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.services.metadata.MetadataReformatter
reformat
-
-
-
-
Constructor Detail
-
MetadataHashingService
public MetadataHashingService()
-
MetadataHashingService
public MetadataHashingService(java.lang.String regexp)
-
MetadataHashingService
public MetadataHashingService(java.lang.String regexp, java.lang.String hash, ByteTranslator translator)
-
-
Method Detail
-
initService
protected void initService() throws CoreException- Overrides:
initServicein classMetadataServiceImpl- Throws:
CoreException
-
reformat
public java.lang.String reformat(java.lang.String s, java.lang.String charEncoding) throws java.lang.ExceptionDescription copied from interface:MetadataReformatterReformat a metadata value- Parameters:
s- the string to reformatcharEncoding- the charset of the message- Returns:
- the replacment string.
- Throws:
java.lang.Exception
-
getHashAlgorithm
public final java.lang.String getHashAlgorithm()
-
setHashAlgorithm
public final void setHashAlgorithm(java.lang.String hashAlg)
-
getByteTranslator
public final ByteTranslator getByteTranslator()
-
setByteTranslator
public final void setByteTranslator(ByteTranslator translator)
Specify how to translate the resulting byte array from the hash into a String.- Parameters:
translator- the translator;
-
-