cgl.narada.service.reliable.events
Class RdCompanionEntityEvent

java.lang.Object
  extended by cgl.narada.service.reliable.events.RdCompanionEntityEvent
All Implemented Interfaces:
Comparator

public class RdCompanionEntityEvent
extends Object
implements Comparator

This is the event issued by the publishing entity, which allows the reliable delivery service to detect if events were lost in transit.


Constructor Summary
RdCompanionEntityEvent(byte[] marshalledBytes)
           
RdCompanionEntityEvent(int entityId, int templateId, int catenationNumber, int previousCatenationNumber, EventID eventId)
           
 
Method Summary
 int compare(Object one, Object two)
          For this implementation it is assumed that the entity id and template id of the compared objects are the same.
 boolean equals(Object obj)
          For this implementation it is assumed that the entity id and template id of the compared object is the same
 byte[] getBytes()
           
 int getCatenationNumber()
           
 int getEntityId()
           
 EventID getEventId()
          Returns the id of the event for which this serves as a companion event
 int getPreviousCatenationNumber()
          Returns the previous catenation number for a given template id.
 int getTemplateId()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RdCompanionEntityEvent

public RdCompanionEntityEvent(int entityId,
                              int templateId,
                              int catenationNumber,
                              int previousCatenationNumber,
                              EventID eventId)

RdCompanionEntityEvent

public RdCompanionEntityEvent(byte[] marshalledBytes)
Method Detail

getEntityId

public int getEntityId()

getTemplateId

public int getTemplateId()

getCatenationNumber

public int getCatenationNumber()

getPreviousCatenationNumber

public int getPreviousCatenationNumber()
Returns the previous catenation number for a given template id. Since a publisher may publish events conforming to multiple event templates, it is possible that successive events published by this publisher will not be related


getEventId

public EventID getEventId()
Returns the id of the event for which this serves as a companion event


toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
For this implementation it is assumed that the entity id and template id of the compared object is the same

Specified by:
equals in interface Comparator
Overrides:
equals in class Object

compare

public int compare(Object one,
                   Object two)
For this implementation it is assumed that the entity id and template id of the compared objects are the same. We only deal with the catenation numbers here. This plays a role in the SortedSet being maintain in the RdsEventPercolator

Specified by:
compare in interface Comparator

getBytes

public byte[] getBytes()


For comments and suggestions please send e-mail to The NaradaBrokering Project