#include <base_classes.h>
Use a License to initialize a classification package or a toolbox package.
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. |
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.
[in] | id | The module id to check |
[in] | force | To force the license check to contact the license server set this parameter to true |
int dca::License::getMaxSessions | ( | ) | const |
Returns the maximum allowed sessions associated with your ticket/license.
int dca::License::getMaxUsers | ( | ) | const |
Returns the maximum allowed users associated with your ticket/license.
Sets the logging level for the given class instance. The old value will be returned.
Usually the logging level is set to LOG_Notice.
[in] | newLevel | The new LogLevel the class instance should use for logging |
std::string dca::License::getTicket | ( | ) | const |
std::string dca::License::getSession | ( | ) | const |
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.
[out] | customData | The string representation of the custom data |
time_t dca::License::getExpirationDate | ( | ) | const |
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: