public enum SessionMode extends Enum<SessionMode>
Session
modes.
The three SessionMode
values correspond to the three layers of abstraction in Permazen.
In order from bottom to top these are:
KVDatabase
and KVTransaction
and represented by KEY_VALUE
Database
and Transaction
and represented by CORE_API
Permazen
and JTransaction
and represented by PERMAZEN
Enum Constant and Description |
---|
CORE_API
Permazen Core API mode.
|
KEY_VALUE
Permazen key/value database mode.
|
PERMAZEN
Permazen Java mode.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasCoreAPI()
Determine whether the core API (e.g.,
Transaction ) is available in this mode. |
boolean |
hasPermazen()
Determine whether the Permazen Java API (e.g.,
JTransaction ) based on a Permazen
instance is available in this mode. |
static SessionMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SessionMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SessionMode KEY_VALUE
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 JTransaction
.
io.permazen.kv
public static final SessionMode CORE_API
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 JTransaction
.
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.
public static final SessionMode PERMAZEN
Provides database access through standard Java model objects and transaction access via JTransaction
.
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.
public static SessionMode[] values()
for (SessionMode c : SessionMode.values()) System.out.println(c);
public static SessionMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean hasPermazen()
JTransaction
) based on a Permazen
instance is available in this mode.public boolean hasCoreAPI()
Transaction
) is available in this mode.Copyright © 2022. All rights reserved.