Skip to main content

%SYSTEM.License

abstract class %SYSTEM.License extends %SYSTEM.Help

The %SYSTEM.License class provides an interface to the Cache License API.

Some class methods are implemented in the special $system object and can be accessed with the $SYSTEM.License.Method() syntax. The system object methods are identified in the method documentation as $SYSTEM.License.XXX.

Example: Set Success=$SYSTEM.License.Login(UserIdentifier)

Other methods are implemented as class methods of the %SYSTEM.License class and can be accessed by the usual ##class(%SYSTEM.License).ClassMethodName() syntax. The special $system object methods can also be accessed in this way.

Example: Do ##class(%SYSTEM.License).ShowSummary()

The %SYSTEM.License class includes a number of license usage reports and queries. The data source is either the local instance or the license server, or in some cases both. The data source is identified in the individual query descriptions.

Comparing data from the license server with data from an individual Cache instance can sometimes lead to apparent inconsistencies. These inconsistencies can be explained by understanding the operation of the license server. Each Cache instance maintains a database of its license use and independently controls connections to itself. When multiple instances share a Cache license key, the license server coordinates the counting of license usage among all instances sharing the license key. Each instance periodically sends messages to the license server describing any changes that have occurred to the local license database since the previous message. Each instance controls logins and logouts locally and can continue to permit connections if communication with the license server should be interrupted. The license server coordinates the activity of the participating instances by preventing them from collectively exceeding the authorized license count.

The periodic nature of license server updates is one source of temporary inconsistency between the license server's view of license use and an individual Cache instance's view. License server and Cache instance counts of license usage will be temporarily out of sync if a number of logins or logouts have not yet been sent to the license server at the time usage reports are requested from the license server and from the local instance. This inconsistency is short lived because updates are sent to the license server about every 15 seconds.

It is also possible for the active license server to be stopped, perhaps because the host on which it is running has shut down or because the instance that started it is being upgraded. In this case, the replacement license server's view of license use will be incomplete until all participating instances have reported their license use.

Method Inventory

Methods

classmethod ActiveServerCount(ByRef Status As %Status) as %Integer
$SYSTEM.License.ActiveServerCount() returns the number of instances (including the current instance) currently using the active license key. It executes the $SYSTEM.License.KeyOrderNumber() query and counts the number of instances using a license with the same OrderNumber value as the active license key on the current instance. Error status is returned by reference in the Status argument.
classmethod ApplicationServerLogin(AppName As %String = "", Keyword As %String = "", ByRef Status As %Status) as %Integer
##Class(%SYSTEM.License).ApplicationServerLogin(AppName, Keyword, Status) returns 1 if the number of instances using the active license key used by this instance (including this instance) does not exceed the number authorized by the "Keyword" item in the "AppName" application license section. Error status is returned by reference in the Status argument.
final classmethod CKEY()
Display the active license key to the current device.
The fields of the [License] section of the installed cache.key file are displayed followed by a brief accounting of license usage, including:
  • License units currently available.
  • Minimum number of license units available at any time since the instance started.
  • Maximum number of license units available.
License usage levels are obtained from the current Cache instance.
This report is identical to those produced by CKEY^%SYS.LICENSE and ^CKEY.
classmethod CSPGrace() as %Integer
$SYSTEM.License.CSPGrace() returns the current number of CSP sessions in the grace period.
classmethod CSPUsers() as %Integer
$SYSTEM.License.CSPUsers() returns the current number of CSP users.
final classmethod CheckAppLicenseUsed(AppName As %String, FeatureKeyword As %String) as %String
$SYSTEM.License.CheckAppLicenseUsed(AppName,Keyword) iterates through the internal license use tables counting the number of times an application license keyword has been taken. The resulting count is compared to the internal usage count maintained for the application license keyword. The internal count is adjusted if it does not agree with the counted value.
The return value is a string containing "CountedUsage,InternalUsageCountBeforeAdjustment,AppLicensesRecovered"
Throws an "INVALID ARGUMENT" error if AppName is not licensed. Returns "" if FeatureKeyword is not licensed. Returns "" if the application/keyword license value is not a number because only numeric application features can be taken and released. AppName is of the form Company.Application for protected application license sections or Application for unprotected application license sections.

Example: $SYSTEM.License.CheckAppLicenseUsed("MyCompany.MyApp","MyAppFeature")
classmethod CheckKeyForUpgrade(NewKeyFile As %String, ByRef Reductions, ByRef Status As %Status) as %Boolean
$SYSTEM.Licence.CheckKeyForUpgrade(NewKeyFile,.Reductions,.Status) compares the active license key with the key in file NewKeyFile to determine if the new license key authorizes less capability than the active license. It returns TRUE (1) if any capabilities authorized by the active key are absent in the new key or of lessor capacity. It returns FALSE (0) if all capabilities of the active license are equaled or exceeded by the license in NewKeyFile.

Arguments:
  • NewKeyFile (input): full path and file name of new license key file.
  • Reductions (output by reference): an array of capabilities that are smaller in the new key than in the active key.
  • Status (output by reference): an error status returned by IsValidKey when it was called to examine the new license file.
The Reductions array can contain the following elements:
  • Reductions("Cores")=$lb(OldCores,NewCores)
  • Reductions("Server")=$lb(OldServerValue,NewServerValue)
  • Reductions("Users")=$lb(OldUsers,NewUsers)
  • Reductions("Product")=$lb(OldProduct,NewProduct)
  • Reductions("LicenseType")=$lb(OldType,NewType)
Reductions in licensed features will be indicated by Reductions("Feature", FeatureName)=$lb(OldFeatureValue,NewFeatureValue). License parameters which have not changed or which have increased in capability will not be shown.
classmethod ClearDurationCounts() as %List
$SYSTEM.License.ClearDurationCounts() sets the collection area of the LoginDuration query to all zeros and returns the counts prior to change. Requires the %Manager role.
classmethod ConnectionCount(UserIdentifier As %String) as %Integer
$SYSTEM.License.ConnectionCount() returns the number of connections currently associated with the given UserIdentifier. The range of return values is normally 0 through MAXCONNECTIONS. If the value exceeds MAXCONNECTIONS then more than the allowable number of concurrent connections were attempted for a given ID and the system has transitioned to a mode of one connection per license for this UserIdentifier.
final classmethod Decode()
Decode and display the capabilities encoded in the AuthorizationKey field of the active License Key.

final classmethod DecodeAuth(key As %String)
Decode and display the capabilities encoded in the AuthorizationKey field of a License Key provided as the 'key' argument.
final classmethod DeferUserIdentification(usage As %Integer) as %Integer
Specify Deferred (usage=1) or automatic (usage=0) license login for the local Cache instance.
final classmethod DumpKey()
Dump the License Server view of key utilization for the active key.
Note: Not applicable with a Single-Server key.

This report displays license utilization for the key loaded by the current Cache instance. The report is produced by the license server and may reside on a remote host. The location (host and directory) of the output file will be displayed on the terminal when the report is complete. The report shows the license server's view of license use by all Cache instances which share a license key and which are configured to use the same license server (as is required when sharing a key).

License use by each client (License Id) connected to each Cache instance is reported in these columns:
  • Client: License Id for the connection from a client to this Cache instance.
  • LU: Number of license units consumed by connections from this client to this Cache instance.
  • Connections: Number of connections from this client to this Cache instance.
  • Server: Address of host where the Cache instance is running.
  • Instance: Name of the Cache instance to which the client is connected.
The report displays the fields of the license key and summarizes the number of servers (Cache instances) using the key, authorized license units, and the current and maximum number of license units in use. This summary information represents the license server's view of license use. This report is identical to the report produced by dumpkey^%SYS.LICENSE.
final classmethod DumpKeys()
Dump the License Server view of key utilization for all keys.
Note: Not applicable with a Single-Server key.

This report displays license utilization for every key controlled by the license server. The report is produced by the license server and may reside on a remote host. The location (host and directory) of the output file will be displayed on the terminal when the report is complete. The report shows the license server's view of license usage by all Cache instances which share each license key under the license server's control. For true reporting and as a requirement of the Cache license agreement, each Cache instance that uses a key must configure the same set of license servers.

License use by each client (License Id) connected to each Cache instance is reported in these columns:
  • Client: License Id for the connection from a client to this Cache instance.
  • LU: Number of license units consumed by connections from this client to this Cache instance.
  • Connections: Number of connections from this client to this Cache instance.
  • Server: Address of host where the Cache instance is running.
  • Instance: Name of the Cache instance to which the client is connected.
The report displays the fields of each license key and summarizes the number of servers (Cache instances) using the key, authorized license units, and the current and maximum number of license units in use. This summary information represents the license server's view of license use for each license key. This report is identical to the report produced by dumpkeys^%SYS.LICENSE.
final classmethod DumpLocalAll(filename As %String) as %String
Dump all the local Cache instance's license table entries to 'filename' in the sequential file output directory. A file named all.dmp is created if the filename argument is not supplied.
The report displays the following columns:
  • UserId: the license user identifier consuming each license table entry.
  • Type: License login type (User, CSP, or Mixed)
  • Connections: Number of connections to this instance by this user.
  • MaxCon: Maximum number of connections to this instance by this user.
  • CSPCon: Number of CSP connections by this user.
  • LU: Number of license units consumed. If more than one, the maximum connection count is or was exceeded by this user and the user is now consuming one license unit per connection.
  • Active: Time in seconds the user has been active.
  • Grace: Number of seconds remaining in the grace period for a CSP user who has disconnected.
This report shows license use at the local instance and is identical to the report produced by ldumpall^%SYS.LICENSE. It presents the results of the %SYSTEM.License.UserListAll query.
final classmethod DumpLocalInUse(filename As %String) as %String
Dump the local Cache instance's active license table entries to 'filename' in the sequential file output directory. A file named inuse.dmp is created if the filename argument is not supplied.
The report displays the following columns:
  • UserId: the license user identifier consuming each license table entry.
  • Type: License login type (User, CSP, or Mixed)
  • Connections: Number of connections to this instance by this user.
  • MaxCon: Maximum number of connections to this instance by this user.
  • CSPCon: Number of CSP connections by this user.
  • LU: Number of license units consumed. If more than one, the maximum connection count is or was exceeded by this user and the user is now consuming one license unit per connection.
  • Active: Time in seconds the user has been active.
  • Grace: Number of seconds remaining in the grace period for a CSP user who has disconnected.
This report shows license use at the local instance and is identical to the report produced by ldumpinuse^%SYS.LICENSE. It presents the results of the %SYSTEM.License.UserList query.
final classmethod DumpLocalPID(filename As %String) as %String
Dump license use by process Id to 'filename' in the sequential file output directory. A file named piduse.dmp is created if the filename argument is not supplied.
The report displays the following columns:
  • PID: Process Id.
  • Display PID: Process Id in display format (hex on VMS).
  • Process: Process type (System, User, CSP, Diagnostic, Server, Pending).
  • LID: The license user identifier for which a license unit is being consumed.
  • Type: License login type (User, CSP, or Mixed)
  • Con: Number of connections to this instance by this user.
  • MaxCon: Maximum number of connections to this instance by this user.
  • CSPCon: Number of CSP connections by this user.
  • LU: Number of license units consumed. If more than one, the maximum connection count is or was exceeded by this user and the user is now consuming one license unit per connection.
  • Active: Time in seconds the user has been active.
  • Grace: Number of seconds remaining in the grace period for a CSP user who has disconnected.
This report shows license use at the local instance and is identical to the report produced by ldumppid^%SYS.LICENSE. Summing the columns of this report is meaningless.
This report is identical to ldumppid^%SYS.LICENSE. It presents the results of the %SYSTEM.License.ProcessList query.
final classmethod DumpServer()
Dump License Server database for this server.
Note: Not applicable with a Single-Server key. This report presents license usage by the current Cache instance recorded at the license server. The report is produced by the license server and may reside on a remote host. The location (host and directory) of the report output file will be reported to the terminal when the report is complete." License use by client (License Id) is reported in these columns:
  • Connections: Number of connections for this client.
  • License Units: Number of license units consumed by this client on this server.
  • Client: License Id consuming the license unit or units.
The report summarizes total connections and license units consumed by clients attached to this Cache instance and the total number of license units shared by clients on this Cache server instance with connections by the same client to other Cache server instances. This report is identical to that produced by dumpserver^%SYS.LICENSE.
final classmethod DumpServers()
Dump License Server database for all servers.
Note: Not applicable with a Single-Server key.

This report presents license usage by each Cache instance served by the license server. The report is produced by the license server and may reside on a remote host. The location (host and directory) of the output file will be displayed on the terminal when the report is complete. License use by client (License Id) is reported in these columns:
  • Connections: Number of connections for this client.
  • License Units: Number of license units consumed by this client on this server.
  • Client: License Id consuming the license unit or units.
The report summarizes total connections and license units consumed by clients connected to each Cache instance and the number of license units shared by clients connected to this Cache server instance with connections from the same client to other Cache server instances. A combined grand total of connections and license units consumed by all Cache server instances served by the license server is reported. This report is identical to that produced by dumpservers^%SYS.LICENSE.
final classmethod GetAppLicense(AppName As %String, GetValues As %Integer = 0) as %String
$SYSTEM.License.GetAppLicense(AppName) retrieves the application license for the named application as a string of Keyword=Value pairs separated by $c(0), terminated by an empty $C(0) piece. AppName is of the form Company.Application for protected application license sections or Application for unprotected application license sections or the TrakCare application.
If GetValues is zero, only the keyword names are returned. If GetValues is not zero, a sequence of kw=value are returned.

Example: $SYSTEM.License.GetAppLicense("MyCompany.MyApp",1)

Example return value: "kw1=value1"_$c(0)_"kw2=value2"_$c(0)_..._"kwN=valueN"_$c(0)_$c(0)
final classmethod GetAppLicenseFree(AppName As %String, FeatureKeyword As %String) as %String
$SYSTEM.License.GetAppLicenseFree(AppName,Keyword) retrieves the number of free license units associated with an application license feature keyword. AppName is of the form Company.Application for protected application license sections or Application for unprotected application license sections. Keyword is the keyword of the application feature.
GetAppLicenseFree() is only meaningful where the value associated with the keyword is numeric.
An INVALID ARGUMENT error is returned if no application license is loaded for "AppName". An empty string is returned if "Keyword" is not a feature of "AppName".

Example: $SYSTEM.License.GetAppLicenseFree("MyCompany.MyApp","MyAppFeature")
final classmethod GetAppLicenseMin(AppName As %String, FeatureKeyword As %String) as %String
$SYSTEM.License.GetAppLicenseMin(AppName,Keyword) retrieves the minimum number of free license units associated with an application license keyword. AppName is of the form Company.Application for protected application license sections or Application for unprotected application license sections. Keyword is the keyword of the application feature.
GetAppLicenseMin() is only meaningful where the value associated with the keyword is numeric.
An INVALID ARGUMENT error is returned if no application license is loaded for "AppName". An empty string is returned if "Keyword" is not a feature of "AppName".

Example: $SYSTEM.License.GetAppLicenseMin("MyCompany.MyApp","MyAppFeature")
final classmethod GetAppLicenseUsed(AppName As %String, FeatureKeyword As %String) as %String
$SYSTEM.License.GetAppLicenseUsed(AppName,Keyword) retrieves the number of consumed license units associated with an application license keyword.
AppName is of the form Company.Application for protected application license sections or Application for unprotected application license sections. Keyword is the keyword of the application feature.
GetAppLicenseUsed() is only meaningful where the value associated with the keyword is numeric.
An INVALID ARGUMENT error is returned if no application license is loaded for "AppName". An empty string is returned if "Keyword" is not a feature of "AppName".

Example: $SYSTEM.License.GetAppLicenseValue("MyCompany.MyApp","MyAppFeature")
final classmethod GetAppLicenseValue(AppName As %String, FeatureKeyword As %String) as %String
$SYSTEM.License.GetAppLicenseValue(AppName,Keyword) retrieves the value associated with an application license keyword.
AppName is of the form Company.Application for protected application license sections or Application for unprotected application license sections. Keyword is the keyword of the application feature.
An INVALID ARGUMENT error is returned if no application license is loaded for "AppName". An empty string is returned if "Keyword" is not a feature of "AppName".

Example: $SYSTEM.License.GetAppLicenseValue("MyCompany.MyApp","MyAppFeature")
classmethod GetAppNames(AppTypes As %String) as %List
$SYSTEM.License.GetAppNames(AppTypes) returns a list of licensed applications.
AppTypes is a string containing the type[s] of licensed applications which should be returned.
  • "I": Return InterSystems supplied applications.
  • "P": Return protected applications loaded from the cache.key file.
  • "U": Return unprotected applications loaded with the $SYSTEM.License.LoadAppLicenseFile() method.
Set Applications=$SYSTEM.License.GetAppNames("PU") ;Fetch all non InterSystems licensed application names.
classmethod GetConnectionLimit() as %Integer
$SYSTEM.License.GetConnectionLimit() returns the maximum number of connections permitted per user on this instance. The limit is established by calling $SYSTEM.License.SetConnectionLimit(). A zero return value means no limit has been set.
classmethod GetFeature() as %Integer
$SYSTEM.License.GetFeature(n) returns 1 if extended license feature n is authorized by the license key, 0 if it is not.

Current values of n are:
0) Web license
1) Ensemble
2) Shadow add on
3) BI user (runtime)
4) BI development
5) HealthShare
6) BitTrakCare
7) IPNeutral
8) DeepSeeRun
9) DeepSeeAnalyze
10) DeepSeeModel
11) iKnow
12) HealthShare Foundation
13) C-Type license
14) DeepSee Visual Reporting Execute
15) ExtremeNoUserLimit
16) DeepSee Visual Reporting Format Definition
17) DeepSee Visual Reporting Data Definition
18) Shard Master Server
19) Shard Worker Server
final classmethod GetKeyInvalidReason()
Fetch string describing the reason the key is invalid or in a troubled state.
final classmethod GetKeyStatus()
Fetch license key status: Valid, Invalid, or Troubled (expiring).
classmethod GetUserId(PID As %String, JobNumber As %String) as %String
$SYSTEM.License.GetUserId() returns the License User Identifier (if any) associated with the currently executing session/process. It is possible that the value of UserIdentifier is "", which indicates that the session/process is running in a degraded state (as will be the case when no license has been taken out automatically for the session/process by Caché).

$SYSTEM.License.GetUserId(PID) returns the License User Identifier associated with the process with the input Process Id.

This method also allows a second argument of JobNumber (the index into the job table), e.g. $SYSTEM.License.GetUserId("",JobNumber). This can be faster than using Process Id if you already have the JobNumber (repeated calls for a single process), or are sequentially accessing all the processes on the system. Note the first argument must be "", and is ignored in this case.
classmethod GetUserLimit() as %Integer
$SYSTEM.License.GetUserLimit() returns the maximum number of license units the current instance will permit to be consumed. This is the limit established by a prior call to $SYSTEM.License.SetUserLimit(maxusers) or the number of license units authorized by the license key if no reduced limit has been established.
classmethod InstanceConnections()
$System.License.InstanceConnections() - return current count of connections to instance.
classmethod InstanceConnectionsMax()
$System.License.InstanceConnectionsMax() - return maximum concurrent connections to instance since it restarted or the maximum was reset.
classmethod IsAppLicensed(AppName As %String, FeatureKeyword As %String) as %Integer
##class(%SYSTEM.License).IsAppLicensed(AppName) returns 1 if the application named AppName is licensed, otherwise 0.
##class(%SYSTEM.License).IsAppLicensed(AppName,FeatureKeyword) returns 1 if the feature named FeatureKeyword is licensed for the application named AppName, otherwise 0.

AppName is of the form Company.Application for protected application license sections or Application for unprotected application license sections. The license may have been loaded as part of the cache.key file or separately using $system.License.LoadAppLicenseFile()

Example: $SYSTEM.License.IsAppLicensed("MyCompany.MyApp","MyAppFeature")
classmethod IsPendingActivation() as %Integer
Answers the question: Is a there a valid license key in the mgr directory that is not loaded. Restart may or may not be required. ##class(%SYSTEM.License).IsPendingActivation() returns 1 if the cache.key file in the "mgr" directory is valid but is not the active license key.

##class(%SYSTEM.License).IsPendingActivation() returns 0 if the cache.key file in the "mgr" directory is the active license key or if no cache.key file exists in the "mgr" directory or if the key in "mgr" is invalid.
classmethod IsValidKey(PathAndFileName As %String, ByRef RequiresRestart As %Integer, ByRef RestartReason As %String) as %Status
Determine whether the input cache key file is valid and if an instance restart will be required to activate it.

Arguments:
PathAndFileName: (In) Full path to cache.key file.
RequiresRestart: (Out) 1 if instance restart is required to activate key, 0 if not.
RestartReason: (Out) Reason restart is required, or "" if restart is not required.

