LicenseSpring .Net SDK 7.22.0
Easily add Software Licensing to your application
LicenseSpring.ILicense Interface Reference

License interface More...

Inheritance diagram for LicenseSpring.ILicense:
LicenseSpring.License

Public Member Functions

void AddDeviceVariable (DeviceVariable variable)
 Add new or update existing device variable to license data More...
 
void AddDeviceVariable (string name, string value)
 Add new or update existing device variable to license data More...
 
void AddDeviceVariables (DeviceVariable[] variables)
 Add new or update existing device variables to license data More...
 
void Borrow (DateTime endDateTime)
 Borrow floating license till provided end date time More...
 
void Borrow (string borrowEndDateTime=null)
 Borrow floating license till provided end date time string More...
 
void Borrow (uint hours, uint days)
 Borrow floating license for provided time interval More...
 
bool CanBorrow ()
 Is this license can be borrowed or not More...
 
bool ChangePassword (string password, string newPassword)
 Change password for user-based license More...
 
InstallationFile Check (IInstallationFileOptions options=null)
 Check current license for validity on the LicenseSpring platform More...
 
ConsumptionPeriod ConsumptionPeriod ()
 Period of time after which consumption is reset. More...
 
CustomField[] CustomFields ()
 Custom data fields available for the license More...
 
int DaysPassedSinceLastCheck ()
 How many days passed since last online check More...
 
int DaysRemaining ()
 How many days remaining till license expires in current time zone More...
 
int DaysRemainingUTC ()
 How many days remaining till license expires More...
 
bool Deactivate (bool removeLocalData=false)
 Deactivate current license More...
 
void DeactivateAirGap (string confirmationCode)
 Verify Confirmation code and deactivate air gap license More...
 
string DeactivateOffline (string deactivationRequestFile=null)
 Deactivate license locally and create offline deactivation file request More...
 
DeviceVariable DeviceVariable (string name)
 Get device variable by name More...
 
string DeviceVariableValue (string name)
 Get device variable value by name More...
 
LicenseFeature Feature (string featureCode)
 Get product (license) feature by feature code More...
 
LicenseFeature[] Features ()
 Product features available for the license More...
 
string FloatingClientId ()
 Floating user (client) or instance id More...
 
DateTime FloatingEndDateTime ()
 Floating license validity end date time in local time zone More...
 
DateTime FloatingEndDateTimeUtc ()
 Floating license validity end date time in UTC More...
 
uint FloatingSlotsCount ()
 Overall Floating slots or users count. Amount of simultaneous users (instances) allowed for this license. More...
 
uint FloatingSlotsInUse ()
 Current floatings slots in use count, including this user (instance). More...
 
uint FloatingTimeout ()
 Floating timeout in minutes More...
 
string GetAirGapDeactivationCode (string initializationCode)
 Get air gap Deactivation code. More...
 
DeviceVariable[] GetDeviceVariables (bool getFromBackend=false)
 Get device variables from the local license or from the backend More...
 
ProductDetails GetProductDetails ()
 Get information about a product this license belongs to More...
 
DateTime GracePeriodEndDateTime ()
 Getter for grace period end date time in local time More...
 
DateTime GracePeriodEndDateTimeUTC ()
 Getter for grace period end date time in UTC More...
 
double GracePeriodHoursRemaining ()
 How many hours remaining till grace period ends More...
 
LicenseID Id ()
 License ID More...
 
bool IsAirGapped ()
 Is this license was activated using air-gap activation More...
 
bool IsBorrowed ()
 Checker for whether the license is borrowed More...
 
bool IsConsumptionOverageAllowed ()
 Is it allowed to exceed consumption for this license. More...
 
bool IsConsumptionResetEnabled ()
 Indicates whether consumption resets after a certain period of time. More...
 
bool IsDeviceTransferAllowed ()
 Checks if license can be transfered between devices More...
 
bool IsDeviceTransferLimited ()
 Checks if the license allows only limited number of transfers between devices More...
 
bool IsExpired ()
 Is license expired More...
 
bool IsFloating ()
 Is this license floating More...
 
bool IsGracePeriodStarted ()
 Check if grace period started for a license More...
 
bool IsMaintenancePeriodExpired ()
 Is maintenance period expired More...
 
bool IsOfflineActivated ()
 Is this license was activated offline More...
 
bool IsSubscriptionGracePeriodStarted ()
 Check if grace period started for subscription license More...
 
bool IsTrial ()
 Is this license trial More...
 
bool IsUnlimitedConsumptionAllowed ()
 Is unlimited consumption allowed for the license More...
 
bool IsValid ()
 Fast and simple way to check current local state of the license. More...
 
string Key ()
 License key More...
 
DateTime LastCheckDate ()
 The DateTime of the last sync with the LicenseSpring platform More...
 
