SLicenseManagerI Class Reference

License manager. More...

#include <bsapi.h>

List of all members.

Public Member Functions

virtual void BSAPI_METHOD RegisterLicenseFile (const char *pFile)=0
 Register license file to use with license manager.
virtual unsigned int BSAPI_METHOD GetLicense (unsigned int appId)=0
 Get license from server.
virtual bool BSAPI_METHOD CheckLicense (unsigned int licenseId, bool forceReCheck=false)=0
 Check license for its validity.
virtual long_long BSAPI_METHOD GetSecsToExpire (unsigned int interfaceId)=0
 Gets the number of seconds to the license expiration for the given interface ID.
virtual int BSAPI_METHOD GetNLicenses (unsigned int interfaceId)=0
 Gets the total number of licenses for the given interface ID.
virtual int BSAPI_METHOD GetNUsedLicenses (unsigned int interfaceId)=0
 Gets the number of used licenses for the given interface ID.
virtual bool BSAPI_METHOD ReleaseLicense (unsigned int licenseId)=0
 Return license to server for its future reuse.
virtual void BSAPI_METHOD SetErrorHandler (SErrorCallbackI *pErrorHandler)=0
 Set error handler.


Detailed Description

License manager.

License manager is primarily used for controlling access to other library objects but it may be used for custom application license management too. To use licensed objects within library it is necessary to get instance of license manager by calling BSAPIGetLicenseManager(). Before creation of desired licensed instance by BSAPICreateInstance() it is needed to pass a name of license file to the instance of license manager by RegisterLicenseFile().

Examples:

gender_identification.cpp, keyword_spotting.cpp, language_identification.cpp, and speaker_identification.cpp.


Member Function Documentation

virtual bool BSAPI_METHOD SLicenseManagerI::CheckLicense ( unsigned int  licenseId,
bool  forceReCheck = false 
) [pure virtual]

Check license for its validity.

Based on license identifier obtained by previous calling of GetLicense() method checks if the license is still valid. By default result depends on the last license check being done regularly in background but it is also possible to force immediate check on server however it might be more time consuming.

Parameters:
licenseId license identifier
forceReCheck 
  • true contact server to check license validity
  • false get cached license validity
Returns:
true if the license is valid

virtual unsigned int BSAPI_METHOD SLicenseManagerI::GetLicense ( unsigned int  appId  )  [pure virtual]

Get license from server.

Based on application identifier and license data stored in license file method asks the server for license and returns its identifier.

Parameters:
appId application identifier
Returns:
license identifier or LICM_NOLICENSE in case the license is not valid or other error occured

virtual int BSAPI_METHOD SLicenseManagerI::GetNLicenses ( unsigned int  interfaceId  )  [pure virtual]

Gets the total number of licenses for the given interface ID.

Parameters:
interfaceId interface identifier
Returns:
total number of licenses

virtual int BSAPI_METHOD SLicenseManagerI::GetNUsedLicenses ( unsigned int  interfaceId  )  [pure virtual]

Gets the number of used licenses for the given interface ID.

Parameters:
interfaceId interface identifier
Returns:
number of used licenses

virtual long_long BSAPI_METHOD SLicenseManagerI::GetSecsToExpire ( unsigned int  interfaceId  )  [pure virtual]

Gets the number of seconds to the license expiration for the given interface ID.

Parameters:
interfaceId interface identifier
Returns:
number of seconds to the license expiration
Examples:
keyword_spotting.cpp.

virtual void BSAPI_METHOD SLicenseManagerI::RegisterLicenseFile ( const char *  pFile  )  [pure virtual]

Register license file to use with license manager.

Data needed for successful licensing process (e.g. licensing server address) are stored in a file. This method associates the file with license manager.

Parameters:
pFile license file
Examples:
gender_identification.cpp, keyword_spotting.cpp, language_identification.cpp, and speaker_identification.cpp.

virtual bool BSAPI_METHOD SLicenseManagerI::ReleaseLicense ( unsigned int  licenseId  )  [pure virtual]

Return license to server for its future reuse.

Contacts server to return license obtained by previous call of GetLicense(). License is then free for use by other users.

Parameters:
licenseId license identifier
Returns:
true if the license has been successfuly released

virtual void BSAPI_METHOD SLicenseManagerI::SetErrorHandler ( SErrorCallbackI pErrorHandler  )  [pure virtual]

Set error handler.

Some functions of this class signalize success by true and failure by false. But it is usually necessary to know a cause of an error in detail. The default behaviour of this class is to send an error code and text message to a callback to allow to log the error or to display the error to a user when the error happened. The error handler also receives warnings and log messages. If the error handler is not set, the messages are printed to the standard output. All error, warning and log codes send by SLicenseManagerI can be found in Error, warning and log codes for SLicenseManagerI.

Parameters:
pErrorHandler pointer to instance of error handler
Examples:
gender_identification.cpp, keyword_spotting.cpp, language_identification.cpp, and speaker_identification.cpp.


The documentation for this class was generated from the following file:
Generated on Wed Jul 15 10:10:12 2009 for BSAPI by  doxygen 1.4.7