Package rs.baselib.licensing
Class LicenseGenerator
java.lang.Object
rs.baselib.licensing.LicenseGenerator
public class LicenseGenerator
extends java.lang.Object
The generator for license.
- Author:
- ralph
-
Constructor Summary
Constructors Constructor Description LicenseGenerator()Constructor.LicenseGenerator(ILicenseCreator licenseCreator)Constructor.LicenseGenerator(ILicensingScheme scheme)Constructor. -
Method Summary
Modifier and Type Method Description java.lang.StringcreateLicenseKey(java.lang.Class<? extends ILicense> licenseClass, ILicenseContext context)Generates a license key using the given license class and context.java.lang.StringcreateLicenseKey(ILicenseContext context)Generates a key using the given context.java.lang.StringcreateLicenseKey(ILicenseContext context, ILicense license)Generates a key from the given license.ILicenseCreatorgetLicenseCreator()Returns thelicenseCreator.
-
Constructor Details
-
LicenseGenerator
Constructor.- Throws:
DecryptionException- when the license scheme cannot be created
-
LicenseGenerator
Constructor.- Parameters:
scheme- - the licensing scheme to use- Throws:
DecryptionException- when the license scheme cannot be created
-
LicenseGenerator
Constructor.- Parameters:
licenseCreator- the creator for licenses- Throws:
DecryptionException- when the license scheme cannot be created
-
-
Method Details
-
getLicenseCreator
Returns thelicenseCreator.- Returns:
- the licenseCreator
-
createLicenseKey
Generates a key using the given context.- Parameters:
context- containing all properties for the license- Returns:
- the license key generated
-
createLicenseKey
public java.lang.String createLicenseKey(java.lang.Class<? extends ILicense> licenseClass, ILicenseContext context)Generates a license key using the given license class and context.- Parameters:
licenseClass- the class to be used for generating the licensecontext- containing all properties for the license- Returns:
- the license key generated
-
createLicenseKey
Generates a key from the given license.- Parameters:
context- the licnesing contextlicense- the license to be created- Returns:
- the license key
-