DateTime LastCheckDateUTC ()
 The DateTime of the last sync with the LicenseSpring platform More...
 
LicenseUser LicenseUser ()
 License user More...
 
void LocalCheck ()
 Perform check for license validity locally More...
 
int MaintenanceDaysRemaining ()
 How many days remaining till maintenance period expires in current time zone More...
 
DateTime MaintenancePeriod ()
 Maintenance period for the license More...
 
DateTime MaintenancePeriodUTC ()
 Maintenance period for the license More...
 
uint MaxActivations ()
 How many times license can be activated More...
 
uint MaxBorrowTime ()
 Maximum borrowing period in hours More...
 
int MaxConsumption ()
 Maximum consumption of the license More...
 
int MaxConsumptionOverage ()
 Extra amount of consumption that allows to go over MaxConsumption. More...
 
string Metadata ()
 License metadata More...
 
Customer Owner ()
 Gets the information about license owner, commonly it's a person or organization associated with the license More...
 
uint PolicyId ()
 License Policy id More...
 
void Register ()
 Register floating license and occupy floating slot. More...
 
void Release (bool throwExceptions=false)
 Stop license watchdog thread and revoke floating license so other user can use it. More...
 
void ResumeLicenseWatchdog ()
 Restart background thread, you can call this within you callback in order to resume periodic license checks. More...
 
bool SendDeviceVariables ()
 Send current device variables list to the backend (see device variables on the platform) More...
 
void SetupLicenseWatchdog (LicenseWatchdogCallback callback, uint timeout=0)
 Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive. More...
 
void SetupLicenseWatchdog (LicenseWatchdogSettings settings)
 Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive. More...
 
void SetWatchdogTimeout (uint timeout=0)
 Set new timout for license watchdog. More...
 
DateTime StartDate ()
 License start date More...
 
LicenseStatus Status ()
 Method for getting local license status, see LicenseStatus documentation More...
 
void StopLicenseWatchdog ()
 Stops license watchdog background thread. More...
 
uint SubscriptionGracePeriod ()
 Grace period in hours More...
 
bool SyncConsumption (OverageRequest overageRequest=null)
 Sync Consumption license with the LicenseSpring platform More...
 
bool SyncFeatureConsumption (string featureCode=null)
 Sync Consumption feature with the LicenseSpring platform More...
 
uint TimesActivated ()
 How many times license already been activated More...
 
int TotalConsumption ()
 Current total consumption of the license More...
 
uint TransferCount ()
 How many times license has been transferred between devices More...
 
uint TransferLimit ()
 Maximum number of allowed license transfers between devices More...
 
LicenseType Type ()
 Type of license More...
 
void UpdateConsumption (int value=1)
 Increase local consumption counter for consumption license More...
 
void UpdateFeatureConsumption (string featureCode, int value=1)
 Increase local consumption counter for consumption product feature. More...
 
bool UpdateOffline (string path)
 Update license data accordingly to provided file. More...
 
string User ()
 Email of the License user More...
 
DateTime ValidityPeriod ()
 The DateTime until the license is valid More...
 
DateTime ValidityPeriodUTC ()
 The DateTime until the license is valid More...
 
DateTime ValidityWithGracePeriod ()
 The DateTime until the license is valid including grace period More...
 
DateTime ValidityWithGracePeriodUTC ()
 The DateTime until the license is valid including grace period More...
 

Detailed Description

License interface

Provides all information on a license and license check methods.

Member Function Documentation

◆ AddDeviceVariable() [1/2]

void LicenseSpring.ILicense.AddDeviceVariable ( DeviceVariable  variable)

Add new or update existing device variable to license data

Variable will be stored in local license, in order to send device variables to the backend see License.SendDeviceVariables

Parameters
variableDevice variable

Implemented in LicenseSpring.License.

◆ AddDeviceVariable() [2/2]

void LicenseSpring.ILicense.AddDeviceVariable ( string  name,
string  value 
)

Add new or update existing device variable to license data

Variable will be stored in local license, in order to send device variables to the backend see License.SendDeviceVariables

Parameters
nameDevice variable name
valueDevice variable value

Implemented in LicenseSpring.License.

◆ AddDeviceVariables()

void LicenseSpring.ILicense.AddDeviceVariables ( DeviceVariable[]  variables)

Add new or update existing device variables to license data

Variables will be stored in local license, in order to send device variables to the backend see License.SendDeviceVariables

Parameters
variablesDevice variables

Implemented in LicenseSpring.License.

◆ Borrow() [1/3]

void LicenseSpring.ILicense.Borrow ( DateTime  endDateTime)

Borrow floating license till provided end date time

Meaningful only for floating licenses.

