|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.platform.LicenseManager
public final class 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 |
getAppPack()
|
java.lang.String |
getBuildNumber()
|
java.lang.String |
getClientId()
Returns the client id fromt the LicenseFile |
java.lang.String |
getFamilyNameUpdateHtml()
|
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 |
getLongProductName()
For the Web: HTML for bold, italic, superscript etc. tagged around each product if multiple products exist. |
java.lang.String |
getLongProductNameHtml()
For the Web: HTML for bold, italic, superscript etc. tagged around each product if multiple products exist. |
java.lang.String |
getLongProductNameHtmlTm()
For the Web: HTML for bold, italic, TM, superscript etc. tagged around each product if multiple products exist. |
java.lang.String |
getMajorReleaseNumber()
|
java.lang.String |
getProductFamilyName()
• For the Web: HTML for bold, italic, superscript etc. |
java.lang.String |
getProductFamilyNameHtml()
• For the Web: HTML for bold, italic, superscript etc. |
java.lang.String |
getProductFamilyNameHtmlTm()
• For the Web: HTML for bold, italic, TM, superscript etc. |
java.lang.String |
getProductName()
Returns the product name from the LicenseFile. |
java.lang.String |
getProductOwnedId()
Returns the product owned id fromt the LicenseFile |
java.lang.String |
getUpdateName()
|
java.lang.String |
getUpdateNameLong()
|
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 keyMethod 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 serverpublic 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 serverpublic 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 serverpublic 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 serverpublic 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 serverpublic 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
LicenseDescriptor
public 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 keypublic 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 keypublic java.lang.String getBuildNumber()
public java.lang.String getLongProductName()
public java.lang.String getLongProductNameHtml()
public java.lang.String getLongProductNameHtmlTm()
public java.lang.String getMajorReleaseNumber()
public java.lang.String getProductFamilyName()
public java.lang.String getProductFamilyNameHtml()
public java.lang.String getProductFamilyNameHtmlTm()
public java.lang.String getUpdateName()
public java.lang.String getUpdateNameLong()
public java.lang.String getFamilyNameUpdateHtml()
public java.lang.String getAppPack()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |