Elektra 0.11.0
|
Represents a session with the Elektra key database. More...
Public Member Functions | |
void | close () throws KDBException |
Closes the KDB session and frees native resources associated with it. | |
void | close (Key warningsKey) throws KDBException |
Closes the KDB session and frees native resources associated with it. | |
KeySet | get (Key parentKey) throws KDBException |
Fetches at least all keys that are sub-keys or children of sub-keys of the supplied parent key. | |
KDB | get (KeySet keySet, Key parentKey) throws KDBException |
Fetches at least all keys that are sub-keys or children of sub-keys of the supplied parent key. | |
KDB | set (KeySet keySet, Key parentKey) throws KDBException |
Will update changed keys of the given keySet in the backend. | |
Static Public Member Functions | |
static KDB | open () throws KDBException |
Opens a new KDB session. | |
static KDB | open (KeySet contract) throws KDBException |
Opens KDB session using the specified contract @endiliteral. | |
static KDB | open (Key warningsKey) throws KDBException |
Opens a new KDB session. | |
static KDB | open (KeySet contract, Key warningsKey) throws KDBException |
Opens KDB session using the specified contract @endiliteral. | |
static KeySet | goptsContract (String[] args, String[] env, Key parentKey, KeySet goptsConfig) |
Creates a contract KeySet for use with KDB#open(KeySet) that mounts and configures the gopts plugin. | |
static void | goptsContract (KeySet contract, String[] args, String[] env, Key parentKey, KeySet goptsConfig) |
Writes a contract into a specified KeySet for use with KDB#open(KeySet) that mounts and configures the gopts plugin. | |
Protected Member Functions | |
Pointer | getPointer () |
Represents a session with the Elektra key database.
@apiNote Close after usage, or simply use a try-with-resources statement
|
inline |
Closes the KDB session and frees native resources associated with it.
KDBException | if opening the session fails - see specialization of KDBException |
KDBClosedException | if this session has already been closed |
|
inline |
Closes the KDB session and frees native resources associated with it.
warningsKey | Used to store warnings, which may occur during closing the session, in this key's meta data |
KDBException | if opening the session fails - see specialization of KDBException |
KDBClosedException | if this session has already been closed |
IllegalStateException | if parentKey has already been released |
IllegalArgumentException | if warningsKey is null |
|
inline |
Fetches at least all keys that are sub-keys or children of sub-keys of the supplied parent key.
Note: Resulting key set may contain more keys than requested
parentKey | Root key which name is used to fetch keys below. This key is also used to store warnings, which may occur during the operation, in this key's meta data. |
KeySet
containing the fetched keys KDBException | if loading keys fails - see specialization of KDBException |
KDBClosedException | if this session has already been closed |
IllegalStateException | if parentKey has already been released |
IllegalArgumentException | parentKey is null |
|
inline |
Fetches at least all keys that are sub-keys or children of sub-keys of the supplied parent key.
Note: Resulting key set may contain more keys than requested
keySet | KeySet used to store the fetched keys |
parentKey | Root key which name is used to fetch keys below it. This key is also used to store warnings, which may occur during the operation, in this key's meta data. It is recommended to use the most specific parentKey possible. (e.g. using is rarely the most specific) |
KDB
session, enabling a fluent interface KDBException | if loading keys fails - see specialization of KDBException |
KDBClosedException | if this session has already been closed |
IllegalStateException | if keySet or parentKey has already been released |
IllegalArgumentException | if keySet or parentKey is null |
|
inlineprotected |
KDBClosedException | if this KDB session has already been closed |
|
inlinestatic |
Writes a contract into a specified KeySet
for use with KDB#open(KeySet)
that mounts and configures the gopts
plugin.
contract | Key set to write the contract to |
args | Arguments that will be converted into argc and argv for |
env | Environment variables that gopts will use |
parentKey | Parent key that should be used by gopts . Only the key name is copied. The key can be deleted immediately after calling this function. |
goptsConfig | Config used for mounting the gopts plugin |
IllegalArgumentException | if any of the arguments are null |
IllegalStateException | if contract , goptsConfig or parentKey has already been released |
IllegalArgumentException | if any of the specified parameters is null |
|
inlinestatic |
Creates a contract KeySet
for use with KDB#open(KeySet)
that mounts and configures the gopts
plugin.
args | Arguments that will be converted into argc and argv for |
env | Environment variables that gopts will use |
parentKey | Parent key that should be used by gopts . Only the key name is copied. The key can be deleted immediately after calling this function. |
goptsConfig | Config used for mounting the gopts plugin |
KeySet
containing the contract IllegalArgumentException | if any of the arguments are null |
IllegalStateException | if goptsConfig or parentKey has already been released |
IllegalArgumentException | if any of the specified parameters is null |
|
inlinestatic |
Opens a new KDB session.
KDBException | if opening the session fails - see specialization of KDBException |
|
inlinestatic |
Opens a new KDB session.
warningsKey | Used to store warnings, which may occur during opening the session, in this key's meta data |
KDBException | if opening the session fails - see specialization of KDBException |
IllegalStateException | if warningsKey has already been released |
IllegalArgumentException | if warningsKey is null |
|
inlinestatic |
Opens KDB session using the specified contract @endiliteral.
contract | Contract configuring the gopts plugin |
KDBException | if opening the session fails - see specialization of KDBException |
IllegalStateException | if contract has already been released |
IllegalArgumentException | if contract is null |
|
inlinestatic |
Opens KDB session using the specified contract @endiliteral.
contract | Contract configuring the gopts plugin |
warningsKey | Used to store warnings, which may occur during opening the session, in this key's meta data |
KDBException | if opening the session fails - see specialization of KDBException |
IllegalStateException | if contract or warningsKey has already been released |
IllegalArgumentException | if contract or warningsKey is null |
|
inline |
Will update changed keys of the given keySet
in the backend.
get(Key)
or get(KeySet, Key)
has to be called before this function may be executed.
keySet | KeySet which contains keys to be updated in the backend |
parentKey | Specify which part of the given keySet is of interest for you. This key is also used to store warnings, which may occur during the operation, in this key's meta data. In general it is highly recommended, that you use the same parentKey used to fetch the keySet with get(Key) or get(KeySet, Key) . You promise to only modify or remove keys below this key. All others would be passed back as they were retrieved by keySet with get(Key) . Cascading keys (starting with / ) will set the path in all namespaces. A nameless key as created by Key#create() will commit all changes in the keySet . This parameter is an optimization to only save keys of mountpoints affected by the specified parentKey . This does not necessarily mean that only changes to keys below that parentKey are saved. |
KDB
session, enabling a fluent interface KDBException | if storing keys fails - see specialization of KDBException |
KDBClosedException | if this session has already been closed |
IllegalStateException | if keySet or parentKey has already been released |
IllegalArgumentException | if keySet or parentKey is null |