Parameters
endDateTimeBorrowing end date time in local time.
Exceptions
System.ArgumentExceptionIn case end date time is invalid or in the past.
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.BorrowLicenseExceptionIf borrowing is not allowed or provided borrowing period is bigger than max.
LicenseSpring.SignatureMismatchExceptionIn case signature returned by LicenseSpring backend is not valid or missing

Implemented in LicenseSpring.License.

◆ Borrow() [2/3]

void LicenseSpring.ILicense.Borrow ( string  borrowEndDateTime = null)

Borrow floating license till provided end date time string

Meaningful only for floating licenses.

Parameters
borrowEndDateTimeBorrow end date time in UTC in format "%Y-%m-%dT%H:%M:%SZ". If it's null or empty the license will be borrowed for max possible period.
Exceptions
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.BorrowLicenseExceptionIf borrowing is not allowed or provided borrowing period is bigger than max.
LicenseSpring.SignatureMismatchExceptionIn case signature returned by LicenseSpring backend is not valid or missing

Implemented in LicenseSpring.License.

◆ Borrow() [3/3]

void LicenseSpring.ILicense.Borrow ( uint  hours,
uint  days 
)

Borrow floating license for provided time interval

Meaningful only for floating licenses.

During borrow period there is no need to register floating license to keep it alive.

Parameters
hoursCount of hours from now you want borrow license for.
daysCount of days from now you want borrow license for.
Exceptions
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.BorrowLicenseExceptionIf borrowing is not allowed or provided borrowing period is bigger than max.
LicenseSpring.SignatureMismatchExceptionIn case signature returned by LicenseSpring backend is not valid or missing

Implemented in LicenseSpring.License.

◆ CanBorrow()

bool LicenseSpring.ILicense.CanBorrow ( )

Is this license can be borrowed or not

Equivalent to check MaxBorroTime() > 0. Meaningful only for floating licenses.

Returns
Boolean value indicating whether license can be borrowed

Implemented in LicenseSpring.License.

◆ ChangePassword()

bool LicenseSpring.ILicense.ChangePassword ( string  password,
string  newPassword 
)

Change password for user-based license

Does the same as LicenseManager.ChangePassword

Parameters
passwordUser password
newPasswordNew password
Returns
True if successfully changed and false otherwise.
Exceptions
InvalidOperationExceptionIn case method was called for key-based license
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong password
LicenseSpring.PasswordChangeNotAllowedExceptionIf changing password is forbidden
LicenseSpring.MissingParametersExceptionIf password or newPassword is empty
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ Check()

InstallationFile LicenseSpring.ILicense.Check ( IInstallationFileOptions  options = null)

Check current license for validity on the LicenseSpring platform

Parameters
optionsOptional, using options you can filter install files by channel and environment.
Returns
The most recent InstallationFile available for the license (useful for managing software updates). Returns null in case request failed and grace period started.
Exceptions
LicenseSpring.LicenseInactiveExceptionThrown when license is inactive
LicenseSpring.LicenseDisabledExceptionThrown when license is disabled
LicenseSpring.LicenseExpiredExceptionThrown when license is expired
LicenseSpring.MaxFloatingReachedExceptionIn case all floating slots are busy.
LicenseSpring.SignatureMismatchExceptionIn case signature returned by LicenseSpring backend is not valid or missing
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ ConsumptionPeriod()

ConsumptionPeriod LicenseSpring.ILicense.ConsumptionPeriod ( )

Period of time after which consumption is reset.

Meaningful only for Consumption license.

Implemented in LicenseSpring.License.

◆ CustomFields()

CustomField[] LicenseSpring.ILicense.CustomFields ( )

Custom data fields available for the license

Returns
Array of CustomField objects available for the license

Implemented in LicenseSpring.License.

◆ DaysPassedSinceLastCheck()

int LicenseSpring.ILicense.DaysPassedSinceLastCheck ( )

How many days passed since last online check

Returns
Days count since license was checked online

Implemented in LicenseSpring.License.

◆ DaysRemaining()

int LicenseSpring.ILicense.DaysRemaining ( )

How many days remaining till license expires in current time zone

Days counter will be changed in local midnight.

If you are going to show days remaining dialog to end user you should use this method instead of UTC counterpart. For Subscription license it also counts grace period if set.

Returns
Days count till license expires in current time zone

Implemented in LicenseSpring.License.

◆ DaysRemainingUTC()

int LicenseSpring.ILicense.DaysRemainingUTC ( )

How many days remaining till license expires

Days counter will be changed in midnight by UTC. 0 means license expires today. For Subscription license it also counts grace period if set.

Returns
Days count till license expires by UTC

Implemented in LicenseSpring.License.

◆ Deactivate()

bool LicenseSpring.ILicense.Deactivate ( bool  removeLocalData = false)

Deactivate current license

