AP&C API Reference
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
Apac.Licensing.KeyManager Class Reference

The implementation of the contract for requesting license keys for unlocking application features. It is thread-safe, and allows a request for multiple features in one request. This object can be used directly, in-process, or it can be obtained from a central remoting server, if such is deployed in the enterprise. More...

Inheritance diagram for Apac.Licensing.KeyManager:
Apac.Licensing.IKeyManager

Public Member Functions

override object InitializeLifetimeService ()
 Implement an infinite marshalling lease. More...
 
AuditResult SyncNonVolatileCount (string contextId, string[] nodeIds, LicensedFeatures feature, int numLeasesHeld)
 Allows a client application to report its nonvolatile lease counts for a given feature and have the license manager sync up with it. More...
 
int GetNumLeases (string contextId, string[] nodeIds, LicensedFeatures feature)
 Gets the number of leases available to the caller given the context and node and feature, including floating/shared licenses that support the feature. More...
 
AcquisitionResponse AcquireLicenseLock (AcquisitionRequest request)
 The method used to aquire a key to unlock a licensed feature where the lease count is managed by the central server. More...
 
ReleaseResponse ReleaseLicenseLock (string acquisitionId)
 The method used to release a key previously used to unlock a licensed feature. More...
 
ReleaseResponse ReleaseLicenseLock (string contextId, string[] nodeIds, LicensedFeatures feature, int numToRelease)
 The method used to release a key previously used to unlock a licensed feature. More...
 
ReleaseResponse ReleaseLicenseLock (string contextId, string[] nodeIds, LicensedFeatures feature, int numToRelease, int numLeasesHeld)
 The method used to release a key previously used to unlock a licensed feature. More...
 
bool RenewLicenseLocks (string acquisitionId)
 The method used to renew feature locks checked out before they expire. More...
 
bool RenewLicenseLock (string featureResponseId)
 The method used to renew a feature lock checked out before it expires. More...
 
void ReloadKeys ()
 Management method for forcing a reload of license keys from disk. More...
 
Key Find (KeySearchHandler match)
 A search routine for finding a specific key. More...
 
Key[] FindAll (KeySearchHandler match)
 A search routine for finding specific keys. More...
 
Key Find (FeatureSearchHandler match)
 A search routine for finding a specific key that has a specific feature. More...
 
Key[] FindAll (FeatureSearchHandler match)
 A search routine for finding specific keys that have specific features. More...
 
void Close ()
 Signals the key manager to stop taking requests and persist its state. More...
 
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 

Static Public Member Functions

static string[] GetMacAddresses ()
 Gets a list of all MAC addresses on the calling machine. More...
 
static AssemblyVerificationResults VerifyAssemblyStrongName (string path)
 Verifies that the file given by path is a signed, untampered file. More...
 

Protected Member Functions

void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources More...
 

Properties

LockRecord[] Locks [get]
 Property used for displaying the current lock records. More...
 
Key[] Keys [get]
 Property used for displaying the currently loaded license keys, which determine which features are available in which contexts. More...
 
static bool Tampered [get]
 Gets the property that indicates if the licensing assembly has been tampered. More...
 
static System.Collections.Generic.IEnumerable< byte[]> PublicKeys [get]
 Gets the public key tokens that are valid for use in signing license files. More...
 
- Properties inherited from Apac.Licensing.IKeyManager
LockRecord[] Locks [get]
 Property used for displaying the current lease records. More...
 
Key[] Keys [get]
 Property used for displaying the currently loaded license keys, which determine which features are available in which contexts. More...
 

Detailed Description

The implementation of the contract for requesting license keys for unlocking application features. It is thread-safe, and allows a request for multiple features in one request. This object can be used directly, in-process, or it can be obtained from a central remoting server, if such is deployed in the enterprise.

Member Function Documentation

◆ AcquireLicenseLock()

AcquisitionResponse Apac.Licensing.KeyManager.AcquireLicenseLock ( AcquisitionRequest  request)
inline

The method used to aquire a key to unlock a licensed feature where the lease count is managed by the central server.

Parameters
requestThe object containing the elements describing the request.
Returns
Returns an AquisitionReponse that indicates the result of the aquisition request.

Implements Apac.Licensing.IKeyManager.

◆ Close()

void Apac.Licensing.KeyManager.Close ( )
inline

Signals the key manager to stop taking requests and persist its state.

Implements Apac.Licensing.IKeyManager.

◆ Dispose() [1/2]

void Apac.Licensing.KeyManager.Dispose ( )
inline

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ Dispose() [2/2]

void Apac.Licensing.KeyManager.Dispose ( bool  disposing)
inlineprotected

Releases unmanaged and - optionally - managed resources

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

◆ Find() [1/2]

Key Apac.Licensing.KeyManager.Find ( FeatureSearchHandler  match)
inline

A search routine for finding a specific key that has a specific feature.

Parameters
matchThe delegate used to perform the matching.
Returns
Returns the first Key that matches.

◆ Find() [2/2]

Key Apac.Licensing.KeyManager.Find ( KeySearchHandler  match)
inline

A search routine for finding a specific key.

Parameters
matchThe delegate used to perform the matching.
Returns
Returns the first Key that matches.

Implements Apac.Licensing.IKeyManager.

◆ FindAll() [1/2]

Key [] Apac.Licensing.KeyManager.FindAll ( FeatureSearchHandler  match)
inline

A search routine for finding specific keys that have specific features.

Parameters
matchThe match.
Returns
Returns an array of Keys that matched.

◆ FindAll() [2/2]

Key [] Apac.Licensing.KeyManager.FindAll ( KeySearchHandler  match)
inline

A search routine for finding specific keys.

Parameters
matchThe delegate used to perform the matching.
Returns
Returns an array of Keys that matched.

Implements Apac.Licensing.IKeyManager.

◆ GetMacAddresses()

static string [] Apac.Licensing.KeyManager.GetMacAddresses ( )
inlinestatic

Gets a list of all MAC addresses on the calling machine.

Returns
Returns an array of strings containing the MAC addresses.

◆ GetNumLeases()

int Apac.Licensing.KeyManager.GetNumLeases ( string  contextId,
string[]  nodeIds,
LicensedFeatures  feature 
)
inline

Gets the number of leases available to the caller given the context and node and feature, including floating/shared licenses that support the feature.

Parameters
contextIdThe context id.
nodeIdsThe node ids.
featureThe feature.
Returns
Returns the number of licenses for the feature.

Implements Apac.Licensing.IKeyManager.

◆ InitializeLifetimeService()

override object Apac.Licensing.KeyManager.InitializeLifetimeService ( )
inline

Implement an infinite marshalling lease.

Returns

◆ ReleaseLicenseLock() [1/3]

ReleaseResponse Apac.Licensing.KeyManager.ReleaseLicenseLock ( string  acquisitionId)
inline

The method used to release a key previously used to unlock a licensed feature.

Parameters
acquisitionIdThe id of the acquisition used to containing the elements describing the request.
Returns
Returns a ReleaseResponse that indicates the result of the release request.

Implements Apac.Licensing.IKeyManager.

◆ ReleaseLicenseLock() [2/3]

ReleaseResponse Apac.Licensing.KeyManager.ReleaseLicenseLock ( string  contextId,
string[]  nodeIds,
LicensedFeatures  feature,
int  numToRelease 
)
inline

The method used to release a key previously used to unlock a licensed feature.

Parameters
contextIdThe id of the context used to obtain the lock.
nodeIdsThe ids of the node that obtained the lock.
featureThe feature for which the lock was obtained.
numToReleaseThe number of locks to release.
Returns
Returns a ReleaseResponse that indicates the result of the release request.

Implements Apac.Licensing.IKeyManager.

◆ ReleaseLicenseLock() [3/3]

ReleaseResponse Apac.Licensing.KeyManager.ReleaseLicenseLock ( string  contextId,
string[]  nodeIds,
LicensedFeatures  feature,
int  numToRelease,
int  numLeasesHeld 
)
inline

The method used to release a key previously used to unlock a licensed feature.

Parameters
contextIdThe id of the context used to obtain the lock.
nodeIdsThe ids of the node that obtained the lock.
featureThe feature for which the lock was obtained.
numToReleaseThe number of locks to release.
numLeasesHeldThe number of (non-volatile) locks held by the client, or < 1 for volatile locks.
Returns
Returns a ReleaseResponse that indicates the result of the release request.

Implements Apac.Licensing.IKeyManager.

◆ ReloadKeys()

void Apac.Licensing.KeyManager.ReloadKeys ( )
inline

Management method for forcing a reload of license keys from disk.

Implements Apac.Licensing.IKeyManager.

◆ RenewLicenseLock()

bool Apac.Licensing.KeyManager.RenewLicenseLock ( string  featureResponseId)
inline

The method used to renew a feature lock checked out before it expires.

Parameters
featureResponseId
Returns
Returns true if successful, false if the renewal failed. In the negative case, the application should attempt to re-acquire the locks.

Implements Apac.Licensing.IKeyManager.

◆ RenewLicenseLocks()

bool Apac.Licensing.KeyManager.RenewLicenseLocks ( string  acquisitionId)
inline

The method used to renew feature locks checked out before they expire.

Parameters
acquisitionIdThe id of the acquisition response received when the locks were obtained.
Returns
Returns true if successful, false if the renewal failed. In the negative case, the application should attempt to re-acquire the locks.

Implements Apac.Licensing.IKeyManager.

◆ SyncNonVolatileCount()

AuditResult Apac.Licensing.KeyManager.SyncNonVolatileCount ( string  contextId,
string[]  nodeIds,
LicensedFeatures  feature,
int  numLeasesHeld 
)
inline

Allows a client application to report its nonvolatile lease counts for a given feature and have the license manager sync up with it.

Parameters
contextIdThe context id.
nodeIdsThe node ids.
featureThe feature.
numLeasesHeldThe number of leases held by the client.
Returns
Returns a AuditResult containing details about any alterations made by the sync operation.

Implements Apac.Licensing.IKeyManager.

◆ VerifyAssemblyStrongName()

static AssemblyVerificationResults Apac.Licensing.KeyManager.VerifyAssemblyStrongName ( string  path)
inlinestatic

Verifies that the file given by path is a signed, untampered file.

Parameters
pathThe full path to the file.
Returns
Returns true if the file is valid, false if it is not valid.

Property Documentation

◆ Keys

Key [] Apac.Licensing.KeyManager.Keys
get

Property used for displaying the currently loaded license keys, which determine which features are available in which contexts.

◆ Locks

LockRecord [] Apac.Licensing.KeyManager.Locks
get

Property used for displaying the current lock records.

◆ PublicKeys

System.Collections.Generic.IEnumerable<byte[]> Apac.Licensing.KeyManager.PublicKeys
staticget

Gets the public key tokens that are valid for use in signing license files.

◆ Tampered

bool Apac.Licensing.KeyManager.Tampered
staticget

Gets the property that indicates if the licensing assembly has been tampered.


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