Class ObfuscationPropertiesDecorator

  • All Implemented Interfaces:
    ObfuscationProperties, org.refcodes.configuration.Properties, org.refcodes.mixin.DecryptPrefixAccessor, org.refcodes.mixin.DelimiterAccessor, org.refcodes.mixin.Dumpable, org.refcodes.mixin.EncryptPrefixAccessor, org.refcodes.mixin.TypeAccessor<java.lang.String>, org.refcodes.structure.CanonicalMap, org.refcodes.structure.Containable, org.refcodes.structure.Dictionary<java.lang.String,java.lang.String>, org.refcodes.structure.Keys<java.lang.String,java.lang.String>, org.refcodes.structure.PathMap<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin

    public class ObfuscationPropertiesDecorator
    extends AbstractObfuscationPropertiesDecorator
    implements ObfuscationProperties
    The ObfuscationPropertiesDecorator represents a decorator for Properties instances by implementing the ObfuscationProperties interface. Properties marked in the resource as "to be decrypted" are decrypted (e.g. with a host individual key). Those encrypted properties are decrypted "on-the-fly" (in memory only) upon accessing the according property. Retrieving a value via AbstractObfuscationPropertiesDecorator.get(Object) (or the like), which is prefixed with "decrypt:" (default), will be decrypted accordingly before passed back to the caller. The prefix may be changed by invoking the according implementaion's constructor. Properties marked in the resource as "to be encrypted" are not modified and returned without the prefix when being queried via AbstractObfuscationPropertiesDecorator.get(Object) (or the like), as the Properties are immutable. By default (if not configured otherwise) the prefix Prefix.DECRYPT is used as decrypt prefix (as of Prefix.getPrefix()). Also by default (if not configured otherwise) the prefix Prefix.ENCRYPT is used as encrypt prefix (as of Prefix.getPrefix()).
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.structure.CanonicalMap

        org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.DecryptPrefixAccessor

        org.refcodes.mixin.DecryptPrefixAccessor.DecryptPrefixBuilder<B extends org.refcodes.mixin.DecryptPrefixAccessor.DecryptPrefixBuilder<B>>, org.refcodes.mixin.DecryptPrefixAccessor.DecryptPrefixMutator, org.refcodes.mixin.DecryptPrefixAccessor.DecryptPrefixProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor

        org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
      • Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary

        org.refcodes.structure.Dictionary.MutableDictionary<K extends java.lang.Object,V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.EncryptPrefixAccessor

        org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixBuilder<B extends org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixBuilder<B>>, org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixMutator, org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixProperty
      • Nested classes/interfaces inherited from interface org.refcodes.structure.Keys

        org.refcodes.structure.Keys.MutableKeys<K extends java.lang.Object,V extends java.lang.Object>, org.refcodes.structure.Keys.MutableValues<K extends java.lang.Object,V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap

        org.refcodes.structure.PathMap.MutablePathMap<T extends java.lang.Object>, org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.configuration.Properties

        org.refcodes.configuration.Properties.MutableProperties, org.refcodes.configuration.Properties.PropertiesBuilder
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<T extends java.lang.Object>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor

        org.refcodes.mixin.TypeAccessor.TypeMutator<T extends java.lang.Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties)
      Decorates the provided Properties with additional ObfuscationProperties behavior or functionality.
      ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties, java.lang.String aSecret)
      Decorates the provided Properties with additional ObfuscationProperties behavior or functionality.
      ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties, java.lang.String aDecryptPrefix, java.lang.String aEncryptPrefix)
      Decorates the provided Properties with additional ObfuscationProperties behavior or functionality.
      ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties, java.lang.String aDecryptPrefix, java.lang.String aEncryptPrefix, java.lang.String aSecret)
      Decorates the provided Properties with additional ObfuscationProperties behavior or functionality.
      ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties, java.lang.String aDecryptPrefix, java.lang.String aEncryptPrefix, org.refcodes.runtime.SystemContext aObfuscationMode)
      Decorates the provided Properties with additional ObfuscationProperties behavior or functionality.
      ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties, org.refcodes.runtime.SystemContext aObfuscationMode)
      Decorates the provided Properties with additional ObfuscationProperties behavior or functionality.
    • Method Summary

      • Methods inherited from class org.refcodes.configuration.AbstractPropertiesDecorator

        childrenOf, containsKey, getDelimiter, getProperties, isEmpty, keySet, retrieveFrom, retrieveTo, setProperties, size, toDataStructure, values
      • Methods inherited from interface org.refcodes.structure.CanonicalMap

        toInstance, toInstance, toType, toType
      • Methods inherited from interface org.refcodes.structure.Containable

        isEmpty, size
      • Methods inherited from interface org.refcodes.mixin.DecryptPrefixAccessor

        getDecryptPrefix
      • Methods inherited from interface org.refcodes.mixin.Dumpable

        toDump, toDump
      • Methods inherited from interface org.refcodes.mixin.EncryptPrefixAccessor

        getEncryptPrefix
      • Methods inherited from interface org.refcodes.structure.Keys

        containsKey, get, get, keySet, use, values
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.refcodes.structure.PathMap

        directories, directories, entries, entries, fromExternalKey, getArray, getArray, getRootPath, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toDataStructure, toExternalKey, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath
      • Methods inherited from interface org.refcodes.configuration.Properties

        childrenOf, containsValue, getDelimiter, getType, retrieve, retrieveFrom, retrieveTo, toMap, toProperties, toPropertyPath
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        containsKey, get, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
    • Constructor Detail

      • ObfuscationPropertiesDecorator

        public ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties)
        Decorates the provided Properties with additional ObfuscationProperties behavior or functionality. Changes applied to the provided Properties affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The Properties to be decorated.
      • ObfuscationPropertiesDecorator

        public ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties,
                                              java.lang.String aDecryptPrefix,
                                              java.lang.String aEncryptPrefix)
        Decorates the provided Properties with additional ObfuscationProperties behavior or functionality. Changes applied to the provided Properties affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The Properties to be decorated.
        aDecryptPrefix - The decrypt prefix to be used for values which are to be decrypted, e.g. "decrypt:".
        aEncryptPrefix - The decrypt prefix to be used. for values which are to be encrypted, e.g. "encrypt:".
      • ObfuscationPropertiesDecorator

        public ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties,
                                              java.lang.String aDecryptPrefix,
                                              java.lang.String aEncryptPrefix,
                                              org.refcodes.runtime.SystemContext aObfuscationMode)
        Decorates the provided Properties with additional ObfuscationProperties behavior or functionality. Changes applied to the provided Properties affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The Properties to be decorated.
        aDecryptPrefix - The decrypt prefix to be used for values which are to be decrypted, e.g. "decrypt:".
        aEncryptPrefix - The decrypt prefix to be used. for values which are to be encrypted, e.g. "encrypt:".
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • ObfuscationPropertiesDecorator

        public ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties,
                                              java.lang.String aDecryptPrefix,
                                              java.lang.String aEncryptPrefix,
                                              java.lang.String aSecret)
        Decorates the provided Properties with additional ObfuscationProperties behavior or functionality. Changes applied to the provided Properties affect the decorator. The given secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The Properties to be decorated.
        aDecryptPrefix - The decrypt prefix to be used for values which are to be decrypted, e.g. "decrypt:".
        aEncryptPrefix - The decrypt prefix to be used. for values which are to be encrypted, e.g. "encrypt:".
        aSecret - The secret to use when encrypting and decrypting the according properties.
      • ObfuscationPropertiesDecorator

        public ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties,
                                              org.refcodes.runtime.SystemContext aObfuscationMode)
        Decorates the provided Properties with additional ObfuscationProperties behavior or functionality. Changes applied to the provided Properties affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The Properties to be decorated.
        aObfuscationMode - The SystemContext specifies which level of obfuscation is to be used when encountering upon obfuscated properties: E.g. obfuscation may be bound to the host, the "secret" used for obfuscation being the same for all applications on the same host or obfuscation may be bound to the application, being different for different applications on the same host.
      • ObfuscationPropertiesDecorator

        public ObfuscationPropertiesDecorator​(org.refcodes.configuration.Properties aProperties,
                                              java.lang.String aSecret)
        Decorates the provided Properties with additional ObfuscationProperties behavior or functionality. Changes applied to the provided Properties affect the decorator. The given secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The Properties to be decorated.
        aSecret - The secret to use when encrypting and decrypting the according properties.