Parameters
removeLocalDataWhether should remove local license and folders created by the SDK, by default false.Equivalent to call LicenseManager.ClearLocalStorage after deactivation.

If you are going to uninstall your application you probably should call LicenseManager.ClearLocalStorage afterwards or just set removeLocalData param to true.

Returns
True if successfully deactivated and false otherwise. Also returns true if license already inactive.
Exceptions
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ DeactivateAirGap()

void LicenseSpring.ILicense.DeactivateAirGap ( string  confirmationCode)

Verify Confirmation code and deactivate air gap license

Available only in .NET Framework 4.7 or greater, .NET Standard, .NET 5.0 and later versions.

Parameters
confirmationCodeCode received from the air gap activation portal
Exceptions
LicenseSpring.LicenseSpringExceptionIf feature not supported for current target Framework
LicenseSpring.AirGapActivationExceptionIn case confirmation code from the air gap activation portal is invalid.

Implemented in LicenseSpring.License.

◆ DeactivateOffline()

string LicenseSpring.ILicense.DeactivateOffline ( string  deactivationRequestFile = null)

Deactivate license locally and create offline deactivation file request

If you are going to uninstall your application you probably should call LicenseManager.ClearLocalStorage afterwards.

Parameters
deactivationRequestFileDeactivation request file path, null means use default path (Desktop)
Returns
Path to offline deactivation file request

Implemented in LicenseSpring.License.

◆ DeviceVariable()

DeviceVariable LicenseSpring.ILicense.DeviceVariable ( string  name)

Get device variable by name

Returns empty device variable if the variable does not exist

Returns
Device variable

Implemented in LicenseSpring.License.

◆ DeviceVariableValue()

string LicenseSpring.ILicense.DeviceVariableValue ( string  name)

Get device variable value by name

Parameters
nameDevice variable name
Returns
Device variable value or empty string if variable does not exist

Implemented in LicenseSpring.License.

◆ Feature()

LicenseFeature LicenseSpring.ILicense.Feature ( string  featureCode)

Get product (license) feature by feature code

Returns
LicenseFeature objects or throws exception if there is no such feature
Parameters
featureCodeFeature identifier (code)

Implemented in LicenseSpring.License.

◆ Features()

LicenseFeature[] LicenseSpring.ILicense.Features ( )

Product features available for the license

Returns
Array of LicenseFeature objects available for the license

Implemented in LicenseSpring.License.

◆ FloatingClientId()

string LicenseSpring.ILicense.FloatingClientId ( )

Floating user (client) or instance id

Meaningful only for offline floating license.

Returns
Floating client identifier that was set during registration, see FloatingClient.Register

Implemented in LicenseSpring.License.

◆ FloatingEndDateTime()

DateTime LicenseSpring.ILicense.FloatingEndDateTime ( )

Floating license validity end date time in local time zone

Meaningful only for floating licenses, if license is borrowed this method returns borrowedUntil date time.

Returns
End DateTime of the floating license

Implemented in LicenseSpring.License.

◆ FloatingEndDateTimeUtc()

DateTime LicenseSpring.ILicense.FloatingEndDateTimeUtc ( )

Floating license validity end date time in UTC

Meaningful only for floating licenses, if license is borrowed this method returns borrowedUntil date time in UTC.

Returns
End DateTime of the floating license

Implemented in LicenseSpring.License.

◆ FloatingSlotsCount()

uint LicenseSpring.ILicense.FloatingSlotsCount ( )

Overall Floating slots or users count. Amount of simultaneous users (instances) allowed for this license.

Meaningful only for Floating license.

Returns
Overall floating slots count or 0 if license is not Floating

Implemented in LicenseSpring.License.

◆ FloatingSlotsInUse()

uint LicenseSpring.ILicense.FloatingSlotsInUse ( )

Current floatings slots in use count, including this user (instance).

Meaningful only for Floating license, please query this value only after online license check or registration (for Offline floating).

Returns
Floating slots in use count or 0 if license is not Floating

Implemented in LicenseSpring.License.

◆ FloatingTimeout()

uint LicenseSpring.ILicense.FloatingTimeout ( )

Floating timeout in minutes

Meaningful only for Floating license.

Returns
Floating timeout value or 0 if license is not Floating

Implemented in LicenseSpring.License.

◆ GetAirGapDeactivationCode()

string LicenseSpring.ILicense.GetAirGapDeactivationCode ( string  initializationCode)

Get air gap Deactivation code.

Available only in .NET Framework 4.7 or greater, .NET Standard, .NET 5.0 and later versions.

Parameters
initializationCodeCode received from the air gap activation portal.
Returns
Air gap Deactivation code.
Exceptions
LicenseSpring.LicenseSpringExceptionIf feature not supported for current target Framework

