BSAPI
Public Member Functions
SLicenseManagerI Class Reference

License manager. More...

#include <bsapi.h>

Inheritance diagram for SLicenseManagerI:
SUnknownI

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.

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:

gid.cpp, kws.cpp, lid.cpp, offlinerec3.cpp, sid.cpp, vpcompare.cpp, and vpextract.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:
licenseIdlicense 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:
appIdapplication 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:
interfaceIdinterface 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:
interfaceIdinterface 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:
interfaceIdinterface identifier
Returns:
number of seconds to the license expiration
Examples:
kws.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:
pFilelicense file
Examples:
gid.cpp, kws.cpp, lid.cpp, offlinerec3.cpp, sid.cpp, vpcompare.cpp, and vpextract.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:
licenseIdlicense identifier
Returns:
true if the license has been successfuly released

The documentation for this class was generated from the following file: