Skip to content

Commit

Permalink
Merge pull request #14 from cryptlex/muneeb/request-offline-floating-…
Browse files Browse the repository at this point in the history
…license

feat: add request offline floating license
  • Loading branch information
ahmad-kemsan authored Aug 6, 2024
2 parents 3bd2ed6 + b3b8c19 commit 0d8893d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lexfloatclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,27 @@ func HasFloatingLicense() int {
return int(status)
}

/*
FUNCTION: RequestOfflineFloatingLicense()
PURPOSE: Sends the request to lease the license from the LexFloatServer for offline usage.
The maximum value of lease duration is configured in the config.yml of LexFloatServer
PARAMETERS:
* leaseDuration - value of the lease duration.
RETURN CODES: LF_OK, LF_FAIL, LF_E_PRODUCT_ID, LF_E_LICENSE_EXISTS, LF_E_HOST_URL,
LF_E_LICENSE_LIMIT_REACHED, LF_E_INET, LF_E_TIME, LF_E_CLIENT, LF_E_IP, LF_E_SERVER,
LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED,
LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED, LF_E_WMIC, LF_E_SYSTEM_PERMISSION
*/
func RequestOfflineFloatingLicense(leaseDuration uint) int {
cLeaseDuration := (C.uint)(leaseDuration)
status := C.RequestOfflineFloatingLicense(cLeaseDuration)
return int(status)
};

/*
FUNCTION: IncrementFloatingClientMeterAttributeUses()
Expand Down
17 changes: 17 additions & 0 deletions lexfloatclient/LexFloatClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,23 @@ LEXFLOATCLIENT_API int LF_CC DropFloatingLicense();
*/
LEXFLOATCLIENT_API int LF_CC HasFloatingLicense();

/*
FUNCTION: RequestOfflineFloatingLicense()
PURPOSE: Sends the request to lease the license from the LexFloatServer for offline usage.
The maximum value of lease duration is configured in the config.yml of LexFloatServer
PARAMETERS:
* leaseDuration - value of the lease duration.
RETURN CODES: LF_OK, LF_FAIL, LF_E_PRODUCT_ID, LF_E_LICENSE_EXISTS, LF_E_HOST_URL,
LF_E_LICENSE_LIMIT_REACHED, LF_E_INET, LF_E_TIME, LF_E_CLIENT, LF_E_IP, LF_E_SERVER,
LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED,
LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED, LF_E_WMIC, LF_E_SYSTEM_PERMISSION
*/
LEXFLOATCLIENT_API int LF_CC RequestOfflineFloatingLicense(uint32_t leaseDuration);

/*
FUNCTION: GetFloatingClientLeaseExpiryDate()
Expand Down

0 comments on commit 0d8893d

Please sign in to comment.