org.apache.jackrabbit.core.observation
Class EventState

java.lang.Object
  extended byorg.apache.jackrabbit.core.observation.EventState

public class EventState
extends Object

The EventState class encapsulates the session independent state of an Event.


Method Summary
static EventState childNodeAdded(String parentUUID, Path parentPath, String childUUID, Path.PathElement childPath, NodeTypeImpl nodeType, Set mixins, Session session)
          Creates a new Event of type Event.NODE_ADDED.
static EventState childNodeRemoved(String parentUUID, Path parentPath, String childUUID, Path.PathElement childPath, NodeTypeImpl nodeType, Set mixins, Session session)
          Creates a new Event of type Event.NODE_REMOVED.
 boolean equals(Object obj)
          Returns true if this EventState is equal to another object.
 Path.PathElement getChildRelPath()
          Returns the relative Path of the child Item associated with this event.
 String getChildUUID()
          Returns the UUID of a child node operation.
 Set getMixinNames()
          Returns a set of QNames which are the names of the mixins assigned to the parent node associated with this event.
 NodeTypeImpl getNodeType()
          Returns the node type of the parent node associated with this event.
 Path getParentPath()
          Returns the path of the parent node.
 String getParentUUID()
          Returns the uuid of the parent node.
 int getType()
          {@inheritDoc}
 String getUserId()
          {@inheritDoc}
 int hashCode()
          Returns a hashCode for this EventState.
static EventState propertyAdded(String parentUUID, Path parentPath, Path.PathElement childPath, NodeTypeImpl nodeType, Set mixins, Session session)
          Creates a new Event of type Event.PROPERTY_ADDED.
static EventState propertyChanged(String parentUUID, Path parentPath, Path.PathElement childPath, NodeTypeImpl nodeType, Set mixins, Session session)
          Creates a new Event of type Event.PROPERTY_CHANGED.
static EventState propertyRemoved(String parentUUID, Path parentPath, Path.PathElement childPath, NodeTypeImpl nodeType, Set mixins, Session session)
          Creates a new Event of type Event.PROPERTY_REMOVED.
 String toString()
          Returns a String representation of this EventState.
static String valueOf(int eventType)
          Returns a String representation of eventType.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

childNodeAdded

public static EventState childNodeAdded(String parentUUID,
                                        Path parentPath,
                                        String childUUID,
                                        Path.PathElement childPath,
                                        NodeTypeImpl nodeType,
                                        Set mixins,
                                        Session session)
Creates a new Event of type Event.NODE_ADDED.

Parameters:
parentUUID - the uuid of the parent node associated with this EventState.
parentPath - the path of the parent node associated with this EventState.
childUUID - the uuid of the child node associated with this event.
childPath - the relative path of the child node that was added.
nodeType - the node type of the parent node.
mixins - mixins assigned to the parent node.
session - the session that added the node.
Returns:
an EventState instance.

childNodeRemoved

public static EventState childNodeRemoved(String parentUUID,
                                          Path parentPath,
                                          String childUUID,
                                          Path.PathElement childPath,
                                          NodeTypeImpl nodeType,
                                          Set mixins,
                                          Session session)
Creates a new Event of type Event.NODE_REMOVED.

Parameters:
parentUUID - the uuid of the parent node associated with this EventState.
parentPath - the path of the parent node associated with this EventState.
childUUID - the uuid of the child node associated with this event.
childPath - the relative path of the child node that was removed.
nodeType - the node type of the parent node.
mixins - mixins assigned to the parent node.
session - the session that removed the node.
Returns:
an EventState instance.

propertyAdded

public static EventState propertyAdded(String parentUUID,
                                       Path parentPath,
                                       Path.PathElement childPath,
                                       NodeTypeImpl nodeType,
                                       Set mixins,
                                       Session session)
Creates a new Event of type Event.PROPERTY_ADDED.

Parameters:
parentUUID - the uuid of the parent node associated with this EventState.
parentPath - the path of the parent node associated with this EventState.
childPath - the relative path of the property that was added.
nodeType - the node type of the parent node.
mixins - mixins assigned to the parent node.
session - the session that added the property.
Returns:
an EventState instance.

propertyRemoved

public static EventState propertyRemoved(String parentUUID,
                                         Path parentPath,
                                         Path.PathElement childPath,
                                         NodeTypeImpl nodeType,
                                         Set mixins,
                                         Session session)
Creates a new Event of type Event.PROPERTY_REMOVED.

Parameters:
parentUUID - the uuid of the parent node associated with this EventState.
parentPath - the path of the parent node associated with this EventState.
childPath - the relative path of the property that was removed.
nodeType - the node type of the parent node.
mixins - mixins assigned to the parent node.
session - the session that removed the property.
Returns:
an EventState instance.

propertyChanged

public static EventState propertyChanged(String parentUUID,
                                         Path parentPath,
                                         Path.PathElement childPath,
                                         NodeTypeImpl nodeType,
                                         Set mixins,
                                         Session session)
Creates a new Event of type Event.PROPERTY_CHANGED.

Parameters:
parentUUID - the uuid of the parent node associated with this EventState.
parentPath - the path of the parent node associated with this EventState.
childPath - the relative path of the property that changed.
nodeType - the node type of the parent node.
mixins - mixins assigned to the parent node.
session - the session that changed the property.
Returns:
an EventState instance.

getType

public int getType()
{@inheritDoc}


getParentUUID

public String getParentUUID()
Returns the uuid of the parent node.

Returns:
the uuid of the parent node.

getParentPath

public Path getParentPath()
Returns the path of the parent node.

Returns:
the path of the parent node.

getChildUUID

public String getChildUUID()
Returns the UUID of a child node operation. If this EventState was generated for a property operation this method returns null.

Returns:
the UUID of a child node operation.

getChildRelPath

public Path.PathElement getChildRelPath()
Returns the relative Path of the child Item associated with this event.

Returns:
the Path.PathElement associated with this event.

getNodeType

public NodeTypeImpl getNodeType()
Returns the node type of the parent node associated with this event.

Returns:
the node type of the parent associated with this event.

getMixinNames

public Set getMixinNames()
Returns a set of QNames which are the names of the mixins assigned to the parent node associated with this event.

Returns:
the mixin names as QNames.

getUserId

public String getUserId()
{@inheritDoc}


toString

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

Returns:
a String representation of this EventState.

hashCode

public int hashCode()
Returns a hashCode for this EventState.

Returns:
a hashCode for this EventState.

equals

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

Parameters:
obj - the reference object with which to compare.
Returns:
true if object obj is equal to this EventState; false otherwise.

valueOf

public static String valueOf(int eventType)
Returns a String representation of eventType.

Parameters:
eventType - an event type defined by Event.
Returns:
a String representation of eventType.


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