org.mmbase.core.event
Class RelationEvent

java.lang.Object
  extended by org.mmbase.core.event.Event
      extended by org.mmbase.core.event.RelationEvent
All Implemented Interfaces:
Serializable, Cloneable, PublicCloneable<Event>

public class RelationEvent
extends Event
implements Serializable, Cloneable

This class reflects a ,,change relation event. it contains information about the kind of event (new, delete, change), and it contains a reference to the appropriate typerel node, which allows you to find out on which relation from which builder to which builder, the event occered. This is usefull for caching optimization.
A relation changed event is called the twoo nodes that the relation links (or used to).

Since:
MMBase-1.8
Version:
$Id: RelationEvent.java 41943 2010-04-16 17:18:19Z michiel $
Author:
Ernst Bunders
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.core.event.Event
eventType, machine, TYPE_CHANGE, TYPE_DELETE, TYPE_NEW, TYPE_UNSPECIFIED
 
Constructor Summary
RelationEvent(NodeEvent nodeEvent, int relationSourceNumber, int relationDestinationNumber, String relationSourceType, String relationDestinationType, int role)
          Constructor for relation event
 
Method Summary
 boolean equals(Object o)
           
 NodeEvent getNodeEvent()
           
 int getRelationDestinationNumber()
           
 String getRelationDestinationType()
           
 int getRelationSourceNumber()
           
 String getRelationSourceType()
           
 int getRole()
           
 int getType()
          Most events will come in certain 'types', default contants which are provided are Event.TYPE_NEW, Event.TYPE_CHANGE and Event.TYPE_DELETE.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class org.mmbase.core.event.Event
clone, getMachine, isLocal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationEvent

public RelationEvent(NodeEvent nodeEvent,
                     int relationSourceNumber,
                     int relationDestinationNumber,
                     String relationSourceType,
                     String relationDestinationType,
                     int role)
Constructor for relation event

Parameters:
nodeEvent -
relationSourceNumber - the nodenumber of the 'soucre' node
relationDestinationNumber - the nodenumber of the 'destination' node
relationSourceType - the builder name of the 'source' node
relationDestinationType - the builder name of the 'destination' node
role - the nodenumber of the reldef node
Method Detail

getRelationSourceType

public String getRelationSourceType()
Returns:
Returns the relationSourceType.

getRelationDestinationType

public String getRelationDestinationType()
Returns:
Returns the relationDestinationType.

getRelationSourceNumber

public int getRelationSourceNumber()
Returns:
Returns the relationSourceNumber.

getRelationDestinationNumber

public int getRelationDestinationNumber()
Returns:
Returns the relationDestinationNumber.

getType

public int getType()
Description copied from class: Event
Most events will come in certain 'types', default contants which are provided are Event.TYPE_NEW, Event.TYPE_CHANGE and Event.TYPE_DELETE.

Overrides:
getType in class Event

getRole

public int getRole()
Returns:
the role number

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getNodeEvent

public NodeEvent getNodeEvent()

toString

public String toString()
Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null