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

Class for managing bundle licenses. A bundle allows activating multiple product licenses together as a single unit. Implements IBundleManager interface. More...

Inheritance diagram for LicenseSpring.BundleManager:
LicenseSpring.BaseManager LicenseSpring.IBundleManager

Public Member Functions

Dictionary< string, ILicenseActivateBundle (LicenseID licenseID)
 Activate bundle with given LicenseID.
Parameters
licenseIDBundle license ID: license key or email and password.
Returns
Dictionary of activated licenses mapped by product code.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.ProductNotFoundExceptionIn case product does not exist on the platform.
LicenseSpring.LicenseNotFoundExceptionIn case provided bundle license was not found.
LicenseSpring.LicenseActivationExceptionIn case something went wrong with bundle activation.
LicenseSpring.LicenseDisabledExceptionThrown when bundle license is disabled.
LicenseSpring.LicenseExpiredExceptionThrown when bundle license is expired.
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.

 
Dictionary< string, ILicenseActivateBundle (LicenseID licenseID, DeviceVariable[] deviceVariables)
 Activate bundle with given LicenseID and device variables.
Parameters
licenseIDBundle license ID: license key or email and password.
deviceVariablesAn array of device variables to be sent to the LicenseSpring platform during bundle activation.
Returns
Dictionary of activated licenses mapped by product code.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.LicenseActivationExceptionIn case something went wrong with bundle activation.

 
Dictionary< string, ILicenseActivateBundle (string data, string accountCode=null, bool useToken=false, string redirectUri=null)
 Activate bundle using SSO.You can omit accountCode param if you already set customer account code through the Configuration.
 
Dictionary< string, ILicenseActivateBundleOffline (string activationResponseFile=null)
 Activate bundle using offline activation response file.
Parameters
activationResponseFilePath to the activation response file (.lic file). If null, looks for file on desktop.
Returns
Dictionary of activated licenses mapped by product code.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
System.IO.FileNotFoundExceptionIf activation response file not found.
LicenseSpring.SignatureMismatchExceptionIn case signature in response file is not valid.

 
 BundleManager ()
 Constructor of BundleManager.
 
void CheckBundle (LicenseID licenseID, IInstallationFileOptions filter=null, bool includeExpiredFeatures=false)
 Check bundle license with LicenseSpring backend and update local data.
Parameters
licenseIDBundle license ID: license key or email and password.
filterOptional filter for installation files.
includeExpiredFeaturesIf true, includes expired features in the response.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.LicenseNotFoundExceptionIn case provided bundle license was not found.
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error.
LicenseSpring.NetworkExceptionIn case of network errors.

 
new void ClearLocalStorage ()
 Override ClearLocalStorage to also clear cached licenses.
 
bool DeactivateBundle (LicenseID licenseID, bool removeLocalData=false)
 Deactivate bundle license.
Parameters
licenseIDBundle license ID: license key or email and password.
removeLocalDataIf true, removes local storage. If false, marks licenses as inactive locally.
Returns
True if deactivation successful.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.LicenseNotFoundExceptionIn case provided bundle license was not found.
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error.
LicenseSpring.NetworkExceptionIn case of network errors.

 
string DeactivateBundleOffline (LicenseID licenseID, string deactivationRequestFile=null)
 Create offline deactivation request file for bundle.
Parameters
licenseIDBundle license ID: license key or email and password.
deactivationRequestFilePath where to save the request file. If null, saves to desktop as ls_deactivation.req.
Returns
Full path to the created request file.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.

 
Dictionary< string, ILicenseGetCurrentBundle ()
 Get the current bundle from local storage.Loads bundle licenses lazily from storage on first access.
 
string GetOfflineActivationFile (LicenseID licenseID, DeviceVariable[] deviceVariables, string activationRequestFile=null)
 Creates offline activation file request.
Parameters
licenseIDLicense ID, license key or email and password.
deviceVariablesAn array of device variables to be sent to the LicenseSpring platform during license activation.
activationRequestFileActivation request file path, null means use default path (Desktop).
Returns
Path to offline activation file request.
Exceptions
System.InvalidOperationExceptionThrown when license manager is not initialized.

 
string GetOfflineActivationFile (LicenseID licenseID, string activationRequestFile=null)
 Creates offline activation file request.