Implemented in LicenseSpring.License.

◆ GetDeviceVariables()

DeviceVariable[] LicenseSpring.ILicense.GetDeviceVariables ( bool  getFromBackend = false)

Get device variables from the local license or from the backend

This method does not throw exceptions if you getting variables list from local license.

Parameters
getFromBackendIndicates if you want to request device variables list from local license or backend
Returns
Variable list for current device
Exceptions
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ GetProductDetails()

ProductDetails LicenseSpring.ILicense.GetProductDetails ( )

Get information about a product this license belongs to

ProductDetails is always available for offline activated license.

This method does not perform any network requests and does not throw exceptions.

Returns
Cached ProductDetails or null if ProductDetails not present in current license

Implemented in LicenseSpring.License.

◆ GracePeriodEndDateTime()

DateTime LicenseSpring.ILicense.GracePeriodEndDateTime ( )

Getter for grace period end date time in local time

Returns
The DateTime when grace period expires in local time

Implemented in LicenseSpring.License.

◆ GracePeriodEndDateTimeUTC()

DateTime LicenseSpring.ILicense.GracePeriodEndDateTimeUTC ( )

Getter for grace period end date time in UTC

Returns
The DateTime when grace period expires in UTC

Implemented in LicenseSpring.License.

◆ GracePeriodHoursRemaining()

double LicenseSpring.ILicense.GracePeriodHoursRemaining ( )

How many hours remaining till grace period ends

Returns
Double value representing hours remaining till grace period ends

Implemented in LicenseSpring.License.

◆ Id()

LicenseID LicenseSpring.ILicense.Id ( )

License ID

Returns
License ID, license key or email and password

Implemented in LicenseSpring.License.

◆ IsAirGapped()

bool LicenseSpring.ILicense.IsAirGapped ( )

Is this license was activated using air-gap activation

Returns
Boolean value indicating whether license was activated air-gap

Implemented in LicenseSpring.License.

◆ IsBorrowed()

bool LicenseSpring.ILicense.IsBorrowed ( )

Checker for whether the license is borrowed

Meaningful only for Floating license, see License.Borrow

Returns
True if borrowed, false if not

Implemented in LicenseSpring.License.

◆ IsConsumptionOverageAllowed()

bool LicenseSpring.ILicense.IsConsumptionOverageAllowed ( )

Is it allowed to exceed consumption for this license.

Meaningful only for Consumption based license.

Returns
Boolean value indicating whether it's allowed to go over MaxConsumption

Implemented in LicenseSpring.License.

◆ IsConsumptionResetEnabled()

bool LicenseSpring.ILicense.IsConsumptionResetEnabled ( )

Indicates whether consumption resets after a certain period of time.

Meaningful only for Consumption license.

Implemented in LicenseSpring.License.

◆ IsDeviceTransferAllowed()

bool LicenseSpring.ILicense.IsDeviceTransferAllowed ( )

Checks if license can be transfered between devices

Returns
True if license is transferable between devices, otherwise returns false.

Implemented in LicenseSpring.License.

◆ IsDeviceTransferLimited()

bool LicenseSpring.ILicense.IsDeviceTransferLimited ( )

Checks if the license allows only limited number of transfers between devices

Returns
True if license device transfers are limited, otherwise returns false.

Implemented in LicenseSpring.License.

◆ IsExpired()

bool LicenseSpring.ILicense.IsExpired ( )

Is license expired

Returns
Boolean value indicating whether license have been expired

Implemented in LicenseSpring.License.

◆ IsFloating()

bool LicenseSpring.ILicense.IsFloating ( )

Is this license floating

Returns
Boolean value indicating whether license is floating

Implemented in LicenseSpring.License.

◆ IsGracePeriodStarted()

bool LicenseSpring.ILicense.IsGracePeriodStarted ( )

Check if grace period started for a license

Returns
Returns true if grace period started and false otherwise.

Implemented in LicenseSpring.License.

◆ IsMaintenancePeriodExpired()

bool LicenseSpring.ILicense.IsMaintenancePeriodExpired ( )

Is maintenance period expired

Returns
Boolean value indicating whether maintenance period have been expired for current license

Implemented in LicenseSpring.License.

◆ IsOfflineActivated()

bool LicenseSpring.ILicense.IsOfflineActivated ( )

Is this license was activated offline

Returns
Boolean value indicating whether license was activated offline

Implemented in LicenseSpring.License.

◆ IsSubscriptionGracePeriodStarted()

bool LicenseSpring.ILicense.IsSubscriptionGracePeriodStarted ( )

Check if grace period started for subscription license

Meaningful only for Subscription licenses

Returns
Returns true if grace period started and false otherwise.

Implemented in LicenseSpring.License.

◆ IsTrial()

bool LicenseSpring.ILicense.IsTrial ( )

