LicenseSpring .Net SDK 7.40.0
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
LicenseSpring.FloatingClient Class Reference

Class for interaction with offline Floating server. More...

Inheritance diagram for LicenseSpring.FloatingClient:
LicenseSpring.BaseManager LicenseSpring.IFloatingClient

Public Member Functions

void AuthenticateUser (string username, string password)
 Authenticates the current Floating Server V2 user and caches the JWT token. WARNING: Works only on Floating server V2, and throws exceptions otherwise.
Parameters
usernameUsername of the user who needs to authenticate to Floating Server V2
passwordPassword of the user who needs to authenticate to Floating Server V2
Exceptions
LicenseSpring.NetworkExceptionIn case of network errors or server not available.
LicenseSpring.LicenseServerExceptionIn case of internal server error.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong, please contact.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential

 
 FloatingClient ()
 Constructor of FloatingClient.
 
List< LicenseIDGetAllLicenses ()
 Fetches all available licenses from the Floating server.Warning: Works only on FLoating server v2, throws exception otherwise.
Returns
A list of LicenseID objects of all licenses activated on the Floating server, with the current product code.
Exceptions
LicenseSpring.NetworkExceptionIn case of network errors or server not available.
LicenseSpring.LicenseServerExceptionIn case of internal Floating server error.
LicenseSpring.LicenseSpringExceptionIf trying to fetch licenses on Floating server v1.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

 
ILicense GetLicenseInfo (LicenseID licenseId=null)
 Get license information for configured product.See https://docs.licensespring.com/docs/apiv4floatinglicense
 
IFloatingServerInfo GetServerInfo ()
 Get Floating Server information (settings)The function is obsolete
 
override void Initialize (Configuration configuration, ILicenseStorage storage=null)
 Initialize license manager with the given configuration.
 
bool IsOnline (bool throwExceptions=false)
 Helper method, it checks connection to the Floating server.
Parameters
throwExceptionsBoolean value indicating whether this method should throw exceptions, by default it's false.
Returns
True if SDK is able to connect to the Floating server and false otherwise.
Exceptions
System.InvalidOperationExceptionThrown when FloatingClient is not initialized
LicenseSpring.NetworkExceptionIn case of network errors or server not available.

 
ILicense Register (string id, LicenseID licenseId=null)
 Register client with given id.
Parameters
idUser or instance id for license registration, it can be anything - email, host or domain name, handle, etc.
licenseIDLicense identifier, optional, if not specified this method tries to register to default license for the product.
Returns
License object if registration succeeded, throws exceptions in case of errors
Exceptions
System.InvalidOperationExceptionThrown when FloatingClient is not initialized
LicenseSpring.MaxFloatingReachedExceptionIn case there are no floating slots available
LicenseSpring.ProductNotFoundExceptionIn case product was not found on floating server
LicenseSpring.LicenseNotFoundExceptionIn case license was not found for configured product
LicenseSpring.LicenseActivationExceptionIn server returned empty response
LicenseSpring.LicenseServerExceptionIn case of internal Floating server error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no network connection or operation timed out.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.UnknownLicenseSpringExceptionIf something went wrong or you use newer version of FloatingServer

 
bool Unregister (string id, LicenseID licenseId=null)
 Unregister client with given id.
Parameters
idUser or instance id for license registration, it can be anything - email, host or domain name, handle, etc.
licenseIDLicense id, optional, if not specified this method unegister from default configured license for the product.
Returns
True if unregistered successfully
Exceptions
System.InvalidOperationExceptionThrown when FloatingClient is not initialized
LicenseSpring.LicenseServerExceptionIn case of internal Floating server error
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no network connection or operation timed out.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

 
- Public Member Functions inherited from LicenseSpring.BaseManager
void ClearLocalStorage ()
 Removes the license file, license log and folders created by the SDK.
 
ILicense CurrentLicense ()
 Load license from local storage (if not yet loaded).
 
bool IsInitialized ()
 Check whether license manager has been initialized.
 
string LicenseFilePath ()
 Returns full path to the license file, meaningful only if LicenseFileStorage (or derived) is used.
 
ILicense ReloadLicense ()
 Resets current license and loads it again from the local storage.
 
- Public Member Functions inherited from LicenseSpring.IFloatingClient
void ClearLocalStorage ()
 See BaseManager.ClearLocalStorage.
 
ILicense CurrentLicense ()
 See BaseManager.CurrentLicense.
 
bool IsInitialized ()
 See BaseManager.IsInitialized.
 
string LicenseFilePath ()
 See BaseManager.LicenseFilePath.
 
ILicense ReloadLicense ()
 See BaseManager.ReloadLicense.
 

Static Public Member Functions

static IFloatingClient GetInstance ()
 Get singleton FloatingClient instance.
 

Additional Inherited Members

- Properties inherited from LicenseSpring.BaseManager
string DataLocation [get, set]
 Folder path where LicenseSpring data is being stored.
 
string LicenseFileName [get, set]
 License filename with extension (optional), meaningful only if LicenseFileStorage is used.
 
- Properties inherited from LicenseSpring.IFloatingClient
string DataLocation [get, set]
 See BaseManager.DataLocation.
 
string LicenseFileName [get, set]
 See BaseManager.LicenseFileName.
 

Detailed Description

Class for interaction with offline Floating server.

See https://docs.licensespring.com/docs/floating-server

Constructor & Destructor Documentation

◆ FloatingClient()

LicenseSpring.FloatingClient.FloatingClient ( )

Constructor of FloatingClient.

You can rather use singleton instance by GetInstance or create object directly by this constructor.

Member Function Documentation

◆ AuthenticateUser()

void LicenseSpring.FloatingClient.AuthenticateUser ( string  username,
string  password 
)

Authenticates the current Floating Server V2 user and caches the JWT token. WARNING: Works only on Floating server V2, and throws exceptions otherwise.

Parameters
usernameUsername of the user who needs to authenticate to Floating Server V2
passwordPassword of the user who needs to authenticate to Floating Server V2
Exceptions
LicenseSpring.NetworkExceptionIn case of network errors or server not available.
LicenseSpring.LicenseServerExceptionIn case of internal server error.
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong, please contact.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential

Implements LicenseSpring.IFloatingClient.

◆ GetAllLicenses()

List< LicenseID > LicenseSpring.FloatingClient.GetAllLicenses ( )

Fetches all available licenses from the Floating server.Warning: Works only on FLoating server v2, throws exception otherwise.

Returns
A list of LicenseID objects of all licenses activated on the Floating server, with the current product code.
Exceptions
LicenseSpring.NetworkExceptionIn case of network errors or server not available.
LicenseSpring.LicenseServerExceptionIn case of internal Floating server error.
LicenseSpring.LicenseSpringExceptionIf trying to fetch licenses on Floating server v1.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implements LicenseSpring.IFloatingClient.

◆ GetInstance()

static IFloatingClient LicenseSpring.FloatingClient.GetInstance ( )
static

Get singleton FloatingClient instance.

Returns
FloatingClient instance

◆ GetLicenseInfo()

ILicense LicenseSpring.FloatingClient.GetLicenseInfo ( LicenseID  licenseId = null)

Get license information for configured product.See https://docs.licensespring.com/docs/apiv4floatinglicense

Implements LicenseSpring.IFloatingClient.

◆ GetServerInfo()

IFloatingServerInfo LicenseSpring.FloatingClient.GetServerInfo ( )

Get Floating Server information (settings)The function is obsolete

Implements LicenseSpring.IFloatingClient.

◆ Initialize()

override void LicenseSpring.FloatingClient.Initialize ( Configuration  configuration,
ILicenseStorage  storage = null 
)
virtual

Initialize license manager with the given configuration.

Parameters
configurationConfiguration object used to initialize the manager.
storageStorage for local license, uses local license file by default.
Exceptions
System.ArgumentNullExceptionConfiguration is null.

Reimplemented from LicenseSpring.BaseManager.

◆ IsOnline()

bool LicenseSpring.FloatingClient.IsOnline ( bool  throwExceptions = false)

Helper method, it checks connection to the Floating server.

Parameters
throwExceptionsBoolean value indicating whether this method should throw exceptions, by default it's false.
Returns
True if SDK is able to connect to the Floating server and false otherwise.
Exceptions
System.InvalidOperationExceptionThrown when FloatingClient is not initialized
LicenseSpring.NetworkExceptionIn case of network errors or server not available.

Implements LicenseSpring.IFloatingClient.

◆ Register()

ILicense LicenseSpring.FloatingClient.Register ( string  id,
LicenseID  licenseId = null 
)

Register client with given id.

Parameters
idUser or instance id for license registration, it can be anything - email, host or domain name, handle, etc.
licenseIDLicense identifier, optional, if not specified this method tries to register to default license for the product.
Returns
License object if registration succeeded, throws exceptions in case of errors
Exceptions
System.InvalidOperationExceptionThrown when FloatingClient is not initialized
LicenseSpring.MaxFloatingReachedExceptionIn case there are no floating slots available
LicenseSpring.ProductNotFoundExceptionIn case product was not found on floating server
LicenseSpring.LicenseNotFoundExceptionIn case license was not found for configured product
LicenseSpring.LicenseActivationExceptionIn server returned empty response
LicenseSpring.LicenseServerExceptionIn case of internal Floating server error
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no network connection or operation timed out.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.UnknownLicenseSpringExceptionIf something went wrong or you use newer version of FloatingServer

Implements LicenseSpring.IFloatingClient.

◆ Unregister()

bool LicenseSpring.FloatingClient.Unregister ( string  id,
LicenseID  licenseId = null 
)

Unregister client with given id.

Parameters
idUser or instance id for license registration, it can be anything - email, host or domain name, handle, etc.
licenseIDLicense id, optional, if not specified this method unegister from default configured license for the product.
Returns
True if unregistered successfully
Exceptions
System.InvalidOperationExceptionThrown when FloatingClient is not initialized
LicenseSpring.LicenseServerExceptionIn case of internal Floating server error
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.NetworkExceptionIn case of network errors, e.g. no network connection or operation timed out.
System.Security.Authentication.InvalidCredentialExceptionIn case of wrong credential
LicenseSpring.UnknownLicenseSpringExceptionIn rare case if something went wrong.

Implements LicenseSpring.IFloatingClient.


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