Return value:
$$$OK - key is valid for this platform.
Or, error status with explanation of why the key is not valid for this platform.
classmethod KeyAuthorizationKey() as %String
$SYSTEM.License.KeyAuthorizationKey() returns the AuthorizationKey field in the active key.
classmethod KeyCPUsEnforced() as %Integer
$SYSTEM.License.KeyCPUsEnforced() returns the licensed CPUs code enforced by the active key. This CPU code is converted to an authorized core count by an algorithim that depends on other aspects of the licensed product. This number may be higher than the CPUs licensed code if an adjustment has been made in the license key to accomodate a CPU counting issue.
classmethod KeyCPUsLicensed() as %Integer
$SYSTEM.License.KeyCPUsLicensed() returns the licensed CPUs code authorized by the active key. This CPU code is converted to an authorized core count by an algorithim that depends on other aspects of the licensed product.
classmethod KeyCoresEnforced() as %Integer
$SYSTEM.License.KeyCoresEnforced() returns the number of Cores enforced by the active key. This may be higher than the number of Cores licensed if an adjustment has been made in the license key.
classmethod KeyCoresLicensed() as %Integer
$SYSTEM.License.KeyCoresLicensed() returns the number of Cores authorized by the active key. Cache will not accept a key with a given Cores authorization when running on a host with more cores.
classmethod KeyCustomerName() as %String
$SYSTEM.License.KeyCustomerName() returns the active key CustomerName field.
classmethod KeyEnforcedUnits() as %Integer
$SYSTEM.License.KeyEnforcedUnits() returns the number of license units enforced by the active key.
classmethod KeyExpirationDate() as %Integer
$SYSTEM.License.KeyExpirationDate() returns the active key expiration date as an integer, $H date value. Use $ZDATE to convert this to readable form.
classmethod KeyFeatures() as %String
$SYSTEM.License.KeyFeatures() returns the Features portion of the Authorization field in the active key.
classmethod KeyFileType(IncludeKeyword As %Integer = 0) as %String
$SYSTEM.License.KeyFileType(IncludeKeyword) returns the FileType property of the [ConfigFile] section of the loaded license key. If the IncludeKeyword argument is 1, the property keyword (FileType=) is included. If IncludeKeyword is 0, the property keyword is not included. For example, $SYSTEM.License.KeyFileType(1) might return "FileType=License 2013.1" while $SYSTEM.License.KeyFileType(0) would return "License 2013.1". The default value of IncludeKeyword is 0.
classmethod KeyLicenseCapacity() as %String
$SYSTEM.License.KeyLicenseCapacity() returns the active key LicenseCapacity field.
classmethod KeyLicenseType() as %String
$SYSTEM.License.KeyLicenseType() returns the active key license type (example: Concurrent User).
classmethod KeyLicenseUnits() as %Integer
$SYSTEM.License.KeyLicenseUnits() returns the number of license units authorized by the active key.
classmethod KeyMachineID() as %String
$SYSTEM.License.KeyMachineID() returns the contents of the MachineID field in the active key.
classmethod KeyOrderNumber() as %Integer
$SYSTEM.License.KeyOrderNumber() returns the active key order number.
classmethod KeyPlatform() as %String
$SYSTEM.License.KeyPlatform() returns the active key licensed platform.
classmethod KeyProduct() as %String
$SYSTEM.License.KeyProduct() returns the active key product (example: Enterprise).
classmethod KeyServer() as %String
$SYSTEM.License.KeyServer() returns the active key server type licensed (Single or Multi).
classmethod KeyVersion() as %String
$SYSTEM.License.KeyVersion() returns the version from the FileType property of the [ConfigFile] section of the loaded license key. For example, if the [ConfigFile] section containes "FileType=License 2013.1", $SYSTEM.License.KeyVersion() returns 2013.1.
classmethod LUAvailable() as %Integer
$SYSTEM.License.LUAvailable() returns number of license units currently available at the local Cache instance.
classmethod LUConsumed() as %Integer
$SYSTEM.License.LUConsumed() returns number of license units currently consumed at the local Cache instance.
classmethod LUMaxConsumed() as %Integer
$SYSTEM.License.LUMaxConsumed() returns the maximum number of license units consumed at the local Cache instance since it started. This value is the high water mark of license consumption on the local Cache instance.
classmethod LUMaxConsumedReset() as %Integer
$SYSTEM.License.LUMaxConsumedReset([Argument]) resets the recorded peak levels of various measures of license use by setting the internal counters to the current usage level and returns the previously recorded maximum count. The usage counts are local to the Cache instance and represent maximum usage since the instance started or the counter was last reset.
Arguments
  • No Argument: Resets maximum license units consumed as returned by $SYSTEM.License.LUMaxConsumed() and the maximum connection count as returned by $SYSTEM.License.MaxConnections() to the current usage levels. The previously recorded $SYSTEM.License.LUMaxConsumed() value is returned.
  • Argument = "Users": Resets maximum license units consumed as returned by $SYSTEM.License.LUMaxConsumed() to the current usage level. The previously recorded $SYSTEM.License.LUMaxConsumed() count is returned.
  • Argument = "Connections": Resets maximum concurrent connections, as returned by $SYSTEM.License.InstanceConnectionsMax() to the current usage level. The previously recorded $SYSTEM.License.InstanceConnectionsMax() is returned.
  • Argument = "CSPUsers": Resets maximum concurrent CSP Users, as returned by $SYSTEM.License.MaxCSPUsers() to the current usage level. The previously recorded $SYSTEM.License.MaxCSPUsers() is returned.
  • Argument = "Processes": Resets maximum concurrent licensed process count, as returned by $SYSTEM.License.ProcMaxConsumed() to the current usage level. The previously recorded $SYSTEM.License.ProcMacConsumed() is returned.
  • Argument = "CSPGrace": Resets maximum concurrent number of CSP sessions in the "grace" period, as returned by $SYSTEM.License.MaxCSPGrace() to the current usage level. The previously recorded $SYSTEM.License.MaxCSPGrace() is returned.
  • Argument = "*": Resets all maximum license use counts to the current usage counts. The previously recorded $SYSTEM.License.LUMaxConsumed() is returned.
classmethod LUMinAvailable() as %Integer
$SYSTEM.License.LUMinAvailable() returns the minimum number of license units available at the local Cache instance since it started. This value is the low water mark of license availability on the local Cache instance.
classmethod LicenseCount(UserIdentifier As %String) as %Integer
$SYSTEM.License.LicenseCount() returns the number of License Units currently consumed on the local instance by the given UserIdentifier. The return value is usually 0 if the UserIdentifier is not licensed or 1 if it is. However, if the maximum number of connections has ever exceeded MAXCONNECTIONS (the maximum allowed number of concurrent connections for a single license) for this UserIdentifier, the system has transitioned to a mode of one license per connection for this UserIdentifier and the return value will be the current number of connections by UserIdentifier.
classmethod LoadAppLicenseFile(FileName As %String, AppName As %String) as %Integer
$SYSTEM.License.LoadAppLicenseFile(FileName,SectionName)
Load a license for the named application into instance memory. The file is in standard .ini file format and the application license is contained in a section beginning with [SectionName], where 'SectionName' is the name of the application licensed by the section. The SectionName value is case sensitive and can contain as many as 47 alphanumeric characters. It cannot contain a period. Features licensed are authorized by properties in the application section represented as keyword=value pairs. Keywords are case sensitive and can contain as many as 47 alphanumeric characters. The total length of keyword=value cannot exceed 255 characters. Licensed items with a numeric value are counted by the license software (see TakeApplicationLicense() and ReturnApplicationLicense()). Licensed items with a text value can be retrieved with GetAppLicenseValue(AppName,FeatureKeyword). The entire application license can be retrieved with GetAppLicense(AppName,getvalues). An application license section can contain 16536 characters including a terminating NULL character appended internally to each keyword=value line.

