dca_interface  6.3.4
Set up a license object

After successful initialization of the dca::DcaInstance you need to set up a dca::License object.

A license object is required for the initialization of SCA modules, and the creation of SCA base data objects.

Initialization

To create a license object, setup and initialize a dca::LicenseData structure, then call the function dca::DcaInstance::createLicense(). To initialize the dca::LicenseData structure you will need to specify a

  • license ticket and a
  • product key

These will have been provided for you with your license data.

Once the license object has been created, you can check whether a particular module is licensed using the dca::License::isLicensed() function.

The license object uses an HTTPS connection to retrieve the current license status of your provided ticket information from the IBM license servers.

Sample code

The following code demonstrates how to set up a license object.

// assume we successfully initialized the DCA and have a valid DcaInstance myDca
dca::LicenseData myLicenseData;
myLicenseData.ticket = "DCC7-1A26-123A-27..";
myLicenseData.product = "DC";
dca::License myLicense = myDca.createLicense( myLicenseData );
if( !myLicense.isLicensed() ) {
cout << "Entered License is not valid!" << endl;
return 5;
}
// myLicense is valid and can be used for package initializations

Demo Tickets

It is possible to obtain a demo ticket for the SDK which is valid for one month (from the date of creation). To obtain a demo ticket, use the ticket code "XXXX" in place of the full ticket data.

After a successful call to createLicense(), the license object will contain the full ticket data for the demo ticket. This can be retrieved from the license object with a call to dca::License::getTicket(). The new ticket data should be then used in subsequent calls to dca::DcaInstance::createLicense().

Using License objects

A license object is bound to a specific ticket. All SDK functionality made available with a particular ticket can be obtained by using a single license object instance.

We recommend therefore that a single license object is used per ticket, and that this object is used wherever a license is required by an API function.

Is used to create a License object. A license first must be created with DcaInstance::createLicense t...
Definition: base_classes.h:547
Use a License to initialize a classification package or a toolbox package.
Definition: base_classes.h:560
bool isLicensed(DCA_MODULE_ID_TYPE id=0, bool force=false) const
Checks whether the given License is valid for the given module id.
std::string ticket
The ticket as provided in the license.
Definition: base_classes.h:548
std::string product
The product code used with the license.
Definition: base_classes.h:549
License createLicense(const LicenseData &licData, const ProxySettings &proxySettings=ProxySettings(), LogLevel aLogLevel=LOG_Initial) const
Creates a License object using the given LicenseData.