|
AGX Dynamics 2.41.1.2
|
The Runtime class will read a license file upon creation and check what configuration is allowed to run. More...
#include <Runtime.h>
Inheritance diagram for agx::Runtime:Public Types | |
| enum | HardwareTypes { NIC = 1 , USB = 2 , HDD = 3 } |
| typedef agx::Vector< UniqueIdStruct > | UniqueIdVector |
Public Types inherited from agx::Singleton | |
| enum | Priority { HIGHEST_PRIORITY = 2147483647 , LOWEST_PRIORITY = 10000 , DEFAULT_PRIORITY = 1073741824 } |
| Specifies the ranges of the priority which can be assigned to a singleton at the time of creation. More... | |
Public Member Functions | |
| bool | checkVersion (const agx::String &versionString, int generation, int major=-1, int minor=-1, int patch=-1) |
| Version string can be one of two variants: | |
| void | clear () |
| Clear any previously loaded license. | |
| virtual void | shutdown () override |
| Singleton cleanup method. | |
Online License System | |
| bool | activateAgxLicense (int licenseId, const agx::String &activationPassword) |
| Perform online activation of AGX. | |
| bool | activateAgxLicense (int licenseId, const agx::String &activationPassword, const agx::String &outputLicenseFile) |
| Perform online activation of AGX. | |
| bool | deactivateAgxLicense () |
| Deactivate the currently loaded license if the license type allows it. | |
| agx::String | readEncryptedLicense () |
| Read the encrypted license, normally the contents from the license file. | |
| bool | loadLicenseFile (const agx::String &licPath, bool forceRefresh=false) |
| Load a License file that was created by activating AGX. | |
| bool | loadLicenseString (const agx::String &licenseContents, bool forceRefresh=false) |
| Load a license but provided as a string instead of read from a file. | |
| bool | isLicenseRefreshed () |
| Check if license was refreshed upon loading. | |
| LicenseInfo | queryLicenseInformation (const agx::String &licenseContents) |
| Retrieves information from a license. | |
| agx::String | generateOfflineActivationRequest (int licenseId, const agx::String &activationPassword) |
| Generates an activation request for a machine that does not have Internet access. | |
| bool | processOfflineActivationRequest (const agx::String &activationResponse) |
| Processes the response from a manual activation request. | |
| bool | openNetworkSession (const agx::String &licenseFile="floating.lfx") |
| Try to open a network session using the specified floating license. | |
| bool | closeNetworkSession () |
| Close the active network session. | |
| bool | isFloatingLicense () const |
| Query licensetype. | |
| agx::String | encryptRuntimeActivation (int runtimeLicenseId, const agx::String &runtimeLicensePassword, const agx::String &applicationFilename) const |
| Encrypt license id and password for runtime activation. | |
| bool | activateEncryptedRuntime (const agx::String &encryptedRuntimeData, const agx::String &outputLicenseFile) |
| Perform online activation of an encrypted runtime license. | |
Legacy License functions | |
| const UniqueIdVector & | getUniqueIds () const |
| bool | hasKey (const char *key) const |
| const agx::String & | readValue (const char *key) const |
| bool | unlock (const char *licenseString) |
| Will try to unlock AGX with the license provided in licenseString. | |
| bool | unlock (const agx::String &licenseString) |
| bool | verifyAndUnlock (const char *licenseStr) |
| Unlock AGX Dynamics using obfuscated license string. | |
Status functions | |
| bool | isValid () const |
| const agx::String & | getStatus () const |
| Provides status information if license validation failed. | |
| const agx::String & | getExtendedStatus () const |
| Provides optional extended status information about why license validation failed. | |
| bool | isModuleEnabled (const char *name) const |
| Check if a named AGX module is enabled. | |
| const agx::StringVector & | getEnabledModules () const |
Public Member Functions inherited from agx::Singleton | |
| Singleton (int priority=DEFAULT_PRIORITY) | |
| Default constructor. | |
| virtual std::string | getClassName () const =0 |
| int | getPriority () const |
| Return the shutdown priority of the singleton instance. | |
| virtual void | shutdown ()=0 |
| Implement this method to cleanup your Singleton class. | |
Static Public Member Functions | |
| static agx::String | generateMD5 (const agx::String &deviceID) |
| Utility method using agxStream::MD5Checksum::getMD5. | |
| static Runtime * | instance () |
| Singleton instance method. | |
| static bool | isInitialized () |
Protected Member Functions | |
| Runtime () | |
| virtual | ~Runtime () |
Protected Member Functions inherited from agx::Singleton | |
| virtual | ~Singleton () |
| Destructor. | |
| void | _shutdown () |
The Runtime class will read a license file upon creation and check what configuration is allowed to run.
The license file should be placed where it can be found by agxIO::Environment via the RESOURCE_PATH or in a per-user directory as described in the user manual.
|
protected |
|
protectedvirtual |
| bool agx::Runtime::activateAgxLicense | ( | int | licenseId, |
| const agx::String & | activationPassword | ||
| ) |
Perform online activation of AGX.
On successful activation, the license will also be loaded.
| bool agx::Runtime::activateAgxLicense | ( | int | licenseId, |
| const agx::String & | activationPassword, | ||
| const agx::String & | outputLicenseFile | ||
| ) |
Perform online activation of AGX.
The received license will be stored to a file locally. Any previous parsed license information will be cleared. On successful activation, the license will also be loaded.
| bool agx::Runtime::activateEncryptedRuntime | ( | const agx::String & | encryptedRuntimeData, |
| const agx::String & | outputLicenseFile | ||
| ) |
Perform online activation of an encrypted runtime license.
If successful, the license will be written to outputLicenseFile.
| encryptedRuntimeData | - Encrypted data generated from encryptRuntimeActivation. |
| outputLicenseFile | - Resulting license file if the online activation is successful. |
getStatus()) for errors | bool agx::Runtime::checkVersion | ( | const agx::String & | versionString, |
| int | generation, | ||
| int | major = -1, |
||
| int | minor = -1, |
||
| int | patch = -1 |
||
| ) |
Version string can be one of two variants:
1) Version range: begin_range - end_range, 1.2-1.4, or 1-2, 1.2.3.4-1.3.4.5 2) Pure version: 1.2, 1, 1.2.3.4, Compare versionString with the version numbers. If generation.major.minor.patch <= versionString then this method returns true
generation always have to be supplied If you are only using three or fewer version numbers, start with generation then major etc.
| void agx::Runtime::clear | ( | ) |
Clear any previously loaded license.
| bool agx::Runtime::closeNetworkSession | ( | ) |
Close the active network session.
There will not be a valid license loaded after this call.
| bool agx::Runtime::deactivateAgxLicense | ( | ) |
Deactivate the currently loaded license if the license type allows it.
On failure, getStatus() will contain information about the failure
| agx::String agx::Runtime::encryptRuntimeActivation | ( | int | runtimeLicenseId, |
| const agx::String & | runtimeLicensePassword, | ||
| const agx::String & | applicationFilename | ||
| ) | const |
Encrypt license id and password for runtime activation.
The encryption will fail if applicationFilename isn't found in agxIO::Environment::RESOURCE_PATH, returning an empty string.
| runtimeLicenseId | - License id of the runtime license. |
| runtimeLicensePassword | - License password of the runtime license. |
| applicationFilename | - Filename (including relative path) to a file in the application that doesn't change (e.g., an executable or library). |
|
static |
Utility method using agxStream::MD5Checksum::getMD5.
| agx::String agx::Runtime::generateOfflineActivationRequest | ( | int | licenseId, |
| const agx::String & | activationPassword | ||
| ) |
Generates an activation request for a machine that does not have Internet access.
| const agx::StringVector & agx::Runtime::getEnabledModules | ( | ) | const |
| const agx::String & agx::Runtime::getExtendedStatus | ( | ) | const |
Provides optional extended status information about why license validation failed.
| const agx::String & agx::Runtime::getStatus | ( | ) | const |
Provides status information if license validation failed.
| const UniqueIdVector & agx::Runtime::getUniqueIds | ( | ) | const |
| bool agx::Runtime::hasKey | ( | const char * | key | ) | const |
| bool agx::Runtime::isFloatingLicense | ( | ) | const |
Query licensetype.
|
static |
| bool agx::Runtime::isLicenseRefreshed | ( | ) |
Check if license was refreshed upon loading.
| bool agx::Runtime::isModuleEnabled | ( | const char * | name | ) | const |
Check if a named AGX module is enabled.
| bool agx::Runtime::isValid | ( | ) | const |
| bool agx::Runtime::loadLicenseFile | ( | const agx::String & | licPath, |
| bool | forceRefresh = false |
||
| ) |
Load a License file that was created by activating AGX.
Some license types needs to be refreshed at a certain time interval and this file should be user writable to avoid the need for any manual handling or that the license must be refreshed every time AGX is initialized.
| bool agx::Runtime::loadLicenseString | ( | const agx::String & | licenseContents, |
| bool | forceRefresh = false |
||
| ) |
Load a license but provided as a string instead of read from a file.
This function is similar to loadLicenseFile, but takes the file contents as parameter instead of the filename.
Some license types are refreshed from online source when loading and to check if this has happened, isLicenseRefreshed should be used after this function and readEncryptedLicense if needed.
| bool agx::Runtime::openNetworkSession | ( | const agx::String & | licenseFile = "floating.lfx" | ) |
Try to open a network session using the specified floating license.
Internet access is needed for the network session to stay valid via periodic background polling. If the polling and retries fail, the license status can change to invalid.
| bool agx::Runtime::processOfflineActivationRequest | ( | const agx::String & | activationResponse | ) |
Processes the response from a manual activation request.
| LicenseInfo agx::Runtime::queryLicenseInformation | ( | const agx::String & | licenseContents | ) |
Retrieves information from a license.
If successful the licenseType field is non-negative.
| agx::String agx::Runtime::readEncryptedLicense | ( | ) |
Read the encrypted license, normally the contents from the license file.
If no license is loaded, this will return the empty string
| const agx::String & agx::Runtime::readValue | ( | const char * | key | ) | const |
|
overridevirtual |
| bool agx::Runtime::unlock | ( | const agx::String & | licenseString | ) |
| bool agx::Runtime::unlock | ( | const char * | licenseString | ) |
Will try to unlock AGX with the license provided in licenseString.
This string should contain the same information as the AGX license files normally used.
If Runtime already had parsed a license and the method isValid returns true, using this method will cause isValid to return false if licenseString is not considered valid.
| bool agx::Runtime::verifyAndUnlock | ( | const char * | licenseStr | ) |
Unlock AGX Dynamics using obfuscated license string.
The input string is un-obfuscated to produce an agx.lic-type license string that is passed to unlock. The obfuscated string is produced by running RuntimeKeyGenerator –obfuscate agx.lic obfuscated.txt where RuntimeKeyGenerator is included in the AGX Dynamics installation.
| licenseStr | Obfuscated license string. |