|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--blackboard.platform.LicenseManager
Class used to parse and validate license files. Licenses are read from a simple XML file that
contains several different components to activate different parts of the application. Each component is
represented by a License object.
Note: This object is primarily for Blackboard use and should be considered very unstable. It may change substantially in future releases.
| Constructor Summary | |
LicenseManager(java.lang.String productName,
java.lang.String clientId,
java.lang.String productOwnedId,
License[] licenses,
java.lang.String key)
Instantiates a LicenseManager object with the specified parameters and license components. |
|
| Method Summary | |
void |
assertIsLicensed(java.lang.String componentName)
Similar to isLicensed(), except that exceptions are thrown if the license
check fails. |
java.lang.String |
getClientId()
Returns the client id fromt the LicenseFile |
static LicenseManager |
getInstance(java.io.File licenseFile)
Returns an instance of LicenseManager initialized with the specified file. |
static LicenseManager |
getInstance(java.io.File licenseFile,
boolean validate)
Returns an instance of LicenseManager initialized with the specified file. |
java.lang.String |
getKey()
Returns the validation key from the license file. |
java.util.Date |
getLicenseExpiration(java.lang.String componentName)
Returns the expiration for a given license or null if it never expires. |
java.lang.String |
getLicenseParameter(java.lang.String componentName,
java.lang.String propertyName)
Returns the value of the specified property in the target key or null if the property is not found. |
java.lang.Integer |
getLicenseUnitsParameter(java.lang.String componentName,
java.lang.String propertyName)
Returns the Integer value of the specified property in the target key or null if the property is not found. |
java.lang.String |
getProductName()
Returns the product name from the LicenseFile. |
java.lang.String |
getProductOwnedId()
Returns the product owned id fromt the LicenseFile |
boolean |
isLicensed(java.lang.String componentName)
Method to check whether the specified component name is available and valid. |
boolean |
isLicenseUnitsParameterUnlimited(java.lang.String componentName,
java.lang.String propertyName)
Returns true if specified the units parameter is unlimited. |
License[] |
listLicenses()
Returns an array of all License objects read from the license file. |
License |
lookupLicense(java.lang.String componentName)
Returns the License associated with the specified component key. |
LicenseDescriptor |
lookupLicenseDescriptor(java.lang.String componentName)
Looks up human-readable descriptor for specified component. |
void |
runtimeAssertIsLicensed(java.lang.String componentName)
Same as assertIsLicensed(), but exceptions are wrapped in a RuntimeBbServiceException.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LicenseManager(java.lang.String productName,
java.lang.String clientId,
java.lang.String productOwnedId,
License[] licenses,
java.lang.String key)
LicenseManager object with the specified parameters and license components.
productName - Product name in top-level element of the license file.clientId - Client id in the top-level element of the license file.productOwnedId - Product-owned id in the top-level element of the license file.licenses - All components successfully parsed from the license filekey - Validation key| Method Detail |
public java.lang.String getProductName()
public java.lang.String getProductOwnedId()
public java.lang.String getClientId()
public java.lang.String getKey()
public boolean isLicensed(java.lang.String componentName)
componentName - Component to check
public void assertIsLicensed(java.lang.String componentName)
throws LicenseNotFoundException,
LicenseExpiredException,
UnlicensedServerException
isLicensed(), except that exceptions are thrown if the license
check fails.
componentName - Component to check.
LicenseNotFoundException - if the license is not found
LicenseExpiredException - If the license is expired
UnlicensedServerException - If the license is not valid to run on this server
public void runtimeAssertIsLicensed(java.lang.String componentName)
throws RuntimeBbServiceException
assertIsLicensed(), but exceptions are wrapped in a RuntimeBbServiceException.
Use e.getNestedException() to get the actual LicenseException.
componentName - License component to check.
RuntimeBbServiceException - If any of the checks fails.
public java.util.Date getLicenseExpiration(java.lang.String componentName)
throws LicenseNotFoundException,
LicenseExpiredException,
UnlicensedServerException
componentName - License component to check
LicenseNotFoundException - if the license is not found
LicenseExpiredException - if the license is expired
UnlicensedServerException - if the license is not valid to run on this server
public java.lang.Integer getLicenseUnitsParameter(java.lang.String componentName,
java.lang.String propertyName)
throws LicenseNotFoundException,
LicenseExpiredException,
UnlicensedServerException
componentName - Component to check unit forpropertyName - Unit parameter to check
LicenseNotFoundException - if the license is not found
LicenseExpiredException - if the license is opined
UnlicensedServerException - if the license is not valid to run on this server
public boolean isLicenseUnitsParameterUnlimited(java.lang.String componentName,
java.lang.String propertyName)
throws LicenseNotFoundException,
LicenseExpiredException,
UnlicensedServerException
componentName - License component to checkpropertyName - Unit parameter to check
LicenseNotFoundException - if the license is not found
LicenseExpiredException - if the license is opined
UnlicensedServerException - if the license is not valid to run on this server
public java.lang.String getLicenseParameter(java.lang.String componentName,
java.lang.String propertyName)
throws LicenseNotFoundException,
LicenseExpiredException,
UnlicensedServerException
componentName - License component to checkpropertyName - Unit parameter to check
LicenseNotFoundException - if the license is not found
LicenseExpiredException - if the license is opined
UnlicensedServerException - if the license is not valid to run on this server
public License lookupLicense(java.lang.String componentName)
throws LicenseNotFoundException
License associated with the specified component key.
componentName - License to look up
LicenseNotFoundException - Thrown if the specified component is not found.public LicenseDescriptor lookupLicenseDescriptor(java.lang.String componentName)
componentName - Component to look up
LicenseDescriptorpublic License[] listLicenses()
License objects read from the license file.
License objects.
public static final LicenseManager getInstance(java.io.File licenseFile,
boolean validate)
throws InitializationException
LicenseManager initialized with the specified file.
licenseFile - File to read license data fromvalidate - Flag indicating whether to validate the licese data
InitializationException - Thrown if the file cannot be read or the license contains an invalid key
public static final LicenseManager getInstance(java.io.File licenseFile)
throws InitializationException
LicenseManager initialized with the specified file.
licenseFile - File to read license data from
LicenseManager
InitializationException - Thrown if the file cannot be read or the license contains an invalid key
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||