|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DmtEvent
Event class storing the details of a change in the tree.
DmtEvent
is used by DmtAdmin
to notify registered
EventListeners
about important changes. Events are
generated after every successful DMT change, and also when sessions are
opened or closed. If a DmtSession
is opened in atomic mode, DMT
events are only sent when the session is committed, when the changes are
actually performed.
An event is generated for each group of nodes added, deleted, replaced, renamed or copied, in this order. Events are also generated when sessions are opened and closed.
The type
of the event describes the change that triggered the
event delivery. Each event carries the unique identifier of the session in
which the described change happened. The events describing changes in the DMT
carry the list of affected nodes. In case of COPIED
or
RENAMED
events, the event carries the list of new nodes as well.
When a DmtEvent
is delivered to a listener, the event contains
only those node URIs that the listener has access to. This access control
decision is based on the principal specified when the listener was
registered:
DmtAdmin.addEventListener(String, int, String, DmtEventListener)
method, then the target node ACLs should be checked for providing GET access
to the specified principal;
DmtPermission
for the
corresponding node.
Field Summary | |
---|---|
static int |
ADDED
Event type indicating nodes that were added. |
static int |
COPIED
Event type indicating nodes that were copied. |
static int |
DELETED
Event type indicating nodes that were deleted. |
static int |
RENAMED
Event type indicating nodes that were renamed. |
static int |
REPLACED
Event type indicating nodes that were replaced. |
static int |
SESSION_CLOSED
Event type indicating that a session was closed. |
static int |
SESSION_OPENED
Event type indicating that a new session was opened. |
Method Summary | |
---|---|
java.lang.String[] |
getNewNodes()
This method can be used to query the new nodes, when the type of the event is COPIED or RENAMED . |
java.lang.String[] |
getNodes()
This method can be used to query the subject nodes of this event. |
int |
getSessionId()
This method returns the identifier of the session in which this event took place. |
int |
getType()
This method returns the type of this event. |
Field Detail |
---|
static final int ADDED
static final int COPIED
static final int DELETED
static final int RENAMED
static final int REPLACED
static final int SESSION_OPENED
static final int SESSION_CLOSED
Method Detail |
---|
int getType()
int getSessionId()
java.lang.String[] getNodes()
null
for SESSION_OPENED
and
SESSION_CLOSED
.
The method returns only those affected nodes that the caller has the GET
permission for (or in case of COPIED
or RENAMED
events,
where the caller has GET permissions for either the source or the
destination nodes). Therefore, it is possible that the method returns an
empty array. All returned URIs are absolute.
getNewNodes()
java.lang.String[] getNewNodes()
COPIED
or RENAMED
. For all other event types
this method returns null
.
The array returned by this method runs parallel to the array returned by
getNodes()
, the elements in the two arrays contain the source and
destination URIs for the renamed or copied nodes in the same order. All
returned URIs are absolute.
This method returns only those nodes where the caller has the GET permission for the source or destination node of the operation. Therefore, it is possible that the method returns an empty array.
|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |