IAuditLog.Archive

Syntax

Archive(FileName: String;

[Callback: IAuditLogArchiveCallback = Null];

[Format: AuditLogArchiveFormat = 0];

[ClearLog: Boolean = False]);

Archive(FileName: string;

Callback: Prognoz.Platform.Interop.Metabase.IAuditLogArchiveCallback;

Format: Prognoz.Platform.Interop.Metabase.AuditLogArchiveFormat;

ClearLog: boolean);

Parameters

FileName. File name.

Callback. Object that is used fro tracking the process of archiving of the access protocol.

Format. The file format which is used for saving.

ClearLog. Parameter that determines records removing from the access protocol after archiving. The False value was set by default, the access protocol is not cleared. If the True value is set, all records of the access protocol are removed after archiving.

Description

The Archive method archives the access protocol in the file.

Example

Executing the example requires the AuditLog.pplog file.

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;
    
// Save access protocol to file
    AL.Archive("C:\AuditLog.pplog");
    
// 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();
    
// Save access protocol to file
    AL.Archive("C:\AuditLog.pplog"Null, AuditLogArchiveFormat.alafBinary, False);
    
// Check in license
    Lic := Null;
End Sub;

After executing the example, access protocol will be saved to the AuditLog.pplog file.

See also:

IAuditLog