Parameters
licenseIDLicense ID, license key or email and password.
activationRequestFileActivation request file path, null means use default path (Desktop).
Returns
Path to offline activation file request.
Exceptions
System.InvalidOperationExceptionThrown when license manager is not initialized.

 
ProductDetails GetProductDetails (bool includeCustomFields, bool includeLatestVersion, string env)
 Retrieve information about a product from LicenseSpring backend.
Parameters
includeCustomFieldsIf true, includes custom fields data.
includeLatestVersionIf true, includes latest version information.
envOptional parameter, filters products by environment string.
Returns
Product details.

 
ProductDetails GetProductDetails (bool includeCustomFields=false, bool includeLatestVersion=false)
 Retrieve information about a product from LicenseSpring backend.In offline mode data will be retrieved from license file if present.
 
- 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).
 
virtual void Initialize (Configuration configuration, ILicenseStorage storage=null)
 Initialize license manager with the given configuration.
 
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.IBundleManager
void Initialize (Configuration configuration, ILicenseStorage storage=null)
 See BaseManager.Initialize.
 
bool IsInitialized ()
 See BaseManager.IsInitialized.
 
string LicenseFilePath ()
 See BaseManager.LicenseFilePath.
 

Static Public Member Functions

static IBundleManager GetInstance ()
 Get singleton BundleManager 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.IBundleManager
string DataLocation [get, set]
 See BaseManager.DataLocation.
 
string LicenseFileName [get, set]
 See BaseManager.LicenseFileName.
 

Detailed Description

Class for managing bundle licenses. A bundle allows activating multiple product licenses together as a single unit. Implements IBundleManager interface.

Constructor & Destructor Documentation

◆ BundleManager()

LicenseSpring.BundleManager.BundleManager ( )

Constructor of BundleManager.

You can use singleton instance by BundleManager.GetInstance or create manager directly with this constructor.

Member Function Documentation

◆ ActivateBundle() [1/3]

Dictionary< string, ILicense > LicenseSpring.BundleManager.ActivateBundle ( LicenseID  licenseID)

Activate bundle with given LicenseID.

Parameters
licenseIDBundle license ID: license key or email and password.
Returns
Dictionary of activated licenses mapped by product code.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.ProductNotFoundExceptionIn case product does not exist on the platform.
LicenseSpring.LicenseNotFoundExceptionIn case provided bundle license was not found.
LicenseSpring.LicenseActivationExceptionIn case something went wrong with bundle activation.
LicenseSpring.LicenseDisabledExceptionThrown when bundle license is disabled.
LicenseSpring.LicenseExpiredExceptionThrown when bundle license is expired.
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.

Implements LicenseSpring.IBundleManager.

◆ ActivateBundle() [2/3]

Dictionary< string, ILicense > LicenseSpring.BundleManager.ActivateBundle ( LicenseID  licenseID,
DeviceVariable[]  deviceVariables 
)

Activate bundle with given LicenseID and device variables.

Parameters
licenseIDBundle license ID: license key or email and password.
deviceVariablesAn array of device variables to be sent to the LicenseSpring platform during bundle activation.
Returns
Dictionary of activated licenses mapped by product code.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.LicenseActivationExceptionIn case something went wrong with bundle activation.

Implements LicenseSpring.IBundleManager.

◆ ActivateBundle() [3/3]

Dictionary< string, ILicense > LicenseSpring.BundleManager.ActivateBundle ( string  data,
string  accountCode = null,
bool  useToken = false,
string  redirectUri = null 
)

Activate bundle using SSO.You can omit accountCode param if you already set customer account code through the Configuration.

Implements LicenseSpring.IBundleManager.

◆ ActivateBundleOffline()

Dictionary< string, ILicense > LicenseSpring.BundleManager.ActivateBundleOffline ( string  activationResponseFile = null)

Activate bundle using offline activation response file.

Parameters
activationResponseFilePath to the activation response file (.lic file). If null, looks for file on desktop.
Returns
Dictionary of activated licenses mapped by product code.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
System.IO.FileNotFoundExceptionIf activation response file not found.
LicenseSpring.SignatureMismatchExceptionIn case signature in response file is not valid.

Implements LicenseSpring.IBundleManager.

◆ CheckBundle()

void LicenseSpring.BundleManager.CheckBundle ( LicenseID  licenseID,
IInstallationFileOptions  filter = null,
bool  includeExpiredFeatures = false 
)

