cgl.narada.protocol
Class ProtocolID

java.lang.Object
  extended by cgl.narada.protocol.ProtocolID

public class ProtocolID
extends Object

Protocol packets, especially those notifying the addition, deletion of gateways, nodes and address generation requests need to have unique ID associated with it. This class is responsible for the generation of unique IDs.


Constructor Summary
ProtocolID(byte[] idBytes)
          This allows us to unmarshall a protocolID.
 
Method Summary
 boolean equals(Object obj)
          Compares two objects for equality.
 byte[] getBytes()
          This method marshalls a protocolID.
 int hashCode()
          Generates a hash code for the receiver.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolID

public ProtocolID(byte[] idBytes)
This allows us to unmarshall a protocolID.

Parameters:
idBytes - The bytes contained in the stream received at a server node
Method Detail

getBytes

public byte[] getBytes()
This method marshalls a protocolID. The length of the byte stream that is marshalled is 10

Returns:
The marshalled byte stream.

hashCode

public int hashCode()
Generates a hash code for the receiver. This method is supported primarily for hash tables, such as those provided in java.util. If two objects are equal (equals(Object) returns true) they must have the same hash code

Overrides:
hashCode in class Object
Returns:
an integer hash code for the receiver

equals

public boolean equals(Object obj)
Compares two objects for equality. Returns a boolean that indicates whether this object is equivalent to the specified object. This method is used when an object is stored in a hashtable.

Overrides:
equals in class Object
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
See Also:
Hashtable


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