Enum Class SessionMode

java.lang.Object
java.lang.Enum<SessionMode>
io.permazen.cli.SessionMode
All Implemented Interfaces:
Serializable, Comparable<SessionMode>, Constable

public enum SessionMode extends Enum<SessionMode>
Console Session modes.

The three SessionMode values correspond to the three layers of abstraction in Permazen. In order from bottom to top these are:

  • Enum Constant Details

    • KEY_VALUE

      public static final SessionMode KEY_VALUE
      Permazen key/value database mode.

      This is the lowest level CLI mode, where only the raw byte[] key/value store is available. This mode provides a KVTransaction, but no Transaction or PermazenTransaction.

      See Also:
    • CORE_API

      public static final SessionMode CORE_API
      Permazen Core API mode.

      Supports access to low level schema information, core API "objects" and fields, but no Java-specific operations. This mode provides a KVTransaction and Transaction, but no PermazenTransaction.

      Schema information may be provided either by a schema XML file or by @PermazenType-annotated Java model classes; however, in the latter case these classes will be otherwise ignored.

      In this mode, database objects are represented by ObjId's and enum values by EnumValue's.

    • PERMAZEN

      public static final SessionMode PERMAZEN
      Permazen Java mode.

      Provides database access through standard Java model objects and transaction access via PermazenTransaction. Requires and provides a Permazen instance and its associated Java model classes.

      In this mode, database objects are represented by Java model class instances and enum values by corresponding Java model Enum class instances.

  • Method Details

    • values

      public static SessionMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SessionMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • hasPermazen

      public boolean hasPermazen()
      Determine whether the Permazen Java API (e.g., PermazenTransaction) based on a Permazen instance is available in this mode.
      Returns:
      true if the Permazen Java API is available
    • hasCoreAPI

      public boolean hasCoreAPI()
      Determine whether the core API (e.g., Transaction) is available in this mode.
      Returns:
      true if the core API is available