Is this license trial

Returns
Boolean value indicating whether license is trial

Implemented in LicenseSpring.License.

◆ IsUnlimitedConsumptionAllowed()

bool LicenseSpring.ILicense.IsUnlimitedConsumptionAllowed ( )

Is unlimited consumption allowed for the license

Meaningful only for Consumption based license.

Returns
Boolean value indicating whether unlimited consumption is allowed

Implemented in LicenseSpring.License.

◆ IsValid()

bool LicenseSpring.ILicense.IsValid ( )

Fast and simple way to check current local state of the license.

Equivalent to Status().IsOk() and !IsExpired()

It's just basic check, you cannot be 100% sure that license is valid without online license check.

So you still need to perform license check (both local and online) from time to time.

Returns
Boolean value indicating whether license is valid

Implemented in LicenseSpring.License.

◆ Key()

string LicenseSpring.ILicense.Key ( )

License key

Returns
License key as string or null if not available (in case of user-based product)

Implemented in LicenseSpring.License.

◆ LastCheckDate()

DateTime LicenseSpring.ILicense.LastCheckDate ( )

The DateTime of the last sync with the LicenseSpring platform

In other words - DateTime of the last online license check.

Returns
The DateTime of the last sync in local time

Implemented in LicenseSpring.License.

◆ LastCheckDateUTC()

DateTime LicenseSpring.ILicense.LastCheckDateUTC ( )

The DateTime of the last sync with the LicenseSpring platform

In other words - DateTime of the last online license check.

Returns
The DateTime of the last sync in UCT

Implemented in LicenseSpring.License.

◆ LicenseUser()

LicenseUser LicenseSpring.ILicense.LicenseUser ( )

License user

Returns
License user or null if not available

Implemented in LicenseSpring.License.

◆ LocalCheck()

void LicenseSpring.ILicense.LocalCheck ( )

Perform check for license validity locally

Local check do not establish any connections to the LicenseSpring platform, so it can be used in offline mode.

Exceptions
LicenseSpring.LicenseInactiveExceptionThrown when license is inactive
LicenseSpring.LicenseDisabledExceptionThrown when license is disabled
LicenseSpring.LicenseExpiredExceptionThrown when license is expired
LicenseSpring.ProductMismatchExceptionThrown when license product code does not correspond to configuration product code
LicenseSpring.DeviceNotLicensedExceptionThrown when computer hardware configuration has been changed or license does not belong to this computer
LicenseSpring.DateTimeCheatingExceptionThrown when detected that system time was set back

Implemented in LicenseSpring.License.

◆ MaintenanceDaysRemaining()

int LicenseSpring.ILicense.MaintenanceDaysRemaining ( )

How many days remaining till maintenance period expires in current time zone

Days counter will be changed in local midnight.

Returns int.MaxValue in case maintenance period unlimited or not specified.

Returns
Days count till maintenance expires in current time zone

Implemented in LicenseSpring.License.

◆ MaintenancePeriod()

DateTime LicenseSpring.ILicense.MaintenancePeriod ( )

Maintenance period for the license

Returns
The DateTime when maintenance expires in local time

Implemented in LicenseSpring.License.

◆ MaintenancePeriodUTC()

DateTime LicenseSpring.ILicense.MaintenancePeriodUTC ( )

Maintenance period for the license

Returns
The DateTime when maintenance expires in UTC

Implemented in LicenseSpring.License.

◆ MaxActivations()

uint LicenseSpring.ILicense.MaxActivations ( )

How many times license can be activated

Returns
Maximum number of activations for the license

Implemented in LicenseSpring.License.

◆ MaxBorrowTime()

uint LicenseSpring.ILicense.MaxBorrowTime ( )

Maximum borrowing period in hours

Meaningful only for floating license.

Returns
Max borrow time or 0 if license borrowing is not allowed

Implemented in LicenseSpring.License.

◆ MaxConsumption()

int LicenseSpring.ILicense.MaxConsumption ( )

Maximum consumption of the license

Meaningful only for Consumption based license.

Returns
Maximum consumption value or 0 if license type is not Consumption

Implemented in LicenseSpring.License.

◆ MaxConsumptionOverage()

int LicenseSpring.ILicense.MaxConsumptionOverage ( )

Extra amount of consumption that allows to go over MaxConsumption.

Meaningful only for Consumption based license.

Returns
Maximum extra consumption value or 0 if license type is not Consumption

Implemented in LicenseSpring.License.

◆ Metadata()

string LicenseSpring.ILicense.Metadata ( )

License metadata

Returns
Json with license metadata

Implemented in LicenseSpring.License.

◆ Owner()

Customer LicenseSpring.ILicense.Owner ( )

Gets the information about license owner, commonly it's a person or organization associated with the license

