Interface IActivateLicenses
Manages the process of activating a license that has been prepared on the Software Potential service into a local license store.
See AgentContext for details of configuring stores. See ActivateLicensesExtensions for extension methods pertaining to advanced options as managed via IActivateLicensesAdvanced.
Namespace: Sp.Agent.Activation
Assembly: Sp.Agent.dll
Methods
GetCurrentLicenseRevisionAync(String)
Queries the activation service for the current revision number for the license with given activation key
Declaration
Task<int> GetCurrentLicenseRevisionAync(string activationKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | activationKey | must be a well formed Activation Key as defined by |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Int32> | Current revision number for the license with given activation key |
Exceptions
| Type | Condition |
|---|---|
| System.AggregateException | Transmission may (internally) be automatically retried as dictated by IProductActivationTransmissionCommenceConfigurationPhase. As a result, an System.AggregateException reflecting the outcomes of multiple activation attempts may be thrown. |
| ActivationServerException | Thrown if the Software Potential service refuses the Request. This is most likely caused by an invalid Activation Key. |
| ActivationTransmissionException | Thrown if it was not possible to communicate with the Software Potential Activation service. |
IsWellFormedKey(String)
Determines whether the specified activation key is well formed (e.g., 5 sets of digits/letters separated by minus (-) symbols).
Declaration
bool IsWellFormedKey(string activationKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | activationKey | The activation key. Can by any string, doesn't have to be of a particular length etc. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
Does not attempt to ascertain whether the Activation Key represents a license that is valid - the validation is purely for adherence to the key format.
OnlineActivate(String)
Submits an activation request to Software Potential service and installs the resulting license (assuming that succeeds) synchronously.
See IActivateLicensesAdvanced .CreateRequest() (for deferring Activation and/or processing it on another machine) or CreateManualActivationRequest() (for Manual Activation via the Software Potential service) for alternate approaches to activation.
Declaration
[Obsolete("This method has been deprecated. Please use the asynchronous version of this method: OnlineActivateAsync", false)]
void OnlineActivate(string activationKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | activationKey | must be a well formed Activation Key as defined by |
Remarks
Performs a synchronous CreateDeferredRequest() followed by a SendDeferredRequestAsync() and a Install().
Note that Transmission may (internally) be automatically retried as dictated by IProductActivationTransmissionCommenceConfigurationPhase. As a result, an System.AggregateException reflecting the outcomes of multiple activation attempts may be thrown internally by OnlineActivateAsync(String) hence it is recommnded to use that API in preference. Only of the first of these is bubbled up.
Exceptions
| Type | Condition |
|---|---|
| System.AggregateException | While thrown internally, it is never surfaced and instead replaced with |
| ActivationServerException | Thrown if the Software Potential service refuses the Activation Request. For some causes, there are specific derived Types reflecting the indicated reason. |
| ActivationTransmissionException | Thrown if it was not possible to communicate with the Software Potential Activation service. |
OnlineActivate(String, Object)
Submits an activation request to Software Potential service and installs the resulting license (assuming that succeeds) synchronously.
See IActivateLicensesAdvanced .CreateRequest() (for deferring Activation and/or processing it on another machine) or CreateManualActivationRequest() (for Manual Activation via the Software Potential service) for alternate approaches to activation.
Declaration
[Obsolete("This method has been deprecated. Please use the asynchronous version of this method: OnlineActivateAsync", false)]
void OnlineActivate(string activationKey, object state)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | activationKey | must be a well formed Activation Key as defined by |
| System.Object | state | propagated to Activation Customizations such as the Action supplied to WithTagging(Action<IActivationTaggingContext>). |
Remarks
Performs a synchronous CreateDeferredRequest() followed by a SendDeferredRequestAsync() and a Install().
Note that Transmission may (internally) be automatically retried as dictated by IProductActivationTransmissionCommenceConfigurationPhase. As a result, an System.AggregateException reflecting the outcomes of multiple activation attempts may be thrown internally by OnlineActivateAsync(String) hence it is recommnded to use that API in preference. Only of the first of these is bubbled up.
Exceptions
| Type | Condition |
|---|---|
| System.AggregateException | While thrown internally, it is never surfaced and instead replaced with |
| ActivationServerException | Thrown if the Software Potential service refuses the Activation Request. For some causes, there are specific derived Types reflecting the indicated reason. |
| ActivationTransmissionException | Thrown if it was not possible to communicate with the Software Potential Activation service. |
OnlineActivateAsync(String)
Submits an activation request to Software Potential service and installs the resulting license (assuming that succeeds) asynchronously.
See IActivateLicensesAdvanced .CreateDeferredRequest() (for deferring Activation and/or processing it on another machine) or CreateManualActivationRequest() (for Manual Activation via the Software Potential service) for alternate approaches to activation.
Declaration
Task OnlineActivateAsync(string activationKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | activationKey | must be a well formed Activation Key as defined by |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
Performs an asynchronous CreateRequest() followed by a SendDeferredRequestAsync() and a Install().
Exceptions
| Type | Condition |
|---|---|
| System.AggregateException | Transmission may (internally) be automatically retried as dictated by IProductActivationTransmissionCommenceConfigurationPhase. As a result, an System.AggregateException reflecting the outcomes of multiple activation attempts may be thrown. |
| ActivationServerException | Thrown if the Software Potential service refuses the Activation Request. For some causes, there are specific derived Types reflecting the indicated reason. |
| ActivationTransmissionException | Thrown if it was not possible to communicate with the Software Potential Activation service. |
OnlineActivateAsync(String, Object)
Submits an activation request to Software Potential service and installs the resulting license (assuming that succeeds) asynchronously.
See IActivateLicensesAdvanced .CreateDeferredRequest() (for deferring Activation and/or processing it on another machine) or CreateManualActivationRequest() (for Manual Activation via the Software Potential service) for alternate approaches to activation.
Declaration
Task OnlineActivateAsync(string activationKey, object state)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | activationKey | must be a well formed Activation Key as defined by |
| System.Object | state | propagated to Activation Customizations such as the Action supplied to WithTagging(Action<IActivationTaggingContext>). |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
Performs an asynchronous CreateRequest() followed by a SendDeferredRequestAsync() and a Install().
Exceptions
| Type | Condition |
|---|---|
| System.AggregateException | Transmission may (internally) be automatically retried as dictated by IProductActivationTransmissionCommenceConfigurationPhase. As a result, an System.AggregateException reflecting the outcomes of multiple activation attempts may be thrown. |
| ActivationServerException | Thrown if the Software Potential service refuses the Activation Request. For some causes, there are specific derived Types reflecting the indicated reason. |
| ActivationTransmissionException | Thrown if it was not possible to communicate with the Software Potential Activation service. |