Class ObfuscationResourcePropertiesBuilderDecorator

  • All Implemented Interfaces:
    java.io.Flushable, java.util.Map<java.lang.String,java.lang.String>, org.refcodes.component.Flushable, org.refcodes.component.Flushable.FlushBuilder<org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder>, ObfuscationProperties, ObfuscationProperties.MutableObfuscationProperties, ObfuscationProperties.ObfuscationPropertiesBuilder, ObfuscationResourceProperties, ObfuscationResourceProperties.MutableObfuscationResourceProperties, ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder, org.refcodes.configuration.Properties, org.refcodes.configuration.Properties.MutableProperties, org.refcodes.configuration.Properties.PropertiesBuilder, org.refcodes.configuration.ResourceProperties, org.refcodes.configuration.ResourceProperties.MutableResoureProperties, org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder, org.refcodes.mixin.DecryptPrefixAccessor, org.refcodes.mixin.DecryptPrefixAccessor.DecryptPrefixBuilder<ObfuscationProperties.ObfuscationPropertiesBuilder>, org.refcodes.mixin.DecryptPrefixAccessor.DecryptPrefixMutator, org.refcodes.mixin.DecryptPrefixAccessor.DecryptPrefixProperty, org.refcodes.mixin.DelimiterAccessor, org.refcodes.mixin.Dumpable, org.refcodes.mixin.EncryptPrefixAccessor, org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixBuilder<ObfuscationProperties.ObfuscationPropertiesBuilder>, org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixMutator, org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixProperty, org.refcodes.mixin.TypeAccessor<java.lang.String>, org.refcodes.structure.CanonicalMap, org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap, org.refcodes.structure.Clearable, org.refcodes.structure.Containable, org.refcodes.structure.Dictionary<java.lang.String,java.lang.String>, org.refcodes.structure.Dictionary.MutableDictionary<java.lang.String,java.lang.String>, org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,java.lang.String,org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>>, org.refcodes.structure.Keys<java.lang.String,java.lang.String>, org.refcodes.structure.Keys.MutableKeys<java.lang.String,java.lang.String>, org.refcodes.structure.Keys.MutableValues<java.lang.String,java.lang.String>, org.refcodes.structure.PathMap<java.lang.String>, org.refcodes.structure.PathMap.MutablePathMap<java.lang.String>, org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin

    public class ObfuscationResourcePropertiesBuilderDecorator
    extends AbstractObfuscationResourcePropertiesBuilderDecorator
    implements ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder
    The ObfuscationResourcePropertiesBuilderDecorator represents a decorator for ResourceProperties.ResourcePropertiesBuilder instances by implementing the ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder 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 AbstractObfuscationResourcePropertiesBuilderDecorator.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 or the according methods. Properties marked in the resource as "to be encrypted" by being prefixed with "encrypt:" (default) are encrypted (e.g. with a host individual key) when being added and instead are prefixed with "decrypt:" (default). Retrieving a value via AbstractObfuscationResourcePropertiesBuilderDecorator.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. If the encapsulated ResourceProperties.ResourcePropertiesBuilder instance can be flushed as of Flushable.isFlushable(), then any properties which have been encrypted as of the "encrypt:" prefix (default) upon instantiation are written back to the resource, though this time encrypted, having now the prefix "decrypt:" (default). 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()) constructor or the according methods.
    • 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.structure.Dictionary.MutableDictionary

        org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K extends java.lang.Object,V extends java.lang.Object,B extends org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
      • 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.component.Flushable

        org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
      • 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.configuration.ResourceProperties

        org.refcodes.configuration.ResourceProperties.MutableResoureProperties, org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder
      • 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>
    • Method Summary

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

        clear, containsValue, entrySet, putAll, remove
      • Methods inherited from class org.refcodes.configuration.AbstractPropertiesDecorator

        containsKey, getDelimiter, getProperties, isEmpty, keySet, setProperties, size, toDataStructure, values
      • Methods inherited from class org.refcodes.configuration.AbstractResourcePropertiesBuilderDecorator

        childrenOf, flush, isFlushable, loadFrom, loadFrom, reload, reload, retrieveFrom, retrieveTo, saveTo, saveTo, seekFrom, toSerialized
      • Methods inherited from interface org.refcodes.structure.CanonicalMap

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

        withInsert, withInsert, withInsertFrom, withInsertTo
      • Methods inherited from interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap

        insert, insert, insertFrom, insertTo, putAll, toDump, toSourceCode, toSourceCode
      • Methods inherited from interface org.refcodes.structure.Clearable

        clear
      • 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.DecryptPrefixAccessor.DecryptPrefixMutator

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

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

        getEncryptPrefix
      • Methods inherited from interface org.refcodes.mixin.EncryptPrefixAccessor.EncryptPrefixMutator

        setEncryptPrefix
      • Methods inherited from interface org.refcodes.component.Flushable

        flushUnchecked, isFlushable
      • Methods inherited from interface org.refcodes.component.Flushable.FlushBuilder

        withFlush, withFlushUnchecked
      • Methods inherited from interface org.refcodes.structure.Keys.MutableValues

        put
      • 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, get, get, getArray, getArray, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getIndexes, getIndexes, getInteger, getInteger, getLong, getLong, getRootPath, getShort, getShort, hasIndexed, hasIndexed, hasParentPath, isArray, isArray, isDirectory, isEntry, isIndexed, isIndexed, isPath, isRecord, isRootPath, keySet, paths, paths, queryPaths, records, records, toDataStructure, toDataStructure, toExternalKey, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath, toPath
      • Methods inherited from interface org.refcodes.structure.PathMap.MutablePathMap

        insert, insert, insert, insert, insertFrom, insertFrom, insertTo, insertTo, put, putArray, putArray, remove, remove, removeAll, removeAll, removeFrom, removeFrom, removeFrom, removeFrom
      • Methods inherited from interface org.refcodes.structure.PathMap.PathMapBuilder

        withInsert, withInsert, withInsertFrom, withInsertTo
      • Methods inherited from interface org.refcodes.configuration.Properties

        getDelimiter, getType, query, query, queryFrom, queryTo, toMap, toProperties, toPropertyPath
      • Methods inherited from interface org.refcodes.configuration.Properties.MutableProperties

        containsValue, delete, delete, insert, insert, insertFrom, insertTo, put, putAll, putAll, putAll
      • Methods inherited from interface org.refcodes.configuration.Properties.PropertiesBuilder

        childrenOf, getIndexed, getIndexed, retrieve, retrieveFrom, retrieveTo, withInsert, withInsert, withInsertFrom, withInsertTo
      • 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
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin

        withPut
      • Methods inherited from interface org.refcodes.configuration.ResourceProperties

        reload, reload, toSerialized
      • Methods inherited from interface org.refcodes.configuration.ResourceProperties.MutableResoureProperties

        fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, flush, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, parseFrom, parseFrom, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, toSerialized
      • Methods inherited from interface org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder

        withSeekFrom
    • Constructor Detail

      • ObfuscationResourcePropertiesBuilderDecorator

        public ObfuscationResourcePropertiesBuilderDecorator​(org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder aProperties)
                                                      throws org.refcodes.component.OpenException
        Decorates the provided ResourceProperties.ResourcePropertiesBuilder with additional ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder behavior or functionality. Changes applied to the provided ResourceProperties.ResourcePropertiesBuilder affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The ResourceProperties.ResourcePropertiesBuilder to be decorated.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening the resources for writing back encrypted properties failed.
      • ObfuscationResourcePropertiesBuilderDecorator

        public ObfuscationResourcePropertiesBuilderDecorator​(org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder aProperties,
                                                             java.lang.String aDecryptPrefix,
                                                             java.lang.String aEncryptPrefix)
                                                      throws org.refcodes.component.OpenException
        Decorates the provided ResourceProperties.ResourcePropertiesBuilder with additional ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder behavior or functionality. Changes applied to the provided ResourceProperties.ResourcePropertiesBuilder affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The ResourceProperties.ResourcePropertiesBuilder 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:".
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening the resources for writing back encrypted properties failed.
      • ObfuscationResourcePropertiesBuilderDecorator

        public ObfuscationResourcePropertiesBuilderDecorator​(org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder aProperties,
                                                             java.lang.String aDecryptPrefix,
                                                             java.lang.String aEncryptPrefix,
                                                             org.refcodes.runtime.SystemContext aObfuscationMode)
                                                      throws org.refcodes.component.OpenException
        Decorates the provided ResourceProperties.ResourcePropertiesBuilder with additional ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder behavior or functionality. Changes applied to the provided ResourceProperties affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The ResourceProperties.ResourcePropertiesBuilder 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.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening the resources for writing back encrypted properties failed.
      • ObfuscationResourcePropertiesBuilderDecorator

        public ObfuscationResourcePropertiesBuilderDecorator​(org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder aProperties,
                                                             java.lang.String aDecryptPrefix,
                                                             java.lang.String aEncryptPrefix,
                                                             java.lang.String aSecret)
                                                      throws org.refcodes.component.OpenException
        Decorates the provided ResourceProperties.ResourcePropertiesBuilder with additional ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder behavior or functionality. Changes applied to the provided ResourceProperties.ResourcePropertiesBuilder affect the decorator. The given secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The ResourceProperties 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.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening the resources for writing back encrypted properties failed.
      • ObfuscationResourcePropertiesBuilderDecorator

        public ObfuscationResourcePropertiesBuilderDecorator​(org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder aProperties,
                                                             org.refcodes.runtime.SystemContext aObfuscationMode)
                                                      throws org.refcodes.component.OpenException
        Decorates the provided ResourceProperties.ResourcePropertiesBuilder with additional ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder behavior or functionality. Changes applied to the provided ResourceProperties affect the decorator. A host specific secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The ResourceProperties.ResourcePropertiesBuilder 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.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening the resources for writing back encrypted properties failed.
      • ObfuscationResourcePropertiesBuilderDecorator

        public ObfuscationResourcePropertiesBuilderDecorator​(org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder aProperties,
                                                             java.lang.String aSecret)
                                                      throws org.refcodes.component.OpenException
        Decorates the provided ResourceProperties.ResourcePropertiesBuilder with additional ObfuscationResourceProperties.ObfuscationResourcePropertiesBuilder behavior or functionality. Changes applied to the provided ResourceProperties.ResourcePropertiesBuilder affect the decorator. The given secret is used to encrypt and decrypt the according properties.
        Parameters:
        aProperties - The ResourceProperties to be decorated.
        aSecret - The secret to use when encrypting and decrypting the according properties.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening the resources for writing back encrypted properties failed.