Example application license section:

[MyApplication]
Concurrent Users=50
LabTech=20
Supervisor=3
Nurse=50
Modules=Lab, Radiology, Billing, Pharmacy

Arguments:
FileName: file name, including path. Max 1024 characters.
AppName: application name, the section name containing the application license. Max 47 characters.

Return Values:
0 = success
1 = no file or no section or section is empty or malformed
2 = profile section too large
4 = cannot allocate (shared) memory for table;
5 = keyword or value too long
6 = Application name too long.

Example: $SYSTEM.License.LoadAppLicenseFile("c:\InterSystems\Licenses\MyLicense.key","MyApplication")
classmethod Login(UserIdentifier As %String) as %Integer
$SYSTEM.License.Login(UserIdentifier) performs a license login.

To acquire a license for a particular connection, provide a UserIdentifier (%String). UserIdentifier can be an arbitrary identifier determined by the application, but it must uniquely identify the user connecting to Cache. The client IP address will be appended to the identifier provided separated by an "@" sign to form the complete license identifier. If the input string contains an '@' character, the string will be truncated and the client IP address wil be appended following the first '@' character. The UserIdentifier cannot contain the '|' character. If the '|' character is found, it will be replaced with the forward slash ('/') character. The total length of UserIdentifier can be no more than 64 characters including the '@' character and the IP address appended by the system. If the input UserIdentifier exceeds 64 characters, $SYSTEM.License.Login will return an ILLEGAL VALUE error.

This function will relinquish a license if the session/process is already holding one under a different identifier and it will obtain a new one on the behalf of the user ID provided.

If the MAXCONNECTIONS connection limit per user is exceeded, the usual transition to one-license-unit-per-connection will apply to this user identifier.

If a failure occurs because no additional license units are available, the session/process will revert to the original license state and the function will return 0. If the call is successful it will return a positive integer which is the number of connections currently associated with "UserIdentifier@ClientIP" (including the one just consumed).

classmethod MaxBufferPool() as %Integer
$$SYSTEM.License.MaxBufferPool() returns the maximum buffer pool size authorized by the active license key. Zero indicates unlimited.
classmethod MaxCSPGrace() as %Integer
$SYSTEM.License.MaxCSPGrace() returns the maximum number of CSP sessions in the grace period at any time since the instance started or the CSPGrace maximum counter was reset.
classmethod MaxCSPUsers() as %Integer
$SYSTEM.License.MaxCSPUsers() returns the maximum number of concurrent CSP users since the instance started or the CSPUsers maximum counter was reset.
classmethod MaxConnections() as %Integer
$SYSTEM.License.MaxConnections() returns the maximum number of connections a user can make while consuming one license unit.
classmethod MaxDB() as %Integer
$SYSTEM.License.MaxDB() returns the maximum number of non-system Databases authorized by the active license key. Zero indicates unlimited.
classmethod MaxECPServers() as %Integer
$SYSTEM.License.MaxECPServers() returns the maximum number of ECP servers authorized by the active license key.
classmethod NetworkEnabled() as %Integer
$SYSTEM.License.NetworkEnabled() returns 1 if the Cache license key enables ECP, 0 if it doesn't.
classmethod ProcAvailable() as %Integer
$SYSTEM.License.ProcAvailable returns the number of additional processes that are authorized to be started in the current Cache instance. (Applicable only with license types that restrict the number of processes.)
classmethod ProcConsumed() as %Integer
$SYSTEM.License.ProcConsumed returns the number of Cache User processes currantly running in the current Cache instance.
classmethod ProcMaxConsumed() as %Integer
$SYSTEM.License.ProcMaxConsumed returns the maximum number of Cache User processes running concurrently since the instance started.
classmethod ProcMinAvailable() as %Integer
$SYSTEM.License.ProcMinAvailable returns the minimum number of additional processes available at any time since the instance started. (Applicable only with license types that restrict the number of processes.)
classmethod PublicWebAppUser() as %Integer
$SYSTEM.License.PublicWebAppUser declares an application to be a public web application for the purpose of a Web Add-on license. This system method requires that the active license key be a Real Time license or have the Web Add-on feature enabled. The return value is 1 on success, 0 on failure. Failure indicates the license key does not support this option. The PublicWebAppUser system method must be called from the OnStartSession method of the Session Events class defined for the CSP application as follows:

    1) Create a subclass of the %CSP.SessionEvents class and define a method to handle the OnStartSession event. Call $system.License.PublicWebAppUser() in the OnStartSession class method.

    2) Define this class as the Event Class for the CSP application.

    Management Portal -> System Administration -> Security -> Applications -> Web Applications

    Enter the %CSP.SessionEvents subclass in the " Event Class:" box.

    3) Insure that "Unauthenticated" is checked for "Allowed Authentication Methods".

    Example: The following code could be placed in ClassMethod OnStartSession of the class extending %CSP.SessionEvents that acts as the session event handler for the public application.
      try { s x=$system.License.PublicWebAppUser() } catch { /* log error */ }
      q $$$OK
      
classmethod PublicWebAppUserCount() as %Integer
$SYSTEM.License.PublicWebAppUserCount returns the current number of public web application connections active.
classmethod PublicWebAppUsersMax() as %Integer
$SYSTEM.License.PublicWebAppUsersMax() returns the maximum number of public web application connections active at any one time.
classmethod ReadDurationCounts() as %List
$SYSTEM.License.ReadDurationCounts() returns the number of times a logout occurred within the time indicated by the corresponding ReadDurationValues. The values are returned as a list. $ListLength is currently 6.
classmethod ReadDurationValues() as %List
$SYSTEM.License.ReadDurationValues() returns the upper limit in seconds each histogram bucket represents. The values are returned as a list with 5 elements. The sixth value is not provided because there is no upper limit. Returning time bucket values in a list permits the number of buckets and their values to be changed in the future with little impact on the code.
classmethod ReturnAllCSPApps(session As %CSP.Session) as %Status
$System.License.ReturnAllCSPApps(SessionId)
Called by the CSP Daemon when it deletes a session object.
classmethod ReturnApplicationLicense(AppName As %String, FeatureKeyword As %String = "Concurrent Users", ByRef Released As %Integer, session As %CSP.Session) as %Status
$SYSTEM.License.ReturnApplicationLicense(AppName,FeatureKeyword,.released,session)
Return (release) a license unit for an application license and feature. The license feature value must be numeric in the application license section. Releases the license resource associated with the licensed user Id of the current process, or the session license Id in the case of CSP.

