cgl.narada.protocol
Class Gateway

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

public class Gateway
extends Object
implements ProtocolDebugFlags

Gateway.java The individual element in the connectivity graph which we construct to -

  • Compute the best hop that should be taken from the vertex Node to reach any unit within the system.
  • To detect partitions - This could either be a system partition or a unit partition within a super unit. The knowledge of such partitions enable us to come up with alternate routing schemes or induce roam within clients connected to the partitioned sub-unit or sub system. The feature tells a node about partitions that concern the node's routing abilities.


    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
    Gateway(Gateway vertexNode, NodeAddress node, short level)
              This constructor is used to process the information that would be exchanged during the process of unit addition or the addition of a gateway.
    Gateway(NodeAddress node, short level, boolean isVertex)
              This constructor is used the first time a node is assigned a logical address.
     
    Method Summary
     Path computeShortestPathTo(Gateway gateway, Path path)
              The recursive call which computes the cost required to reach any given gateway within the system.
     Path computeShortestPathToVertex(Path path)
              The recursive call which computes the cost required to reach the vertex gateway within the system.
     void connectedToGateway(Gateway gateway)
              This hooks up two gateway nodes in the connectivity graph.
     boolean containedInRoutingInformation(byte[] routingInformation)
              Based on the routing information received at a server node, we need to know wether or not we should employ certain hops in the routing information.
     boolean containedInRoutingInformation(Destinations routingInformation)
              Based on the routing information received at a server node, we need to know wether or not we should employ certain hops in the routing information.
    protected  void createDownLink(Gateway gateway)
               
    protected  void createLateralAndUpLink(Gateway gateway)
               
     int disconnectedFromGateway(Gateway gateway)
              When a level-l gateway fails, or is added, the shortest paths and next best hop to reach the vertex node needs to be computed for all level-l gateways, and l+1 ...
     boolean equals(Object obj)
              Compares two objects for equality.
     short getLevel()
              Returns the level that this node exists in within the connectivity graph
     NodeAddress getNode()
              Provides the node address of the gateway node in the connectivity graph.
     int hashCode()
              Generates a hash code for the receiver.
     void invalidateVertexPath()
              This method forces the invalidation of the vertex path so that a new path is forced to be computed
    static void main(String[] args)
               
    protected  void removeDownLink(Gateway gateway)
               
    protected  void removeLateralAndUpLink(Gateway gateway)
               
     int reportPartitionStatus()
              If the lateralAndUpLink sizes are zero, a node is unit partitioned.
     String toString()
              This method is implemented to enable a System.out.println() on the gateway node.
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    Gateway

    public Gateway(NodeAddress node,
                   short level,
                   boolean isVertex)
    This constructor is used the first time a node is assigned a logical address.

    Parameters:
    node - - The node address of the hosting server node
    level - - The level of the system that this node is a part of.
    isVertex - - Indication that this node is the vertex for the connectivity graph that would be constructed for the node.

    Gateway

    public Gateway(Gateway vertexNode,
                   NodeAddress node,
                   short level)
    This constructor is used to process the information that would be exchanged during the process of unit addition or the addition of a gateway.

    Parameters:
    vertexNode - - The node address of the hosting server node
    node - - The nodeAddress of the node that is added to the connectivity graph.
    level - - The level of the system that this node is a part of.
    Method Detail

    getNode

    public NodeAddress getNode()
    Provides the node address of the gateway node in the connectivity graph.

    Returns:
    The node address of the gateway node.

    getLevel

    public short getLevel()
    Returns the level that this node exists in within the connectivity graph

    Returns:
    The level of this gateway node

    connectedToGateway

    public void connectedToGateway(Gateway gateway)
    This hooks up two gateway nodes in the connectivity graph. The gateway on which this method is invoked is responsible for creating the edge between the two gateways within the connectivity graph

    Parameters:
    gateway - - Specifies the gateway node that this node is connected to.

    createLateralAndUpLink

    protected void createLateralAndUpLink(Gateway gateway)

    createDownLink

    protected void createDownLink(Gateway gateway)

    removeLateralAndUpLink

    protected void removeLateralAndUpLink(Gateway gateway)

    removeDownLink

    protected void removeDownLink(Gateway gateway)

    disconnectedFromGateway

    public int disconnectedFromGateway(Gateway gateway)
    When a level-l gateway fails, or is added, the shortest paths and next best hop to reach the vertex node needs to be computed for all level-l gateways, and l+1 ... till the maximum level of the system. This method, accounts for the link failure case between two nodes. A unit failure corresponds to the failure of all links within that unit

    Parameters:
    gateway - - The gateway that has been disconnected.
    Returns:
    partitionStatus

    reportPartitionStatus

    public int reportPartitionStatus()
    If the lateralAndUpLink sizes are zero, a node is unit partitioned. If however there are no links originating from a node, that node is system partitioned

    Returns:
    partitionStatus

    invalidateVertexPath

    public void invalidateVertexPath()
    This method forces the invalidation of the vertex path so that a new path is forced to be computed


    computeShortestPathToVertex

    public Path computeShortestPathToVertex(Path path)
    The recursive call which computes the cost required to reach the vertex gateway within the system. The rules for traversing the connectivity graph include traversal only along lateral links or to a lower gateway.

    Parameters:
    path - - The path that is taken by each recursive process. We need this to ensure that each path traverses a gateway node only once and does not get stuck inside a recursive infinite loop.

    computeShortestPathTo

    public Path computeShortestPathTo(Gateway gateway,
                                      Path path)
    The recursive call which computes the cost required to reach any given gateway within the system. The rules for traversing the connectivity graph include traversal only along lateral links or to a lower gateway.

    Parameters:
    gateway - - The gateway that you seek to reach.
    path - - The path that is taken by each recursive process. We need this to ensure that each path traverses a gateway node only once and does not get stuck inside a recursive infinite loop.

    containedInRoutingInformation

    public boolean containedInRoutingInformation(byte[] routingInformation)
    Based on the routing information received at a server node, we need to know wether or not we should employ certain hops in the routing information. This method provides information regarding wether or not the hop (this node) in question can be employed in routing given a certain routing information.

    Parameters:
    routingInformation - - The routing information associated with the message so far.
    Returns:
    true - If this hop can be employed in the routing, and false otherwise.

    containedInRoutingInformation

    public boolean containedInRoutingInformation(Destinations routingInformation)
    Based on the routing information received at a server node, we need to know wether or not we should employ certain hops in the routing information. This method provides information regarding wether or not the hop (this node) in question can be employed in routing given a certain routing information.

    Parameters:
    routingInformation - - The routing information associated with the message so far.
    Returns:
    true - If this hop can be employed in the routing, and false otherwise.

    toString

    public String toString()
    This method is implemented to enable a System.out.println() on the gateway node. The string returned provides info regarding the node.

    Overrides:
    toString in class Object

    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

    main

    public static void main(String[] args)


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