DmtAdmin should register itself in the OSGi service
registry as a service. DmtAdmin is the entry point for applications
to use the DMT API.
The getSession methods are used to open a session on a specified
subtree of the DMT. A typical way of usage:
serviceRef = context.getServiceReference(DmtAdmin.class.getName());
DmtAdmin admin = (DmtAdmin) context.getService(serviceRef);
DmtSession session = admin.getSession("./OSGi/Configuration");
session.createInteriorNode("./OSGi/Configuration/my.table");
The methods for opening a session take a node URI (the session root) as a parameter. All segments of the given 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.
It is possible to specify a lock mode when opening the session (see lock type
constants in DmtSession). This determines whether the session can run
in parallel with other sessions, and the kinds of operations that can be
performed in the session. All Management Objects constituting the device
management tree must support read operations on their nodes, while support
for write operations depends on the Management Object. Management Objects
supporting write access may support transactional write, non-transactional
write or both. Users of DmtAdmin should consult the Management Object
specification and implementation for the supported update modes. If
Management Object definition permits, implementations are encouraged to
support both update modes.
| Modifier and Type | Method and Description |
|---|---|
| public DmtSession | Returns: aDmtSession object for the requested subtreethe subtree on which DMT manipulations can be performed
within the returned session subtreeUri)Opens a |
| public DmtSession | Returns: aDmtSession object for the requested subtreethe subtree on which DMT manipulations can be performed
within the returned session subtreeUri, int one of the lock modes specified in lockMode)DmtSessionOpens a |
| public DmtSession | Returns: aDmtSession object for the requested subtreethe identifier of the remote server on whose behalf the
data manipulation is performed, or principal, String null for local sessionsthe subtree on which DMT manipulations can be performed
within the returned session subtreeUri, int one of the lock modes specified in lockMode)DmtSessionOpens a |
| getSession | back to summary |
|---|---|
| public DmtSession getSession(String subtreeUri) throws DmtException Opens a
The
To perform this operation the caller must have
| |
| getSession | back to summary |
|---|---|
| public DmtSession getSession(String subtreeUri, int lockMode) throws DmtException Opens a
The
To perform this operation the caller must have
| |
| getSession | back to summary |
|---|---|
| public DmtSession getSession(String principal, String subtreeUri, int lockMode) throws DmtException Opens a
The
This method is guarded by
| |