Arguments:
AppName: The 'Company.Application' value from the section name in cache.key for protected application license sections, or the name of the unprotected application license section loaded with LoadAppLicenseFile().

FeatureKeyword: The application feature keyword being released. If the FeatureKeyword is omitted, the default value is "Concurrent Users".

Released: Returns 1 if the license was released, 0 if the license was not held.

session: The CSP session Id this application license should be taken for if the application license is being taken for a session, not the current process. If this argument is not present and %session is defined and is a %CSP.Session object, then the application license will be taken for the %session object. If neither the session argument nor the %session variable is defined, the license is taken for the current process.

Return value: $$$OK, or error status.
An error status containing an INVALID ARGUMENT error will be returned if no license has been loaded for AppName.

Example: $SYSTEM.License.ReturnApplicationLicense("MyCompany.MyApp","MyAppFeature"[[,.Released[, session]])
classmethod SetConnectionLimit(MaxCon As %Integer) as %Integer
$SYSTEM.License.SetConnectionLimit establishes the maximum number of connections permitted per user on this instance. This enables a system administrator to prevent a user from making so many connections to a Cache instance that they consume all available license units. Calling $SYSTEM.License.SetConnectionLimit($SYSTEM.License.MaxConnections()) permits a user to make the maximum connections permitted but prevent transitioning to the license unit per connection state, insuring the user will consume no more than one license unit. A zero argument removes the limit. The failure to obtain a license will be indicated in the normal way. For example, a call to $system.License.Login() will return zero (0) while a failure to log in to a new terminal connection will receive a error. However, these license failures will not be reported in the console log. The method returns the former maximum value.

The limit applies only to the local instance. If a Cache MultiServer license is shared among several instances it is still possible to exceed $SYSTEM.License.MaxConnections() over all instances. This can be avoided by setting the limit low enough on each instance that the combined connections to all instances will be unlikely to exceed $SYSTEM.License.MaxConnections().

$SYSTEM.License.SetConnectionLimit reqires access to the %Admin Manage resource. It is suggested that customers call this API from SYSTEM^%ZSTART.
classmethod SetUserLimit(MaxLU As %Integer) as %Integer
$SYSTEM.License.SetUserLimit establishes the maximum number of license units that this Cache instance will consume. This permits a system manager to prevent a Cache instance from consuming all the license units in a MultiServer key shared among multiple Cache instances. The Method returns the former maximum value. In the absence of a call to $SYSTEM.License.SetUserLimit(max) a Cache instance may consume all available license units.

Reqires access to the %Admin Manage resource.
final classmethod ShowCounts()
Display Local view of license use.

This report summarizes information derived from the current Cache instance's local license utilization database.
  • Total Authorized LU: license units authorized by the installed cache.key file.
  • Current Available LU: License units available at the local Cache instance.
  • Minimum Available LU: Minimum number of license units availible since the local instance started.
  • Current Users active: Number of distinct users logged in to the local instance. May be less than the difference between total authorized and current available license units if one or more users have exceeded MaxConnections.
  • Maximum Users active: Maximum number of distinct users logged in to the local instance at any time since it started.
  • Current CSP Users active: Current number of CSP sessions consuming license units at the local Cache instance.
  • Maximum CSP Users active: Maximum number of CSP sessions consuming license units at any time since the local Cache instance started.
  • Current CSP Sessions in grace period: Current number of CSP sessions in grace period on the local Cache instance.
  • Maximum CSP Sessions in grace period: Maximum number of CSP sessions in grace period at any time since the local Cache instance started.

This report is identical to the report produced by counts^%SYS.LICENSE. It presents the results of the %SYSTEM.License.Counts query.
final classmethod ShowServer()
Display current active license Server address and port.
Note: Not applicable with a Single-Server key.
This report is identical to the report produced by ShowServer^%SYS.LICENSE.
final classmethod ShowSummary()
Display Summary of License Server Database.
Note: Not applicable with a Single-Server key.

Displays a summary of license use for the current Cache instance's active license key. The report displays license usage data obtained both from the license server and from the local Cache instance.

The distributed license use section summarizes license use by all Cache instances that share the key. The license server is the source of this information.
  • Current License Units Used: current number of license consumed by all Cache instances sharing this key.
  • Maximum License Units Used: maximum number of license consumed by all Cache instances sharing this key at any time since the license server started.
  • License Units Authorized: number of license units authorized by the installed license key file.
The local license use section summarizes license use by the Cache instance where the report is run. The source of this section is the local Cache instance's internal license use tables.
  • Current Connections: The current number of connections (license logins) to the local Cache instance.
  • Maximum Connections: The maximum number of connections (license logins) to the local Cache instance since it started.
  • Current Users: The current number of license units consumed on the local Cache instance. Note that this item displays license units, not distict users.
  • Maximum Users: The maximum number of license units consumed on the local Cache instance since it started.
This report is identical to the report produced by ShowSummary^%SYS.LICENSE. It presents the results of the %SYSTEM.License.ShowSummary query.
classmethod TakeApplicationLicense(AppName As %String, FeatureKeyword As %String = "Concurrent Users", ByRef Count As %Integer, session As %CSP.Session) as %Status
$SYSTEM.License.TakeApplicationLicense(AppName,FeatureKeyword,.count,session)
Take (consume) a license unit for a named application and feature. The license feature value must be numeric in the loaded application license section. The Cache license user Id of the current process (or in the case of CSP, the session license Id) will be the user identifier associated with the application license consumed.

Arguments:

AppName: The 'Company.Application' value from the section name in cache.key for protected application license sections, or the name of the unprotected application license section loaded with LoadAppLicenseFile().

FeatureKeyword: The application keyword being consumed. If the FeatureKeyword is omitted, the default value is "Concurrent Users".

Count: ByRef argument to receive count of the number of times this user has now taken this application/keyword license.

session: The CSP session Id this application license should be taken for if the application license is being taken for a session, not the current process. If this argument is not present, a %session variable is defined and is a %CSP.Session object, then the application license will be taken for the %session object. If neither the session argument nor the %session variable is defined, the license is taken for the current process.

Return value: $$$OK, or error status.
An error status containing an INVALID ARGUMENT error will be returned if AppName is not licensed.
An error status, ERROR #5915: Cannot allocate a license, if the feature is not licensed or its capacity is exhausted.

An application license can be returned with the $SYSTEM.License.ReturnApplicationLicense(AppName, FeatureKeyword[[, .Count[, session]]) method. All application licenses taken for a process or a CSP session will be returned automatically when the process exits or the CSP session terminates.

Example: $SYSTEM.License.TakeApplicationLicense("MyCompany.MyApp","MyAppFeature",.NewCountTaken)
final classmethod Upgrade() as %String
Upgrade to a license (cache.key file) that has been copied to the mgr directory. In some cases the license key will not be upgraded or may be incompletely upgraded. Upgrades may not activate all additional license units if they are unable to allocate sufficient memory from the shared memory heap. Upgrades to a key with fewer license units will be deferred until the Cache instance is restarted. Upgrades to or from a "Power Unit" key will be deferred until the Cache instance is restarted.
Return value is 1 on success, "0|Reason for failure" on failure.
The failure message may refer you to cconsole.log for additional information.
classmethod UserNameLicensing(OnOffState As %Integer) as %Integer
Modify how the License User Identifier is specified. By default, the client IP address is used to identify a user to the Cache license tracking subsystem. If the Cache is installed with the normal security level, each process will be have a user identity ($username). The $SYSTEM.License.UserNameLicensing system method can be called to make the Cache license subsystem use $username as the license user identifier. The client IP address will be appended to $Username separated by an "@" sign to form the complete license identifier.

$SYSTEM.License.UserNameLicensing modifies the system state. It can be called from SYSTEM^%ZSTART to enable user name licensing at instance startup.

$SYSTEM.License.UserNameLicensing(1) enables $username based licensing and returns the previous state.
$SYSTEM.License.UserNameLicensing(0) disables $username based licensing and returns the previous state.
$SYSTEM.License.UserNameLicensing() returns the current state.

$SYSTEM.License.UserNameLicensing() returns an error if called with an argument with RealTime or Web Add-On keys because these license types use special login rules.

Queries

query ActiveServerList()
Selects Address As %String, InstanceName As %String, OrderNumber As %String
The ActiveServerList query returns all Active Cache instances served by the license server.

The Address field contains the IP address of the host where the instance is running.
The Instance field contains the instance name.
The OrderNumber field contains the OrderNumber field of the License key the Instance is using.

The data source is the license server.
query AllKeyConnectionList()
Selects UserId As %String, LicenseUnits As %String, Connections As %String, ServerIP As %String, Instance As %String, OrderNumber As %String
The AllKeyConnectionList query returns a list of active connections consuming license units from all keys maintained by the license server.

The UserId field contains the License User Id of the entity consuming one or more license units.
The LicenseUnits field contains the number of license units consumed. This can be a number, or the string "shr", indicating that the connection shares a license unit with another connection by the same License UserId.
The Connections field contains the number of connections the UserId entity has made to the Cache server.
The ServerIP field contains the address of the Cache server to which the connection was made.
The Instance field contains the name of the Cache instance to which the connection was made.

The data source is the license server.
query ApplicationUserList()
Selects UserId As %String, Type As %String, Connects As %Integer, MaxCon As %Integer, CSPCon As %Integer, LU As %Integer, Active As %Integer, Grace As %Integer, AppLicenses As %List
This query is similar to the UserList query, but it returns the Application license usage in an additional column as a list.
It accepts two parameters in %ResultSet.Execute.
AppName: The 'Company.Application' value from the section name in cache.key for protected application license sections, or the name of the unprotected application license section loaded with LoadAppLicenseFile().
ShowCounts: If 1, the taken keywords will be returned as KeywordName=TimesTaken in the AppLicenses field. If zero, only the KeywordName will be returned for taken keywords.
The UserId field contains the License Login UserId. The Type field contains the login type and is one of the following:

  • User - Regular user login
  • CSP - Cache Server Page login
  • Mixed - Regular user plus Cache Server Page login
  • Grace - Logged out CSP session waiting for grace period to expire.
Connects is the number of connections to this Cache instance by the user represented by UserId.

MaxCon is the maximum number of concurrent connections to this Cache instance by the user represented by UserId.

CSPCon is the number of CSP sessions open to this Cache instance by the user represented by UserId.

LU is the number of License Units consumed on this Cache instance by the user represented by the UserId.

Active is the time in seconds the UserId has been logged in to this Cache instance.

Grace is the amount of time this license unit will remain in the grace period if all connections were closed immediately.

AppLicenses is a list of Application license features held by the UserId. The data source is the local Cache instance.
query ConnectionAppList()
Selects UserId As %String, LicenseUnits As %String, Connections As %String, ServerIP As %String, Instance As %String, ApplicationUse As %String
The ConnectionAppList query returns a list of active connections consuming license units from the current key. It is identical to the ConnectionList query, with an additional field which contains applications that have been taken by the UserId on the ServerIP.
  • The UserId field contains the License User Id of the entity consuming one or more license units.
  • The LicenseUnits field contains the number of license units consumed. This can be a number, or the string "shr", indicating that the connection shares a license unit with another connection by the same License UserId.
  • The Connections field contains the number of connections the UserId entity has made to the Cache server.
  • The ServerIP field contains the address of the Cache server to which the connection was made.
  • The Instance field contains the name of the Cache instance to which the connection was made.
  • The ApplicationUse field contains the applications taken by the connection formatted as AppName,Feature;AppName,Feature;...;AppName,Feature.
The data source is the license server. The license server maintains counts of ISC.Appname license sections but does not manage other application license sections. Usage of other license sections can be examined with the ApplicationUserList query which returns license use for all applications on the current Cache instance.
query ConnectionList()
Selects UserId As %String, LicenseUnits As %String, Connections As %String, ServerIP As %String, Instance As %String
The ConnectionList query returns a list of active connections consuming license units from the current key.
  • The UserId field contains the License User Id of the entity consuming one or more license units.
  • The LicenseUnits field contains the number of license units consumed. This can be a number, or the string "shr", indicating that the connection shares a license unit with another connection by the same License UserId.
  • The Connections field contains the number of connections the UserId entity has made to the Cache server.
  • The ServerIP field contains the address of the Cache server to which the connection was made.
  • The Instance field contains the name of the Cache instance to which the connection was made.
The data source is the license server.
query Counts()
Selects InstanceLicenseUse As %String, License Units As %String
Query returns data displayed by ##class(%SYSTEM.License).ShowCounts()
  • Instance License Use: Text describing meaning of row data.
  • License Units: Value (count) described by text.
The data source is the local Cache instance.
query Decode()
Selects CapacityField As %String, Value As %String
Decodes the license capacity fields of the License Authorization field of the license key.
  • Capacity Field: Licensed capacity name.
  • License Units: Licensed capacity value.
The data source is the local Cache instance.
query Key(Sections As %Integer)
Selects Field As %String, Value As %String
This query returns the fields of the active license key.
  • Field: Text to the left of the '=' sign in the [License] section of the license key file.
  • Value: Value to the right of the '=' sign.
The value of the Sections argument filters what is returned.
  • 1 Return main license section [License].
  • 2 Return application license sections.
  • 3 Return all license sections.
The name of each application license section enclosed in square brackets will begin each section in the "Field" field with the "Value" field empty.

The data source is the local Cache instance.
query LicenseManager()
Selects AddressPort As %String, Value As %String
Returns the IP address and port of the active License Server. This information is not applicable for Single Server keys.

Note: Not applicable with a Single-Server key.
The data source is the local Cache instance.
query LicenseServerKeyList()
Selects LicenseCapacity As %String, CustomerName As %String, OrderNumber As %String, ExpirationDate As %String, AuthorizationKey As %String, MachineId As %String
The LicenseServerKeyList query returns all license keys maintained by the license server.
  • The LicenseCapacity field is the data to the right of "LicenseCapacity=" in the key file.
  • The CustomerName field is the data to the right of "CustomerName=" in the key file.
  • The OrderNumber field is the data to the right of "OrderNumber=" in the key file.
  • The ExpirationDate field is the data to the right of "ExpirationDate" in the key file.
  • The AuthorizationKey field is the data to the right of "AuthorizationKey" in the key file.
  • The MachineID field is the data to the right of "MachineID=" in the key file.
The data source is the license server.
query LoginDuration()
Selects Duration As %String, Count As %String
The LoginDuration query returns a histogram of the durations license unit consumption on the local instance.

The Duration field contains a duration of license unit consumption in seconds. The duration field is text suitable for display, not a number. The final row will be prefixed with a ">" sign to indicate that the duration of the row has no upper limit
The Count field contains the number of times a license unit was consumed for less than the corresponding Duration field. The Count field is not cumulative.

The data source is the local Cache instance.

Example:
  ;1) run query %SYSTEM.License.LoginDuration
  ;2) write the results to the current output device.
  Set rset=##class(%Library.ResultSet).%New("%SYSTEM.License:LoginDuration")
  If rset="" Write !,"Create Query failed" d DisplayError^%apiOBJ(%objlasterror) Quit
  Set status=rset.Execute()
  If $$$ISERR(status) Write !,"Execute Query failed:" Do DisplayError^%apiOBJ(status) Quit
  Set colcnt=rset.GetColumnCount()
  For i=1:1:colcnt Set colname(i)=rset.GetColumnName(i)
  Write !! For i=1:1:colcnt Write $j(colname(i),15)," "
  while rset.Next() {
     Write ! For i=1:1:colcnt Write $j(rset.GetData(i),15)," "
  }
  ;Results look like this:
  ;
  ;Testing %SYSTEM.License.LoginDuration query.
  ;      Duration           Count
  ;             1               0
  ;            15            7548
  ;            60            7261
  ;           900             260
  ;          3600               0
  ;        > 3600               0
  
