IAuditLog.CountLogons

Syntax

CountLogons([NoFilterLogons: Boolean = False]): Integer;

CountLogons(NoFilterLogons: boolean ): integer;

Parameters

NoFilterLogons. Filtering conditions are not taken into account. Parameter is optional and can be set to:

Description

The CountLogons method returns the number of records about the connections to the repository (login) in the access protocol.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Open access protocol
    Al := MS.OpenAuditLog;
    Debug.WriteLine(
"Record number about connection with repository: " + AL.CountLogons.ToString);
    Debug.WriteLine(
"Record number about operations in repository: " + AL.CountOperations.ToString);
    
// Check in license
    Lic := Null;
End Sub UserProc;

Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    MS := MB.Security;
    
// Open access protocol
    Al := MS.OpenAuditLog();
    System.Diagnostics.Debug.WriteLine(
"Record number about connection with repository: " + AL.CountLogons(TrueAs String);
    System.Diagnostics.Debug.WriteLine(
"Record number about operations in repository: " + AL.CountOperations(UInteger.MaxValue, UInteger.MaxValue) As String);
    
// Check in license
    Lic := Null;
End Sub;

After executing the example the console will display the number of records in access protocol about connection with repository (login) and the number of records about operations in repository.

See also:

IAuditLog