Check bundle license with LicenseSpring backend and update local data.

Parameters
licenseIDBundle license ID: license key or email and password.
filterOptional filter for installation files.
includeExpiredFeaturesIf true, includes expired features in the response.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.LicenseNotFoundExceptionIn case provided bundle license was not found.
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error.
LicenseSpring.NetworkExceptionIn case of network errors.

Implements LicenseSpring.IBundleManager.

◆ ClearLocalStorage()

new void LicenseSpring.BundleManager.ClearLocalStorage ( )

Override ClearLocalStorage to also clear cached licenses.

Implements LicenseSpring.IBundleManager.

◆ DeactivateBundle()

bool LicenseSpring.BundleManager.DeactivateBundle ( LicenseID  licenseID,
bool  removeLocalData = false 
)

Deactivate bundle license.

Parameters
licenseIDBundle license ID: license key or email and password.
removeLocalDataIf true, removes local storage. If false, marks licenses as inactive locally.
Returns
True if deactivation successful.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.
LicenseSpring.LicenseNotFoundExceptionIn case provided bundle license was not found.
LicenseSpring.LicenseServerExceptionIn case of internal LicenseSpring backend error.
LicenseSpring.NetworkExceptionIn case of network errors.

Implements LicenseSpring.IBundleManager.

◆ DeactivateBundleOffline()

string LicenseSpring.BundleManager.DeactivateBundleOffline ( LicenseID  licenseID,
string  deactivationRequestFile = null 
)

Create offline deactivation request file for bundle.

Parameters
licenseIDBundle license ID: license key or email and password.
deactivationRequestFilePath where to save the request file. If null, saves to desktop as ls_deactivation.req.
Returns
Full path to the created request file.
Exceptions
System.InvalidOperationExceptionThrown when bundle manager is not initialized.

Implements LicenseSpring.IBundleManager.

◆ GetCurrentBundle()

Dictionary< string, ILicense > LicenseSpring.BundleManager.GetCurrentBundle ( )

Get the current bundle from local storage.Loads bundle licenses lazily from storage on first access.

Implements LicenseSpring.IBundleManager.

◆ GetInstance()

static IBundleManager LicenseSpring.BundleManager.GetInstance ( )
static

Get singleton BundleManager instance.

Returns
BundleManager instance

◆ GetOfflineActivationFile() [1/2]

string LicenseSpring.BundleManager.GetOfflineActivationFile ( LicenseID  licenseID,
DeviceVariable[]  deviceVariables,
string  activationRequestFile = null 
)

Creates offline activation file request.

Parameters
licenseIDLicense ID, license key or email and password.
deviceVariablesAn array of device variables to be sent to the LicenseSpring platform during license activation.
activationRequestFileActivation request file path, null means use default path (Desktop).
Returns
Path to offline activation file request.
Exceptions
System.InvalidOperationExceptionThrown when license manager is not initialized.

Implements LicenseSpring.IBundleManager.

◆ GetOfflineActivationFile() [2/2]

string LicenseSpring.BundleManager.GetOfflineActivationFile ( LicenseID  licenseID,
string  activationRequestFile = null 
)

Creates offline activation file request.

Parameters
licenseIDLicense ID, license key or email and password.
activationRequestFileActivation request file path, null means use default path (Desktop).
Returns
Path to offline activation file request.
Exceptions
System.InvalidOperationExceptionThrown when license manager is not initialized.

Implements LicenseSpring.IBundleManager.

◆ GetProductDetails() [1/2]

ProductDetails LicenseSpring.BundleManager.GetProductDetails ( bool  includeCustomFields,
bool  includeLatestVersion,
string  env 
)

Retrieve information about a product from LicenseSpring backend.

Parameters
includeCustomFieldsIf true, includes custom fields data.
includeLatestVersionIf true, includes latest version information.
envOptional parameter, filters products by environment string.
Returns
Product details.

Implements LicenseSpring.IBundleManager.

◆ GetProductDetails() [2/2]

ProductDetails LicenseSpring.BundleManager.GetProductDetails ( bool  includeCustomFields = false,
bool  includeLatestVersion = false 
)

Retrieve information about a product from LicenseSpring backend.In offline mode data will be retrieved from license file if present.

Implements LicenseSpring.IBundleManager.


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