VaultOpen Event

Fires to open a new or existing callback mode vault.

Syntax

public class DefaultCbvaultEventListener implements CbvaultEventListener {
  ...
  public void vaultOpen(CbvaultVaultOpenEvent e) {}
  ...
}

public class CbvaultVaultOpenEvent {
  public String vault;
  public long vaultHandle;
  public int openMode;
  public boolean readOnly;
  public int resultCode;
}

Remarks

This event fires when the class wants to open the callback mode vault identified by Vault.

This event only needs to be handled if the CallbackMode property is enabled; please refer to the Callback Mode topic for more information. To handle this event properly, applications must open the vault identified by Vault, creating it if necessary based on the specified OpenMode, and return a handle to it in VaultHandle.

If the ReadOnly parameter is initially true, the application must open the vault in read-only mode. If ReadOnly is initially false, the application may choose whether to open the vault in read-only or read-write mode, and should update the ReadOnly parameter accordingly, if necessary.

If, for any reason, the vault cannot be opened in a manner consistent with the specified OpenMode, the application must set VaultHandle to -1 and return an appropriate error code via ResultCode.

The Vault parameter contains an application-defined vault identifier (name, file path, etc.). The value of this parameter will always match the current value of the VaultFile property.

The VaultHandle parameter is used to return some application-defined handle that uniquely identifies the opened vault. The class uses the returned handle to populate the VaultHandle parameters of the other Vault* events fired for the vault later.

The OpenMode parameter specifies what behavior to use when opening the vault. Valid values are:

CBFSSTORAGE_OM_CREATE_NEW0Creates a new vault if possible, failing if one already exists.

CBFSSTORAGE_OM_CREATE_ALWAYS1Creates a new vault, overwriting an existing one if necessary.

CBFSSTORAGE_OM_OPEN_EXISTING2Opens a vault if it exists; fails otherwise.

CBFSSTORAGE_OM_OPEN_ALWAYS3Opens a vault if it exists; creates a new one otherwise.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

 
 
Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Vault 2020 Java Edition - Version 20.0 [Build 7895]