Please note some fields of the Customer object can be empty or null(unavailable)

Returns
Customer object who license belongs to or null if such information unavailable

Implemented in LicenseSpring.License.

◆ PolicyId()

uint LicenseSpring.ILicense.PolicyId ( )

License Policy id

Currently meaningful only for air-gap activated license.

Returns
License Policy id or 0

Implemented in LicenseSpring.License.

◆ Register()

void LicenseSpring.ILicense.Register ( )

Register floating license and occupy floating slot.

This is equivalent to check license online. See aslo SetupLicenseWatchdog. In order to keep floating license alive you should check in (register) it periodically.

Exceptions
LicenseSpring.LicenseInactiveExceptionThrown when license is inactive
LicenseSpring.LicenseDisabledExceptionThrown when license is disabled
LicenseSpring.LicenseExpiredExceptionThrown when license is expired
LicenseSpring.MaxFloatingReachedExceptionIn case all floating slots are busy.
LicenseSpring.SignatureMismatchExceptionIn case signature returned by LicenseSpring backend is not valid
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ Release()

void LicenseSpring.ILicense.Release ( bool  throwExceptions = false)

Stop license watchdog thread and revoke floating license so other user can use it.

It's important to call this function if you use floating license or watchdog.

Typically should be called at the end of app execution.

Parameters
throwExceptionsBoolean value indicating whether this method should throw exceptions, by default it's false.

Implemented in LicenseSpring.License.

◆ ResumeLicenseWatchdog()

void LicenseSpring.ILicense.ResumeLicenseWatchdog ( )

Restart background thread, you can call this within you callback in order to resume periodic license checks.

Using this function is a little faster than running new watchdog. Does nothing if watchdog was not set up.

Implemented in LicenseSpring.License.

◆ SendDeviceVariables()

bool LicenseSpring.ILicense.SendDeviceVariables ( )

Send current device variables list to the backend (see device variables on the platform)

Please note this data will be linked to the current running device ID.

This method does nothing if local license does not have any variables.

Returns
Bool value indicating if device variables were sent. Returns false if there are no device variables or in case request failed and grace period started.
Exceptions
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ SetupLicenseWatchdog() [1/2]

void LicenseSpring.ILicense.SetupLicenseWatchdog ( LicenseWatchdogCallback  callback,
uint  timeout = 0 
)

Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive.

This is especially useful for floating licenses, but can be used for any.

Parameters
callbackThis function will be called back in case of errors.
timeoutTimeout in minutes, 0 means use default

Implemented in LicenseSpring.License.

◆ SetupLicenseWatchdog() [2/2]

void LicenseSpring.ILicense.SetupLicenseWatchdog ( LicenseWatchdogSettings  settings)

Setup and run license watchdog, a background thread which periodically checks the license, by so keeping it alive.

This is especially useful for floating licenses, but can be used for any.

Parameters
settingsWatchdog settings.

Implemented in LicenseSpring.License.

◆ SetWatchdogTimeout()

void LicenseSpring.ILicense.SetWatchdogTimeout ( uint  timeout = 0)

Set new timout for license watchdog.

This method does not restart the watchdog, it sets a new timeout for the running watchdog or before calling ResumeLicenseWatchdog.

Parameters
timeoutTimeout in minutes, 0 means use default

Implemented in LicenseSpring.License.

◆ StartDate()

DateTime LicenseSpring.ILicense.StartDate ( )

License start date

Returns
The DateTime when license can be activated

Implemented in LicenseSpring.License.

◆ Status()

LicenseStatus LicenseSpring.ILicense.Status ( )

Method for getting local license status, see LicenseStatus documentation

Returns
LicenseStatus object for this license

Implemented in LicenseSpring.License.

◆ StopLicenseWatchdog()

void LicenseSpring.ILicense.StopLicenseWatchdog ( )

Stops license watchdog background thread.

This method does not revoke floating license, just stops the watchdog.

Implemented in LicenseSpring.License.

◆ SubscriptionGracePeriod()

uint LicenseSpring.ILicense.SubscriptionGracePeriod ( )

Grace period in hours

Meaningful only for Subscription license.

Returns
Grace period value or 0 if grace period is not allowed

Implemented in LicenseSpring.License.

◆ SyncConsumption()

bool LicenseSpring.ILicense.SyncConsumption ( OverageRequest  overageRequest = null)

Sync Consumption license with the LicenseSpring platform

Meaningful only for Consumption based license.

Also consumption license gets updated within online check, so you can call Check instead.

Parameters
overageRequestOptional parameter to request consumption overage, see OverageRequest
Returns
Bool value indicating if consumption was synchronized. Returns false in case request failed and grace period started.
Exceptions
System.InvalidOperationExceptionThrown when called for not Consumption license type
LicenseSpring.NotEnoughConsumptionExceptionThrown when license is out of resources
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.SignatureMismatchExceptionIn case signature returned by LicenseSpring backend is not valid or missing
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ SyncFeatureConsumption()

