Package rs.baselib.licensing
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
-
Enum Constant Summary
Enum Constants Enum Constant Description OCTET_LICENSEA minimum scheme where the key consists of octets of characters, e.g.RSA_LICENSEA full blown scheme where the license consists of an encrypted message containing all data. -
Method Summary
Modifier and Type Method Description protected <T> Tcreate(java.lang.Class<T> clazz)Creates instance of the given class.ILicenseCreatorgetLicenseCreator()Returns an instance of the responsible license creator implementation.ILicenseVerifiergetLicenseVerifier()Returns an instance of the responsible license verifier implementation.static LicensingSchemevalueOf(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.
-
Enum Constant Details
-
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
A full blown scheme where the license consists of an encrypted message containing all data. This scheme requires RSA keys.
-
-
Method Details
-
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
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 namejava.lang.NullPointerException- if the argument is null
-
getLicenseCreator
Returns an instance of the responsible license creator implementation.- Specified by:
getLicenseCreatorin interfaceILicensingScheme- Returns:
- the license creator
-
getLicenseVerifier
Returns an instance of the responsible license verifier implementation.- Specified by:
getLicenseVerifierin interfaceILicensingScheme- 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
-