org.apache.jackrabbit.core.observation
Class EventImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.observation.EventImpl
All Implemented Interfaces:
Event, JackrabbitEvent

public final class EventImpl
extends Object
implements JackrabbitEvent, Event

Implementation of the Event and the JackrabbitEvent interface.


Field Summary
 
Fields inherited from interface org.apache.jackrabbit.api.jsr283.observation.Event
NODE_MOVED, PERSIST
 
Fields inherited from interface javax.jcr.observation.Event
NODE_ADDED, NODE_REMOVED, PROPERTY_ADDED, PROPERTY_CHANGED, PROPERTY_REMOVED
 
Method Summary
 boolean equals(Object obj)
          Returns true if this Event is equal to another object.
 NodeId getChildId()
          Returns the id of a child node operation.
 long getDate()
          Returns the date when the change was persisted that caused this event.
 String getIdentifier()
          Returns the identifier associated with this event or null if this event has no associated identifier.
 Map getInfo()
          Returns the information map associated with this event.
 NodeId getParentId()
          Returns the uuid of the parent node.
 String getPath()
          
 Path getQPath()
          Returns the qualified path of this event.
 int getType()
          
 String getUserData()
          Returns the user data set through ObservationManager.setUserData() on the ObservationManager bound to the Session that caused the event.
 String getUserID()
          
 int hashCode()
           
 boolean isExternal()
          Return a flag indicating whether this is an externally generated event.
 boolean isShareableChildNode()
          Returns a flag indicating whether the child node of this event is a shareable node.
 String toString()
          Returns a String representation of this Event.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getType

public int getType()

Specified by:
getType in interface Event

getPath

public String getPath()
               throws RepositoryException

Specified by:
getPath in interface Event
Throws:
RepositoryException

getUserID

public String getUserID()

Specified by:
getUserID in interface Event

getDate

public long getDate()
Returns the date when the change was persisted that caused this event. The date is represented as a millisecond value that is an offset from the Epoch, January 1, 1970 00:00:00.000 GMT (Gregorian). The granularity of the returned value is implementation dependent.

Returns:
the date when the change was persisted that caused this event.

getUserData

public String getUserData()
Returns the user data set through ObservationManager.setUserData() on the ObservationManager bound to the Session that caused the event.

Returns:
String

getIdentifier

public String getIdentifier()
                     throws RepositoryException
Returns the identifier associated with this event or null if this event has no associated identifier. The meaning of the associated identifier depends upon the type of the event. See event type constants above.

Returns:
the identifier associated with this event or null.
Throws:
RepositoryException - if an error occurs.

getInfo

public Map getInfo()
            throws RepositoryException
Returns the information map associated with this event. The meaning of the map depends upon the type of the event. See event type constants above.

Returns:
A Map containing parameter information for instances of a NODE_MOVED event.
Throws:
RepositoryException - if an error occurs.

getQPath

public Path getQPath()
              throws RepositoryException
Returns the qualified path of this event.

Returns:
qualified path
Throws:
RepositoryException - if the path can't be constructed

getParentId

public NodeId getParentId()
Returns the uuid of the parent node.

Returns:
the uuid of the parent node.

getChildId

public NodeId getChildId()
Returns the id of a child node operation. If this Event was generated for a property operation this method returns null.

Returns:
the id of a child node operation.

isShareableChildNode

public boolean isShareableChildNode()
Returns a flag indicating whether the child node of this event is a shareable node. Only applies to node added/removed events.

Returns:
true for a shareable child node, false otherwise.

isExternal

public boolean isExternal()
Return a flag indicating whether this is an externally generated event.

Specified by:
isExternal in interface JackrabbitEvent
Returns:
true if this is an external event; false otherwise
See Also:
JackrabbitEvent.isExternal()

toString

public String toString()
Returns a String representation of this Event.

Overrides:
toString in class Object
Returns:
a String representation of this Event.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Returns true if this Event is equal to another object.

Two Event instances are equal if their respective EventState instances are equal and both Event instances are intended for the same Session that registerd the EventListener.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this Event is equal to another object.


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.