query ProcessList(Filter As %String = "")
Selects PID As %Integer, DisplayPID As %String, Process As %String, LID As %String, Type As %String, Con As %Integer, MaxCon As %Integer, CSPCon As %Integer, LU As %Integer, Active As %Integer, Grace As %Integer
This query returns license usage for this Cache instance by Process.

The PID is the operating system Process Identifier.

The DisplayPID is display form for PID, it is hexadecimal value in VMS.

The Process field is one of the following process login types:
  • System - system processes that do not consume a license unit.
  • User - Regular user (terminal, ODBC, Cache Direct) login.
  • CSP - Cache Server Pages server process. A CSP server process does not maintain an association with an internal license table entry. The association is rather with the session. For this reason, information regarding number of connections, and license units is not available for CSP processes. Use the UserList query to obtain this information for CSP sessions.
  • Diagnostic - Process is logged in to Cache with the "-B" command line argument and is using the diagnostic license unit.
  • Server - A server process (eg the COMMCTRL process) which does not consume a license unit, but which creates jobs which do consume license units.
  • Pending - A process for which license acquisition is pending. Can occur when deferred license acquisition is in effect.
The LID field contains the License Login UserId for this process.

The Type field contains the License login type and is one of the following:
  • User - Regular user login
  • CSP - Cache Server Page login
  • Mixed - Regular user plus Cache Server Page login
  • Grace - Logged out CSP session waiting for grace period to expire.