bool LicenseSpring.ILicense.SyncFeatureConsumption ( string  featureCode = null)

Sync Consumption feature with the LicenseSpring platform

Meaningful only for Consumption features.

Also consumption features gets updated within online check, so you can call Check instead.

Returns
Bool value indicating if consumption was synchronized. Returns false in case request failed and grace period started.
Exceptions
LicenseSpring.NotEnoughConsumptionExceptionThrown when license feature is out of resources
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no Internet connection or operation timed out.
LicenseSpring.SignatureMismatchExceptionIn case signature returned by LicenseSpring backend is not valid or missing
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implemented in LicenseSpring.License.

◆ TimesActivated()

uint LicenseSpring.ILicense.TimesActivated ( )

How many times license already been activated

Returns
Current number of activations for the license

Implemented in LicenseSpring.License.

◆ TotalConsumption()

int LicenseSpring.ILicense.TotalConsumption ( )

Current total consumption of the license

Meaningful only for Consumption based license.

Returns
Current total consumption or 0 if license type is not Consumption

Implemented in LicenseSpring.License.

◆ TransferCount()

uint LicenseSpring.ILicense.TransferCount ( )

How many times license has been transferred between devices

Returns
Transfer count of the license

Implemented in LicenseSpring.License.

◆ TransferLimit()

uint LicenseSpring.ILicense.TransferLimit ( )

Maximum number of allowed license transfers between devices

Returns
Maximum device transfer limit of the license, uint.MaxValue for unlimited device transfers, 0 if device transfers are not allowed.

Implemented in LicenseSpring.License.

◆ Type()

LicenseType LicenseSpring.ILicense.Type ( )

Type of license

Returns
LicenseType

Implemented in LicenseSpring.License.

◆ UpdateConsumption()

void LicenseSpring.ILicense.UpdateConsumption ( int  value = 1)

Increase local consumption counter for consumption license

Meaningful only for Consumption based license.

Parameters
valueThe value by which the counter is being increased, default is 1.
Exceptions
System.InvalidOperationExceptionThrown when called for not Consumption license type
LicenseSpring.NotEnoughConsumptionExceptionThrown when license is out of resources

Implemented in LicenseSpring.License.

◆ UpdateFeatureConsumption()

void LicenseSpring.ILicense.UpdateFeatureConsumption ( string  featureCode,
int  value = 1 
)

Increase local consumption counter for consumption product feature.

Meaningful only for Consumption product features.

Parameters
featureCodeFeature identifier (code).
valueThe value by which the counter is being increased, default is 1.
Exceptions
LicenseSpring.InvalidLicenseFeatureExceptionThrown when license feature not found or it's not of cosumption type
LicenseSpring.NotEnoughConsumptionExceptionThrown when license feature is out of resources

Implemented in LicenseSpring.License.

◆ UpdateOffline()

bool LicenseSpring.ILicense.UpdateOffline ( string  path)

Update license data accordingly to provided file.

Parameters
pathUpdate file path
Returns
True if license successfully updated and false otherwise
Exceptions
System.IO.FileNotFoundExceptionIf file cannot be found
System.IO.InvalidDataExceptionIf file content is empty or invalid
LicenseSpring.SignatureMismatchExceptionIn case signature in the file is not valid or missing

Implemented in LicenseSpring.License.

◆ User()

string LicenseSpring.ILicense.User ( )

Email of the License user

Returns
Email or null if not available (in case of key-based product)

Implemented in LicenseSpring.License.

◆ ValidityPeriod()

DateTime LicenseSpring.ILicense.ValidityPeriod ( )

The DateTime until the license is valid

Returns
The DateTime when license expires in local time

Implemented in LicenseSpring.License.

◆ ValidityPeriodUTC()

DateTime LicenseSpring.ILicense.ValidityPeriodUTC ( )

The DateTime until the license is valid

Returns
The DateTime when license expires in UTC

Implemented in LicenseSpring.License.

◆ ValidityWithGracePeriod()

DateTime LicenseSpring.ILicense.ValidityWithGracePeriod ( )

The DateTime until the license is valid including grace period

Currently grace period meaningful only for Subscription licenses

Returns
The DateTime when license expires in local time

Implemented in LicenseSpring.License.

◆ ValidityWithGracePeriodUTC()

DateTime LicenseSpring.ILicense.ValidityWithGracePeriodUTC ( )

The DateTime until the license is valid including grace period

Currently grace period meaningful only for Subscription licenses

Returns
The DateTime when license expires in UTC

Implemented in LicenseSpring.License.


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