Interface DmtEvent
-
public interface DmtEventEvent class storing the details of a change in the tree.DmtEventis used byDmtAdminto notify registeredEventListenersabout important changes. Events are generated after every successful DMT change, and also when sessions are opened or closed. If aDmtSessionis 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
typeof 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 ofCOPIEDorRENAMEDevents, the event carries the list of new nodes as well.When a
DmtEventis 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:- If the listener was registered specifying an explicit principal, using
the
DmtAdmin.addEventListener(String, int, String, DmtEventListener)method, then the target node ACLs should be checked for providing GET access to the specified principal; - When the listener was registered without an explicit principal then the
listener needs GET
DmtPermissionfor the corresponding node.
- Version:
- $Revision: 5673 $
- If the listener was registered specifying an explicit principal, using
the
-
-
Field Summary
Fields Modifier and Type Field Description static intADDEDEvent type indicating nodes that were added.static intCOPIEDEvent type indicating nodes that were copied.static intDELETEDEvent type indicating nodes that were deleted.static intRENAMEDEvent type indicating nodes that were renamed.static intREPLACEDEvent type indicating nodes that were replaced.static intSESSION_CLOSEDEvent type indicating that a session was closed.static intSESSION_OPENEDEvent type indicating that a new session was opened.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String[]getNewNodes()java.lang.String[]getNodes()This method can be used to query the subject nodes of this event.intgetSessionId()This method returns the identifier of the session in which this event took place.intgetType()This method returns the type of this event.
-
-
-
Field Detail
-
ADDED
static final int ADDED
Event type indicating nodes that were added.- See Also:
- Constant Field Values
-
COPIED
static final int COPIED
Event type indicating nodes that were copied.- See Also:
- Constant Field Values
-
DELETED
static final int DELETED
Event type indicating nodes that were deleted.- See Also:
- Constant Field Values
-
RENAMED
static final int RENAMED
Event type indicating nodes that were renamed.- See Also:
- Constant Field Values
-
REPLACED
static final int REPLACED
Event type indicating nodes that were replaced.- See Also:
- Constant Field Values
-
SESSION_OPENED
static final int SESSION_OPENED
Event type indicating that a new session was opened.- See Also:
- Constant Field Values
-
SESSION_CLOSED
static final int SESSION_CLOSED
Event type indicating that a session was closed. This type of event is sent when the session is closed by the client or becomes inactive for any other reason (session timeout, fatal errors in business methods, etc.).- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
int getType()
This method returns the type of this event.- Returns:
- the type of this event.
-
getSessionId
int getSessionId()
This method returns the identifier of the session in which this event took place. The ID is guaranteed to be unique on a machine.- Returns:
- the unique indetifier of the session that triggered the event
-
getNodes
java.lang.String[] getNodes()
This method can be used to query the subject nodes of this event. The method returnsnullforSESSION_OPENEDandSESSION_CLOSED.The method returns only those affected nodes that the caller has the GET permission for (or in case of
COPIEDorRENAMEDevents, 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.- Returns:
- the array of affected nodes
- See Also:
getNewNodes()
-
getNewNodes
java.lang.String[] getNewNodes()
This method can be used to query the new nodes, when the type of the event isCOPIEDorRENAMED. For all other event types this method returnsnull.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.
- Returns:
- the array of newly created nodes
-
-