dca::License Class Reference
[DCA Base Package]

#include <base_classes.h>

List of all members.


Detailed Description

Use a License to initialize a classification package or a toolbox package.

See also:
DcaInstance::createLicense()

Definition at line 558 of file base_classes.h.

Public Member Functions

bool isLicensed (DCA_MODULE_ID_TYPE id=0, bool force=false) const
 Checks whether the given License is valid for the given module id.
int getMaxSessions () const
 Returns the maximum allowed sessions associated with your ticket/license.
int getMaxUsers () const
 Returns the maximum allowed users associated with your ticket/license.
LogLevel setLogLevel (LogLevel newLevel)
 Sets the logging level for the given class instance. The old value will be returned.
std::string getTicket () const
 Returns the ticket of the license as string.
std::string getSession () const
 Returns the session of the license as string.
bool getCustomData (std::string &customData) const
 Returns CustomData as string if available. Whether custom data are available or not depends on your ticket.
time_t getExpirationDate () const
 Returns the expiration date of the license in UTC.
std::string getLastMessage () const
 Returns the last message received from our license server or if none available the last available message from the license component itself.

Member Function Documentation

bool dca::License::isLicensed ( DCA_MODULE_ID_TYPE  id = 0,
bool  force = false 
) const

Checks whether the given License is valid for the given module id.

If called with 0 as module id the overall license status will be returned. You can use this e.g. with the UpdateModule::ID, UrlCustomDbModule::ID, TextClassification::ID, UrlClassification::ID or ZlaClassification::ID to check your license status for the specific module.

Parameters:
[in] id The module id to check
[in] force To force the license check to contact the license server set this parameter to true
Returns:
true if still licensed, else false.
Note:
Normally the internally cached license status is returned. The license server is only contacted at license creation and at a fixed interval (every 23 hours). If the license server is contacted the data stored in the license object (ie number of sessions or users, custom data) can change. To force the license check to contact the server set the force parameter to true. Usually it is best to set this parameter to false. Only in rare situations if you want to check for new license data or your last license check failed set this parameter to true! If the license server is contacted and the session changes it is possible that running updates are aborted!
int dca::License::getMaxSessions (  )  const

Returns the maximum allowed sessions associated with your ticket/license.

Returns:
Numeric value, 0 if License is not valid or not assigned.
int dca::License::getMaxUsers (  )  const

Returns the maximum allowed users associated with your ticket/license.

Returns:
Numeric value, 0 if License is not valid or not assigned.
LogLevel dca::License::setLogLevel ( LogLevel  newLevel  ) 

Sets the logging level for the given class instance. The old value will be returned.

Usually the logging level is set to LOG_Notice.

Parameters:
[in] newLevel The new LogLevel the class instance should use for logging
Returns:
The old used logging level.
std::string dca::License::getTicket (  )  const

Returns the ticket of the license as string.

Returns:
The ticket of the license as string
Note:
If the License is not correctly initialized an exception of type ExDca is thrown.
std::string dca::License::getSession (  )  const

Returns the session of the license as string.

Returns:
The session of the license as string
Note:
If the License is not correctly initialized an exception of type ExDca is thrown.
bool dca::License::getCustomData ( std::string &  customData  )  const

Returns CustomData as string if available. Whether custom data are available or not depends on your ticket.

Parameters:
[out] customData The string representation of the custom data
Returns:
Whether custom data are available or not.
Note:
If the License is not correctly initialized an exception of type ExDca is thrown.
time_t dca::License::getExpirationDate (  )  const

Returns the expiration date of the license in UTC.

Returns:
Returns the expiration date of the license.
Note:
If the License is not correctly initialized an exception of type ExDca is thrown.
std::string dca::License::getLastMessage (  )  const

Returns the last message received from our license server or if none available the last available message from the license component itself.

You may use the last message string for detailed descriptions of the last license operation or in case of error (see License::isLicensed()) for a detailed error description.

The returning string is in the format:

[server-message"|"server-rc] | [license component message]
Returns:
The last server message and if not available the last message from the license component.

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

Generated on 26 Sep 2016 for dca_interface by  doxygen 1.6.1