• 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 IDistributedContext

Provides queries and operations for Distributor-aware applications such as ICheckoutContext, Features and Acquire().

Namespace: Sp.Agent.Distributor
Assembly: Sp.Agent.Distributor.dll

Properties

Checkout

Facilitates switching the application between Connected and Disconnected mode.

Declaration
ICheckoutContext Checkout { get; }
Property Value
Type Description
ICheckoutContext
Exceptions
Type Condition
CheckoutRequiresStorageException

Thrown if no storage has been configured within the IAgentContext Configuration.

Features

The set of Distributed Features held in this context, comprised of:

Leases or Checkouts that have expired are excluded from the results.

Declaration
ISet<string> Features { get; }
Property Value
Type Description
System.Collections.Generic.ISet<System.String>
Exceptions
Type Condition
CheckoutStorageAccessException

Thrown if there is a problem accessing the Checkout storage mechanism.

Methods

Acquire(Func<ISet<String>[], IEnumerable<String>>)

Manages the provisioning of features for the application based on the available Distributed resources (should a Distributor be configured).

The selector function is responsible for choosing the set of features to be acquired as its return value. The chosen features must be contained within one of the supplied sets.

The sets provided represent either the currently available feature sets on the Distributor if Connected (or the checked out set if there is a TryGetCurrent(out ICheckout)).

Note selector may be invoked multiple times (if an availability set has become unavailable by the time selector decides), until a successful selection occurs.

If no features are available, the selector function will be passed a single empty set.

Declaration
void Acquire(Func<ISet<string>[], IEnumerable<string>> selector)
Parameters
Type Name Description
System.Func<System.Collections.Generic.ISet<System.String>[], System.Collections.Generic.IEnumerable<System.String>> selector

Responsible for selecting a subset of features to acquire given the sets available.

Remarks

On success, Features will reflect the chosen features (any previously Acquired features are relinquished).

Note the recommended way to cancel the process is to yield an empty set from the selector.

Any exception emitted from the supplied selector function will be propagated.

Examples
            // Acquire the biggest feature set available from the Distributor 
            // (assuming SKU design allocates most features to the 'best' licenses, this picks the most rich license)
            SpAgent.Distributed.Acquire( sets => sets.OrderByDescending( setFeatures => setFeatures.Count() ).First() );
Exceptions
Type Condition
DistributorRequestException

Thrown if there was an exception on the call to the Distributor.

DistributorIntegrityException

Thrown if server integrity has been compromised.

CheckoutStorageAccessException

Thrown if there is a problem accessing the store (if Checked out).

System.InvalidOperationException

Thrown if selector does not pick a valid subset of one of the sets.

Events

FeaturesUpdated

Triggered when the set of locally held features is updated for the ProductContextFor(String, String).

Declaration
event EventHandler<EventArgs> FeaturesUpdated
Event Type
Type Description
System.EventHandler<System.EventArgs>
Back to top Generated by DocFX