IAuditLogArchiveCallback.OnProgress

Syntax

OnProgress(Current: Integer; Total: Integer);

OnProgress(System.Int32, System.Int32);

Parameters

Current. Number of processed records.

Total. Total number of records to be checked.

Description

The OnProgress method implements an event of common status of access protocol archiving. This method has to be redefined in a custom class.

Example

Executing the example requires the AuditLog.pplog file.

Add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.

Class MyCallback: Object, IAuditLogArchiveCallback
    
Sub OnProgress(Current: Integer; Total: Integer);
    
Begin
        Debug.WriteLine(
"Packed " + Current.ToString + " from " + Total.ToString + " records");
    
End Sub OnProgress;
End Class MyCallback;

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    AL: IAuditLog;
    Callback: MyCallback;
    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;
    Callback := 
New MyCallback.Create;
    
// Save access protocol to file
    AL.Archive("C:\AuditLog.pplog", Callback);
    
// Check in license
    Lic := Null;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;

Public Class MyCallback: Object, IAuditLogArchiveCallback
    
Public Sub OnProgress(Current: Integer; Total: Integer);
    
Begin
        System.Diagnostics.Debug.WriteLine(
"Packed " + Current.ToString() + " from " + Total.ToString() + " records");
    
End Sub OnProgress;
End Class MyCallback;
    
Public Class Program
    [STAThread]
    
Public Shared Sub Main(Params: StartParams);
    
Var
        MB: IMetabase;
        MS: IMetabaseSecurity;
        AL: IAuditLog;
        Callback: MyCallback;
        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();
        Callback := 
New MyCallback.Create();
        
// Save access protocol to file
        AL.Archive("C:\AuditLog.pplog", Callback, AuditLogArchiveFormat.alafBinary, False);
        
// Release license
        Lic := Null;
    
End Sub;
End Class;

After executing the example, access protocol records will be saved to the AuditLog.pplog file. Saving status is displayed in the development environment console.

See also:

IAuditLogArchiveCallback