cgl.narada.matching
Class EventId

java.lang.Object
  extended by cgl.narada.matching.EventId

public class EventId
extends Object

The EventId is an ID which is unique in space and time. Using the event ID we can decipher if the event was an earlier event or a later event. This is what provides us with information pertaining to duplicate detection.


Constructor Summary
EventId(byte[] idBytes)
          This constructor provides for the unmarshalling of the eventID bytes that are received over a link
EventId(int _clientID, long _timeStamp, short _seqNum, short _incarnationNumber)
          Constructs a unique EventId based on the clientID, timeStamp, sequenceNumber and the incarnation associated with the publishing client.
 
Method Summary
 byte[] getBytes()
          This method provides a marshalling of the eventID bytes.
 int getClientID()
          Returns the client ID contained in the eventID
 short getIncarnation()
          This returns the incarnation number associated with the publishing client.
 short getSequenceNumber()
          This method returns the sequence number associated with the eventID instance.
 long getTimeStamp()
          This method returns the timeStamp that is associated with the eventID.
static void main(String[] args)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventId

public EventId(byte[] idBytes)
This constructor provides for the unmarshalling of the eventID bytes that are received over a link

Parameters:
idBytes - A byte stream representation of the event ID.

EventId

public EventId(int _clientID,
               long _timeStamp,
               short _seqNum,
               short _incarnationNumber)
Constructs a unique EventId based on the clientID, timeStamp, sequenceNumber and the incarnation associated with the publishing client.

Parameters:
_clientID - The clientID
_timeStamp - The timestamp associated with the ID.
_seqNum - The sequence number
_incarnationNumber - The incarnation associated with the publishing client.
Method Detail

getClientID

public int getClientID()
Returns the client ID contained in the eventID

Returns:
int clientID

getTimeStamp

public long getTimeStamp()
This method returns the timeStamp that is associated with the eventID.

Returns:
long timeStamp

getSequenceNumber

public short getSequenceNumber()
This method returns the sequence number associated with the eventID instance.

Returns:
short sequenceNumber

getIncarnation

public short getIncarnation()
This returns the incarnation number associated with the publishing client. A roam also constitutes as a new incarnation, and increments the incarnation sequence associated with the client.

Returns:
short incarnationNumber

toString

public String toString()
Overrides:
toString in class Object

getBytes

public byte[] getBytes()
This method provides a marshalling of the eventID bytes.

Returns:
Byte stream representation of the eventID.

main

public static void main(String[] args)


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