• Webservices API
  • Agent Runtime API
  • Support
  • Samples
  • Software Potential Home
Show / Hide Table of Contents
  • Sp.Agent
    • ActivateLicensesExtensions
    • IProductContext
    • ProductActivationConfigurationCompleteWithDefaultsExtensions
    • ProductActivationConfigurationDefaultExtensions
  • Sp.Agent.Activation
    • ActivationServerException
    • ActivationTransmissionException
    • DeviceChangedActivationServerException
    • DistributorLicenseActivationServerException
    • IActivateLicenses
    • IActivateLicensesAdvanced
    • InvalidLicenseKeyException
    • InvalidVersionActivationServerException
    • LicenseDisabledActivationServerException
    • LicenseExpiredActivationServerException
    • LinkedLicenseAmbiguousStorageActivationServerException
    • LinkedLicenseNoStorageActivationServerException
    • NumberOfActivationsExceededActivationServerException
    • ProductIdMismatchActivationServerException
    • RenewalNotAuthorizedActivationServerException
    • TagsChangedActivationServerException
  • Sp.Agent.Configuration
    • AgentContext
    • AgentContextDistributorsExtensions
    • AgentDistributorsConfigurationExtensions
    • CloudStorageConfigurationExtensions
    • ConfigurationCompleteWithDefaultsExtensions
    • CrmActivationEndpointsConfigurationPhaseExtensions
    • CrmAgentContextExtensions
    • CrmStartingConfigurationPhaseExtensions
    • DistributorDisableStorageExtensions
    • FileStoreInitialization
    • HardwareStoreConfigurationExtensions
    • HardwareStoreInitialization
    • IAgentChallengeConfigurationPhase
    • IAgentCloudStorageCommenceConfigurationPhase
    • IAgentCloudStorageCompleteConfigurationPhase
    • IAgentCloudStorageConfigurationPhase
    • IAgentCloudStorageConfigurationPhaseTail
    • IAgentCloudStorageCustomIdConfigurationPhase
    • IAgentCommenceConfigurationPhase
    • IAgentCompletedConfigurationPhase
    • IAgentContext
    • IAgentDistributorsConfigurationPhase
    • IAgentEmbeddedLicensesConfigurationPhase
    • IAgentExternalStorageConfigurationPhase
    • IAgentHardwareBoundStorageConfigurationPhase
    • IAgentUserBoundStorageConfigurationPhase
    • ICrmActivationEndpointsConfigurationPhase
    • IDistributorCommenceConfigurationPhase
    • IDistributorCompletedConfigurationPhase
    • IDistributorConfigurationPhaseTail
    • IDistributorNamedUserConfigurationPhase
    • IInitializeStores
    • IStoreLicensesInitializationExtensions
    • LocalStoreConfigurationExtensions
    • LocalStoreInitialization
    • ProductContextDistributedExtensions
    • RemovableConfigurationExtensions
    • WebApplicationStoreConfigurationExtensions
  • Sp.Agent.Configuration.Product
    • IProductCommenceConfigurationPhase
    • IProductCompletedConfigurationPhase
    • IProductConfigurationPhaseTail
  • Sp.Agent.Configuration.Product.Activation
    • IActivationAttemptContext
    • IActivationDeviceLabelContext
    • IActivationTaggingContext
    • IProductActivationCommenceConfigurationPhase
    • IProductActivationCompletedConfigurationPhase
    • IProductActivationConfigurationPhase
    • IProductActivationConfigurationPhaseTail
    • IProductActivationDeviceLabelConfigurationPhase
    • IProductActivationDeviceLabelTailConfigurationPhase
    • IProductActivationTransmissionCommenceConfigurationPhase
    • IProductActivationTransmissionCompletedConfigurationPhase
    • IProductActivationTransmissionConfigurationPhase
    • IProductActivationTransmissionConfigurationPhaseTail
    • IProductActivationTransmissionEndpointConfigurationPhase
    • IProductActivationTransmissionHooksConfigurationPhase
    • IProductActivationTransmissionProxyConfigurationPhase
    • ProductActivationConfigurationException
  • Sp.Agent.Distributor
    • CheckedOutNotLicensedException
    • CheckoutRequiresStorageException
    • CheckoutStorageAccessException
    • DistributorIntegrityException
    • DistributorIntegrityNotLicensedException
    • DistributorNotLicensedException
    • DistributorRequestException
    • IAvailableCheckout
    • ICheckout
    • ICheckoutContext
    • IDistributedContext
    • IDistributorsContext
    • NoDistributorException
    • NoLongerAvailableException
    • NotLicnesedInvalidNamedUserException
  • Sp.Agent.Execution
    • NotLicensedException
  • Sp.Agent.Licensing
    • IFeature
    • ILicense
    • ILicenseAdvanced
    • ILicensePeriod
    • ILicenseRenewal
    • IQueryFeatures
    • IQueryLicenses
    • IQueryLocalFeatures
    • IQueryUserTokens
    • IUserToken
    • LicenseRevisionException
  • Sp.Agent.Storage
    • DistributorLicenseOnClientException
    • InvalidStorageAccessException
    • InvalidStorageException
    • IStore
    • IStoreLicenses
    • IStoreUserTokens
    • LicenseNotFoundException
    • LicenseTargetEnvironmentMismatchException
    • NonmatchingProductIdException
    • ReadingStorageInaccessibleException
    • ServerOSNotAllowedException
    • StorageInaccessibleException
    • StoreNotEmptyException
    • UserTokenNotFoundException
    • VirtualMachineNotAllowedException
    • WritingStorageInaccessibleException

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 IsWellFormedKey().

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

true if activationKey is well formed; otherwise, false.

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 IsWellFormedKey().

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 ex.Flatten().InnerException. It is recommended to use OnlineActivateAsync(String) in preference.

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 IsWellFormedKey().

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 ex.Flatten().InnerException. It is recommended to use OnlineActivateAsync(String) in preference.

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 IsWellFormedKey().

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 IsWellFormedKey().

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.

Extension Methods

ActivateLicensesExtensions.Advanced(IActivateLicenses)
Back to top Generated by DocFX