cgl.narada.protocol
Class NodeAddress

java.lang.Object
  extended by cgl.narada.protocol.NodeAddress
All Implemented Interfaces:
ProtocolDebugFlags

public class NodeAddress
extends Object
implements ProtocolDebugFlags

The protocol layers deal only with the logical addresses associated with the nodes (be they clients or servers). This class maintains information regarding a nodes address. Utilitiy functions include accessor functions which can get information regarding a nodes address in terms of bytes or ints.


Field Summary
 
Fields inherited from interface cgl.narada.protocol.ProtocolDebugFlags
BrokerLocatorCommunicator_Debug, ClientConnectionHandler_Debug, Connection_Debug, ConnectionPropagation_Debug, Destinations_Debug, DuplicateDetection_Debug, EventBuffer_Debug, EventRoutingProtocol_Debug, Gateway_Debug, GatewayInfo_Debug, GatewayPropagation_Debug, JmsProfilePropagation_Debug, LinkCostMatrix_Debug, NodeAdditionProtocol_Debug, NodeAddress_Debug, Path_Debug, PersistentEventRouting_Debug, ProfilePropagationProtocol_Debug, ProtocolException_Debug, ProtocolHandler_Debug, ProtocolID_Debug, ProtocolIDFactory_Debug, RoutingCache_Debug, RtpEventRoutingProtocol_Debug, RtpProfilePropagation_Debug, SecureMessageRouting_Debug, TagValueEventRoutingProtocol_Debug, TagValueProfilePropagation_Debug, XmlEventRoutingProtocol_Debug, XPathProfilePropagation_Debug
 
Constructor Summary
NodeAddress(byte[] addressInBytes)
           
NodeAddress(byte[] addressInBytes, boolean isClientAddress)
          This is to construct a node address specific to client connections.
NodeAddress(int[] addressInInts)
           
 
Method Summary
 boolean equals(Object obj)
          Compares two objects for equality.
 byte[] getAddressInBytes()
          Accessor function to get the node address as a sequence of bytes
 int[] getAddressInInts()
          Accessor function to get the node address as a sequence of ints
 int hashCode()
          Generates a hash code for the receiver.
static void main(String[] args)
           
 String toString()
          This method is implemented to enable a System.out.println() on the node's address.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeAddress

public NodeAddress(byte[] addressInBytes)

NodeAddress

public NodeAddress(int[] addressInInts)

NodeAddress

public NodeAddress(byte[] addressInBytes,
                   boolean isClientAddress)
This is to construct a node address specific to client connections.

Method Detail

getAddressInBytes

public byte[] getAddressInBytes()
Accessor function to get the node address as a sequence of bytes

Returns:
A byte[] of the node's address

getAddressInInts

public int[] getAddressInInts()
Accessor function to get the node address as a sequence of ints

Returns:
An int[] of the node's address

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

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

toString

public String toString()
This method is implemented to enable a System.out.println() on the node's address. The string returned provides the node's logical address as a sequence of bytes (with each bit represented).

Overrides:
toString in class Object

main

public static void main(String[] args)


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