Con is the number of connections to this Cache instance by the user represented by LID.

MaxCon is the maximum number of concurrent connections to this Cache instance by the user represented by UserId.

CSPCon is the number of CSP sessions open to this Cache instance by the user represented by UserId.

LU is the number of License Units consumed on this Cache instance by the user represented by the UserId.

Active is the time in seconds the UserId has been logged in to this Cache instance.

Grace is the amount of time this license unit will remain in the grace period if all connections were closed immediately.

The data source is the local Cache instance.
query Summary()
Selects LicenseUnitUse As %String, Local As %String, Distributed As %String
Query returns license usage summary as displayed by $System.License.ShowSummary

This represents the view of distributed and local license use maintained by the license server. Local and distributed Authorized, Current, and Maximum license unit usage levels are returned. Current and Maximum connections to the local Cache instance are returned.

Note: Not applicable with a Single-Server key.

The data source is both the local Cache instance and the license server.

Example:
  ;1) run query %SYSTEM.License.Summary and place results in:
  ;   headings(c) = heading_text for column c
  ;   data(r,c) = data for row r, column c
  ;2) write the results to the current output device.
  
  s Rset=##class(%ResultSet).%New("%SYSTEM.License.Summary")
  if 'Rset s status="Could not form query %SYSTEM.License.Summary." w !,status q
  s r=Rset.Execute()
  if r {
   s ncol=Rset.GetColumnCount()
   f i=1:1:ncol s headings(i)=Rset.GetColumnName(i)
   s nrec=0
   While (Rset.Next()) {
    s nrec=nrec+1
    s ncol=Rset.GetColumnCount()
    f i=1:1:ncol s data(nrec,i)=Rset.GetData(i)
   }
   d Rset.Close()
   s status=nrec_" entries added to array"
  }
  i 'r s status="Could not execute query %SYSTEM.License.Summary." w !,status q
  w !!,headings(1),?40,headings(2),?60,headings(3),!
  for i=1:1:nrec w !,data(i,1),?40,data(i,2),?60,data(i,3)
  q
  
query UserList(Filter As %String = "")
Selects UserId As %String, Type As %String, Connects As %Integer, MaxCon As %Integer, CSPCon As %Integer, LU As %Integer, Active As %Integer, Grace As %Integer
This query returns license use by User Id

The UserId field contains the License Login UserId. The Type field contains the login type and is one of the following:

  • User - Regular user login
  • CSP - Cache Server Page login
  • Mixed - Regular user plus Cache Server Page login
  • Grace - Logged out CSP session waiting for grace period to expire.
Connects is the number of connections to this Cache instance by the user represented by UserId.

MaxCon is the maximum number of concurrent connections to this Cache instance by the user represented by UserId.

CSPCon is the number of CSP sessions open to this Cache instance by the user represented by UserId.

LU is the number of License Units consumed on this Cache instance by the user represented by the UserId.

Active is the time in seconds the UserId has been logged in to this Cache instance.

Grace is the amount of time this license unit will remain in the grace period if all connections were closed immediately.

The data source is the local Cache instance.
query UserListAll()
Selects UserId As %String, Type As %String, Connects As %Integer, MaxCon As %Integer, CSPCon As %Integer, LU As %Integer, Active As %Integer, Grace As %Integer
This query returns all license slots by User Id, or free.

The UserId field contains the License Login UserId. The Type field contains the login type and is one of the following:

  • User - Regular user login
  • CSP - Cache Server Page login
  • Mixed - Regular user plus Cache Server Page login
  • Grace - Logged out CSP session waiting for grace period to expire.
Connects is the number of connections to this Cache instance by the user represented by UserId.

MaxCon is the maximum number of concurrent connections to this Cache instance by the user represented by UserId.

CSPCon is the number of CSP sessions open to this Cache instance by the user represented by UserId.

LU is the number of License Units consumed on this Cache instance by the user represented by the UserId.

Active is the time in seconds the UserId has been logged in to this Cache instance.

Grace is the amount of time this license unit will remain in the grace period if all connections were closed immediately.

The data source is the local Cache instance.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab