Enum LicensingScheme

java.lang.Object
java.lang.Enum<LicensingScheme>
rs.baselib.licensing.LicensingScheme
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<LicensingScheme>, java.lang.constant.Constable, ILicensingScheme

public enum LicensingScheme
extends java.lang.Enum<LicensingScheme>
implements ILicensingScheme
Describes the alternative ways to produce a license key.
Author:
ralph
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum Constant Description
    OCTET_LICENSE
    A minimum scheme where the key consists of octets of characters, e.g.
    RSA_LICENSE
    A full blown scheme where the license consists of an encrypted message containing all data.
  • Method Summary

    Modifier and Type Method Description
    protected <T> T create​(java.lang.Class<T> clazz)
    Creates instance of the given class.
    ILicenseCreator getLicenseCreator()
    Returns an instance of the responsible license creator implementation.
    ILicenseVerifier getLicenseVerifier()
    Returns an instance of the responsible license verifier implementation.
    static LicensingScheme valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static LicensingScheme[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • OCTET_LICENSE

      public static final LicensingScheme OCTET_LICENSE
      A minimum scheme where the key consists of octets of characters, e.g. 12345678-ABCDEF23-78AB45ZG.

      This scheme requires DSA keys.

    • RSA_LICENSE

      public static final LicensingScheme RSA_LICENSE
      A full blown scheme where the license consists of an encrypted message containing all data. This scheme requires RSA keys.
  • Method Details

    • values

      public static LicensingScheme[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static LicensingScheme valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • getLicenseCreator

      public ILicenseCreator getLicenseCreator()
      Returns an instance of the responsible license creator implementation.
      Specified by:
      getLicenseCreator in interface ILicensingScheme
      Returns:
      the license creator
    • getLicenseVerifier

      public ILicenseVerifier getLicenseVerifier()
      Returns an instance of the responsible license verifier implementation.
      Specified by:
      getLicenseVerifier in interface ILicensingScheme
      Returns:
      the license verifier
    • create

      protected <T> T create​(java.lang.Class<T> clazz)
      Creates instance of the given class.
      Type Parameters:
      T - type of class
      Parameters:
      clazz - the class to be instantiated
      Returns:
      the instance