IAuditLog.CountLogons

Syntax

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

CountLogons(System.Boolean): System.Int32;

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 links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out 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.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Check out 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