@ComponentProfile(summary="Hash a metadata value, and store it", tag="service,metadata") public class MetadataHashingService extends ReformatMetadata
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 specified ByteTranslator
In 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.
MetadataServiceImpl.LogWrapper
DEBUG, ERROR, INFO, TRACE, WARN
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
MetadataHashingService() |
MetadataHashingService(java.lang.String regexp) |
MetadataHashingService(java.lang.String regexp,
java.lang.String hash,
ByteTranslator translator) |
Modifier and Type | Method and Description |
---|---|
ByteTranslator |
getByteTranslator() |
java.lang.String |
getHashAlgorithm() |
protected void |
initService() |
java.lang.String |
reformat(java.lang.String s,
java.lang.String charEncoding)
Reformat a metadata value
|
void |
setByteTranslator(ByteTranslator translator)
Specify how to translate the resulting byte array from the hash into a String.
|
void |
setHashAlgorithm(java.lang.String hashAlg) |
doService, getMetadataKeyRegexp, setMetadataKeyRegexp
closeService, getMetadataLogger, logMetadata, logMetadata, logMetadata, logMetadata, prepare, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reformat
public MetadataHashingService()
public MetadataHashingService(java.lang.String regexp)
public MetadataHashingService(java.lang.String regexp, java.lang.String hash, ByteTranslator translator)
protected void initService() throws CoreException
initService
in class MetadataServiceImpl
CoreException
public java.lang.String reformat(java.lang.String s, java.lang.String charEncoding) throws java.lang.Exception
MetadataReformatter
s
- the string to reformatcharEncoding
- the charset of the messagejava.lang.Exception
public final java.lang.String getHashAlgorithm()
public final void setHashAlgorithm(java.lang.String hashAlg)
public final ByteTranslator getByteTranslator()
public final void setByteTranslator(ByteTranslator translator)
translator
- the translator;