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

This class represent a basic instance of a licensing key. It contains values that uniquely identify the license and the node to which it applies. These values are used to unlock functionality in applications written to be license-aware. More...

Public Member Functions

int GetFeatureLeases (LicensedFeatures name)
 Gets the number of leases that the feature is licensed for. More...
 
bool IsNewerThan (Key key)
 Indicates that the current key is newer than key . More...
 
bool IsFeatureLicensed (LicensedFeatures feature)
 
LicensedFeature GetLicensedFeature (LicensedFeatures feature)
 Does a Find for the requested feature. More...
 
bool ContainsNodeId (string[] nodeIds)
 Determines whether this key matches one of the the nodeIds . More...
 
bool ContainsPartialNodeId (string[] nodeIds)
 Determines whether this key partially matches one of the the nodeIds . More...
 
override string ToString ()
 

Protected Member Functions

 Key (Guid id, string contextIdentifier, string nodeIdentifier, DateTime creationDate)
 Creates a license key. More...
 
void AddFeature (LicensedFeatures name, DateTime expirationDate)
 Allows license key creation to include a single-lease, volatile, node-locked feature. More...
 
void AddFeature (LicensedFeatures name, DateTime expirationDate, bool nodeLocked, int numLeases)
 Allows license key creation to include a feature that is either floating or node-locked, and to include a number of leases more than the default value of one (1), and defaulted to a volatile license. More...
 
void AddFeature (LicensedFeatures name, FeatureType type, DateTime expirationDate, bool nodeLocked, int numLeases)
 Allows license key creation to include a feature that is either floating or node-locked, and to include a number of leases more than the default value of one (1). More...
 

Properties

Guid Id [get]
 Gets the unique identifier for the license key. More...
 
string ContextIdentifier [get]
 Gets the value used to identify the valid context for the license (such as company or URL). More...
 
string NodeIdentifier [get]
 Gets the value used to identify the valid node for the license (such as MAC address). More...
 
string ContextIdentifierMatch [get]
 Gets the value used to match valid contexts for the license (ie: wildcards removed). More...
 
string NodeIdentifierMatch [get]
 Gets the value used to match valid nodes for the license (ie: wildcards removed). More...
 
LicensedFeature[] Features [get]
 
DateTime CreationDate [get]
 
string DisplayName [get]
 A string used in logs and displays needing to identify this key. More...
 
bool IsContextIdWildcard [get]
 Indicates if the context identifier is only a wildcard. More...
 
bool ContextIdContainsWildcard [get]
 Indicates if the context identifier ends with a wildcard. More...
 
bool IsNodeIdWildcard [get]
 Indicates if the node identifier is only a wildcard. More...
 
bool NodeIdContainsWildcard [get]
 Gets a value indicating whether the node identifier ends with a wildcard. More...
 
ILog Log [get]
 Gets the logger for the concrete class. More...
 

Detailed Description

This class represent a basic instance of a licensing key. It contains values that uniquely identify the license and the node to which it applies. These values are used to unlock functionality in applications written to be license-aware.

Constructor & Destructor Documentation

◆ Key()

Apac.Licensing.Key.Key ( Guid  id,
string  contextIdentifier,
string  nodeIdentifier,
DateTime  creationDate 
)
inlineprotected

Creates a license key.

Parameters
keyThe unique, stable key used to identify the license.
contextIdentifierThe value used to identify the valid context for the license (such as URL).
nodeIdentifierThe value used to identify the valid node for the license (such as MAC address).

Member Function Documentation

◆ AddFeature() [1/3]

void Apac.Licensing.Key.AddFeature ( LicensedFeatures  name,
DateTime  expirationDate 
)
inlineprotected

Allows license key creation to include a single-lease, volatile, node-locked feature.

Parameters
nameSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime).
expirationDateSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime).

◆ AddFeature() [2/3]

void Apac.Licensing.Key.AddFeature ( LicensedFeatures  name,
DateTime  expirationDate,
bool  nodeLocked,
int  numLeases 
)
inlineprotected

Allows license key creation to include a feature that is either floating or node-locked, and to include a number of leases more than the default value of one (1), and defaulted to a volatile license.

Parameters
nameSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).
expirationDateSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).
nodeLockedSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).
numLeasesSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).

This method is more for backward compatability with existing licenses than anything else. Many existing licenses for IDAClient should be made non-volatile once the new license service is put in place.

◆ AddFeature() [3/3]

void Apac.Licensing.Key.AddFeature ( LicensedFeatures  name,
FeatureType  type,
DateTime  expirationDate,
bool  nodeLocked,
int  numLeases 
)
inlineprotected

Allows license key creation to include a feature that is either floating or node-locked, and to include a number of leases more than the default value of one (1).

Parameters
nameSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).
typeSee FeatureType.
expirationDateSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).
nodeLockedSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).
numLeasesSee LicensedFeature.LicensedFeature<LicensedFeatures, DateTime, bool, int).

◆ ContainsNodeId()

bool Apac.Licensing.Key.ContainsNodeId ( string[]  nodeIds)
inline

Determines whether this key matches one of the the nodeIds .

Parameters
nodeIdsThe node ids.
Returns
true if it contains one of the nodeIds ; otherwise, false.

◆ ContainsPartialNodeId()

bool Apac.Licensing.Key.ContainsPartialNodeId ( string[]  nodeIds)
inline

Determines whether this key partially matches one of the the nodeIds .

Parameters
nodeIdsThe node ids.
Returns
true if it partially contains one of the nodeIds ; otherwise, false.

◆ GetFeatureLeases()

int Apac.Licensing.Key.GetFeatureLeases ( LicensedFeatures  name)
inline

Gets the number of leases that the feature is licensed for.

Parameters
nameThe name of the feature being requested.
Returns
Returns the number of leases available for feature.

◆ GetLicensedFeature()

LicensedFeature Apac.Licensing.Key.GetLicensedFeature ( LicensedFeatures  feature)
inline

Does a Find for the requested feature.

Parameters
featureThe LicensedFeatures to be found.
Returns
Returns the LicensedFeature requested or null if the requested feature cannot be found.

◆ IsNewerThan()

bool Apac.Licensing.Key.IsNewerThan ( Key  key)
inline

Indicates that the current key is newer than key .

Parameters
keyThe key being compared.
Returns
Returns true if this key was created after key .

Property Documentation

◆ ContextIdContainsWildcard

bool Apac.Licensing.Key.ContextIdContainsWildcard
get

Indicates if the context identifier ends with a wildcard.

true if the context id ends with a wildcard; otherwise, false.

◆ ContextIdentifier

string Apac.Licensing.Key.ContextIdentifier
get

Gets the value used to identify the valid context for the license (such as company or URL).

◆ ContextIdentifierMatch

string Apac.Licensing.Key.ContextIdentifierMatch
get

Gets the value used to match valid contexts for the license (ie: wildcards removed).

◆ DisplayName

string Apac.Licensing.Key.DisplayName
get

A string used in logs and displays needing to identify this key.

◆ Id

Guid Apac.Licensing.Key.Id
get

Gets the unique identifier for the license key.

◆ IsContextIdWildcard

bool Apac.Licensing.Key.IsContextIdWildcard
get

Indicates if the context identifier is only a wildcard.

◆ IsNodeIdWildcard

bool Apac.Licensing.Key.IsNodeIdWildcard
get

Indicates if the node identifier is only a wildcard.

◆ Log

ILog Apac.Licensing.Key.Log
getprotected

Gets the logger for the concrete class.

◆ NodeIdContainsWildcard

bool Apac.Licensing.Key.NodeIdContainsWildcard
get

Gets a value indicating whether the node identifier ends with a wildcard.

true if the node id ends with a wildcard; otherwise, false.

◆ NodeIdentifier

string Apac.Licensing.Key.NodeIdentifier
get

Gets the value used to identify the valid node for the license (such as MAC address).

◆ NodeIdentifierMatch

string Apac.Licensing.Key.NodeIdentifierMatch
get

Gets the value used to match valid nodes for the license (ie: wildcards removed).


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