Interface CipherVersionFactory<CV extends CipherVersion>

Type Parameters:
CV - The type of the CipherVersion to be created.
All Superinterfaces:
org.refcodes.factory.ContextLookupFactory<CV,String,String>
All Known Implementing Classes:
CipherVersionFactoryImpl

public interface CipherVersionFactory<CV extends CipherVersion> extends org.refcodes.factory.ContextLookupFactory<CV,String,String>
As requirements might arise to use CipherVersion instances with additional attributes or functionality; the CipherVersionFactory can be replaced with a custom implementation instantiating CipherVersion (sub-)types with the additional required attributes or functionality. Additional attributes might be a validity date useful for housekeeping or management purposes.

In case you provide your custom CipherVersionFactory implementation, make sure the cipher version (sub-)type you return fits with the CipherVersion (sub-)type of your custom CipherVersionGenerator. A good approach is to make your custom CipherVersionGenerator make use your custom CipherVersionFactory.

See the default implementations CipherVersionGeneratorImpl, the AbstractCipherVersionGenerator and the CipherVersionFactoryImpl.

  • Method Summary

    Modifier and Type
    Method
    Description
    createInstance(String aCipherUid, String aCipher)
    Factory method to be implemented by subclasses.

    Methods inherited from interface org.refcodes.factory.ContextLookupFactory

    createInstance
  • Method Details

    • createInstance

      CV createInstance(String aCipherUid, String aCipher)
      Factory method to be implemented by subclasses. Required to create implementation dependent CipherVersion objects.
      Specified by:
      createInstance in interface org.refcodes.factory.ContextLookupFactory<CV extends CipherVersion,String,String>
      Parameters:
      aCipherUid - The UID for the cipher to be stored in the CipherVersion
      aCipher - The cipher to be stored in the CipherVersion.
      Returns:
      The CipherVersion with the cipher UID and the cipher