Documents > BPS V2 Script API
bps::LicenseToken Class Reference

The license token is used to check permission of software usage, and maintains the list in table t_licensetokens. More...

List of all members.

Public Member Functions

void clear ()
 Clears the token and releases the license for re-use.
 LicenseToken (Datastore aDatastore, String aLicenser, String aLicenseGroup, String aProgram)
 Constructor for the LicenseToken objects.
void update ()
 Makes sure the token is still present and unmodified in table t_licensetokens, and updates the timestamp.
Date validate ()
 Checks the license token.

Detailed Description

The license token is used to check permission of software usage, and maintains the list in table t_licensetokens.

It is good practice for all applications to create and validate, and regularly update license tokens, even if usage of a license group is free and unlimited. That way all activities of the system can be monitored.


Constructor & Destructor Documentation

bps::LicenseToken::LicenseToken ( Datastore  aDatastore,
String  aLicenser,
String  aLicenseGroup,
String  aProgram 
)

Constructor for the LicenseToken objects.

The token needs to be validated before becoming effective.

Parameters:
aDatastoreThe current datastore connection. Should be connected and checked in.
aLicenserName of the software license granter.
aLicenseGroupName of the license group.
aProgramName of the program.

Member Function Documentation

void bps::LicenseToken::clear ( )

Clears the token and releases the license for re-use.

The token is also cleared when the object is destructed.

void bps::LicenseToken::update ( )

Makes sure the token is still present and unmodified in table t_licensetokens, and updates the timestamp.

This method should be called regularly by the application.

Exceptions:
Errorthrown when no success.
Date bps::LicenseToken::validate ( )

Checks the license token.

This is the first action to do after creating the new token.

Returns:
Expire date of the license. Usually the application would display a warning if there is less than 30 days left before expire date.
Exceptions:
Errorthrown when validation fails.