dca_interface
6.3.4
|
#include <base_classes.h>
Use a License to initialize a classification package or a toolbox package.
Definition at line 559 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. More... | |
int | getMaxSessions () const |
Returns the maximum allowed sessions associated with your ticket/license. More... | |
int | getMaxUsers () const |
Returns the maximum allowed users associated with your ticket/license. More... | |
LogLevel | setLogLevel (LogLevel newLevel) |
Sets the logging level for the given class instance. The old value will be returned. More... | |
std::string | getTicket () const |
Returns the ticket of the license as string. More... | |
std::string | getSession () const |
Returns the session of the license as string. More... | |
bool | getCustomData (std::string &customData) const |
Returns CustomData as string if available. Whether custom data are available or not depends on your ticket. More... | |
time_t | getExpirationDate () const |
Returns the expiration date of the license in UTC. More... | |
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. More... | |
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. \param[in] id The module id to check \param[in] force To force the license check to contact the license server set this parameter to true \return 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.
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: