DmtSession
interface. The session is associated with a root node which limits the
subtree in which the operations can be executed within this session.
Most of the operations take a node URI as parameter, which can be either an absolute URI (starting with "./") or a URI relative to the root node of the session. The empty string as relative URI means the root URI the session was opened with. All segments of a URI must be within the segment length limit of the implementation, and the special characters '/' and '\' must be escaped (preceded by a '\').
See the Uri#encode(String) method for support on escaping invalid
characters in a URI.
If the URI specified does not correspond to a legitimate node in the tree an
exception is thrown. The only exception is the isNodeUri(String)
method which returns false in case of an invalid URI.
Each method of DmtSession that accesses the tree in any way can throw
DmtIllegalStateException if the session has been closed or
invalidated (due to timeout, fatal exceptions, or unexpectedly unregistered
plugins).
| Modifier and Type | Field and Description |
|---|---|
| public static final int | LOCK_TYPE_ATOMIC
|
| public static final int | LOCK_TYPE_EXCLUSIVE
|
| public static final int | LOCK_TYPE_SHARED
Sessions created with |
| public static final int | STATE_CLOSED
The session is closed, DMT manipulation operations are not available,
they throw |
| public static final int | STATE_INVALID
The session is invalid because a fatal error happened. |
| public static final int | STATE_OPEN
The session is open, all session operations are available. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | commit()
Commits a series of DMT operations issued in the current atomic session since the last transaction boundary. |
| public void | |
| public void | |
| public void | createInteriorNode(String
the URI of the node to create nodeUri, String the type URI of the interior node, can be type)null if no
node type is definedCreate an interior node with a given type. |
| public void | createLeafNode(String
the URI of the node to create nodeUri)Create a leaf node with default value and MIME type. |
| public void | createLeafNode(String
the URI of the node to create nodeUri, DmtData the value to be given to the new node, can be value)nullCreate a leaf node with a given value and the default MIME type. |
| public void | createLeafNode(String
the URI of the node to create nodeUri, DmtData the value to be given to the new node, can be value, String nullthe MIME type to be given to the new node, can be
mimeType)nullCreate a leaf node with a given value and MIME type. |
| public void | |
| public void | |
| public void | execute(String
the node on which the execute operation is issued nodeUri, String an identifier to associate this operation with any
notifications sent in response to it, can be correlator, String null if not
neededthe parameter of the execute operation, can be data)nullExecutes a node, also specifying a correlation ID for use in response notifications. |
| public String[] | Returns: the list of child node names as a string array or an empty string array if the node has no childrenthe URI of the node nodeUri)Get the list of children names of a node. |
| public Acl | Returns: the Access Control List belonging to the nodethe URI of the node nodeUri)Gives the Access Control List in effect for a given node. |
| public int | Returns: the lock type of the session, one ofLOCK_TYPE_SHARED,
LOCK_TYPE_EXCLUSIVE and LOCK_TYPE_ATOMICGives the type of lock the session has. |
| public MetaNode | Returns: a MetaNode which describes meta data information, can benull if there is no meta data available for the given
nodethe URI of the node nodeUri)Get the meta data which describes a given node. |
| public Acl | Returns: the Access Control List belonging to the node ornull if
none definedthe URI of the node nodeUri)Get the Access Control List associated with a given node. |
| public int | Returns: the size of the data in the nodethe URI of the leaf node nodeUri)Get the size of the data in a leaf node. |
| public Date | Returns: the timestamp of the last modificationthe URI of the node nodeUri)Get the timestamp when the node was created or last modified. |
| public String | Returns: the title of the node, ornull if the node has no titlethe URI of the node nodeUri)Get the title of a node. |
| public String | Returns: the type of the node, can benullthe URI of the node nodeUri)Get the type of a node. |
| public DmtData | Returns: the data of the node, can not benullthe URI of the node to retrieve nodeUri)Get the data contained in a leaf or interior node. |
| public int | Returns: the version of the nodethe URI of the node nodeUri)Get the version of a node. |
| public String | Returns: the identifier of the remote server that initiated the session, ornull for local sessionsGives the name of the principal on whose behalf the session was created. |
| public String | |
| public int | |
| public int | |
| public boolean | Returns: true if the given node is a leaf nodethe URI of the node nodeUri)Tells whether a node is a leaf or an interior node of the DMT. |
| public boolean | |
| public void | renameNode(String
the URI of the node to rename nodeUri, String the new name property of the node newName)Rename a node. |
| public void | rollback()
Rolls back a series of DMT operations issued in the current atomic session since the last transaction boundary. |
| public void | setDefaultNodeValue(String
the URI of the node nodeUri)Set the value of a leaf or interior node to its default. |
| public void | setNodeAcl(String
the URI of the node nodeUri, Acl the Access Control List to be set on the node, can be
acl)nullSet the Access Control List associated with a given node. |
| public void | setNodeTitle(String
the URI of the node nodeUri, String the title text of the node, can be title)nullSet the title property of a node. |
| public void | setNodeType(String
the URI of the node nodeUri, String the type of the node, can be type)nullSet the type of a node. |
| public void | setNodeValue(String
the URI of the node nodeUri, DmtData the data to be set, can be data)nullSet the value of a leaf or interior node. |