CountLogons([NoFilterLogons: Boolean = False]): Integer;
CountLogons(NoFilterLogons: boolean ): integer;
NoFilterLogons. Filtering conditions are not taken into account. Parameter is optional and can be set to:
True. By default. Access protocol will not be filtered, i.e. the number of all record about connections to repository (login) will be returned.
False. Access protocol will be filtered. Filtering conditions are defined by the IAuditFilter interface. The number of records about the connections to the repository taking into account the filtering is returned.
The CountLogons method returns the number of records about the connections to the repository (login) in the access protocol.
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(True) As 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: