org.apache.jackrabbit.core.observation
Class EventImpl

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

public final class EventImpl
extends Object
implements org.apache.jackrabbit.api.observation.JackrabbitEvent, org.apache.jackrabbit.spi.commons.AdditionalEventInfo, Event

Implementation of the Event and the JackrabbitEvent interface.


Field Summary
 
Fields inherited from interface javax.jcr.observation.Event
NODE_ADDED, NODE_MOVED, NODE_REMOVED, PERSIST, 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()
          
 String getIdentifier()
          
 Map<String,String> getInfo()
          
 Set<org.apache.jackrabbit.spi.Name> getMixinTypeNames()
           
 NodeId getParentId()
          Returns the uuid of the parent node.
 String getPath()
          
 org.apache.jackrabbit.spi.Name getPrimaryNodeTypeName()
           
 org.apache.jackrabbit.spi.Path getQPath()
          Returns the Path of this event.
 Object getSessionAttribute(String name)
           
 int getType()
          
 String getUserData()
          
 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()

Specified by:
getDate in interface Event

getUserData

public String getUserData()

Specified by:
getUserData in interface Event

getIdentifier

public String getIdentifier()
                     throws RepositoryException

Specified by:
getIdentifier in interface Event
Throws:
RepositoryException

getInfo

public Map<String,String> getInfo()
                           throws RepositoryException

Specified by:
getInfo in interface Event
Throws:
RepositoryException

getQPath

public org.apache.jackrabbit.spi.Path getQPath()
                                        throws RepositoryException
Returns the Path of this event.

Returns:
path or null when no path is associated with the event
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 org.apache.jackrabbit.api.observation.JackrabbitEvent
Returns:
true if this is an external event; false otherwise
See Also:
JackrabbitEvent.isExternal()

getPrimaryNodeTypeName

public org.apache.jackrabbit.spi.Name getPrimaryNodeTypeName()
Specified by:
getPrimaryNodeTypeName in interface org.apache.jackrabbit.spi.commons.AdditionalEventInfo
Returns:
the primary node type of the node associated with the event
See Also:
AdditionalEventInfo.getPrimaryNodeTypeName()

getMixinTypeNames

public Set<org.apache.jackrabbit.spi.Name> getMixinTypeNames()
Specified by:
getMixinTypeNames in interface org.apache.jackrabbit.spi.commons.AdditionalEventInfo
Returns:
the mixin node types of the node associated with the event
See Also:
AdditionalEventInfo.getMixinTypeNames()

getSessionAttribute

public Object getSessionAttribute(String name)
Specified by:
getSessionAttribute in interface org.apache.jackrabbit.spi.commons.AdditionalEventInfo
Returns:
the specified session attribute

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-2012 The Apache Software Foundation. All Rights Reserved.