cgl.narada.protocol
Class GatewayPropagationProtocol

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

public class GatewayPropagationProtocol
extends Object
implements ProtocolDebugFlags

This class is responsible for the creation of gateway between two units at different levels. This process of setting up connection between two units must satisfy the constraints imposed by the setup rules.

  • None of the server nodes involved in the connection, must have reached their connection threshold for concurrent connections at the given level.
  • The nodes involved in the gateway setup process, should both have valid logical addresses assigned by the system.
  • If the node seeks to be a level k gateway, their logical address should differ at level k. Higher level addresses should be the same. Thus if we can create a level-1 connection between server nodes A.b.12.x and A.b.11.y. A similar connection request between A.b.12.x and B.c.11.y is going to fail.


    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
    GatewayPropagationProtocol(short[] connectionVector, GatewayInfo gatewayInfo)
              The GatewayPropagation Protocol - Testing purposes
    GatewayPropagationProtocol(short[] connectionVector, GatewayInfo gatewayInfo, ProtocolHandler protocolHandler)
              The GatewayPropagation Protocol - Constructor
     
    Method Summary
     byte[] constructGatewaySetupRequest(String node, int gatewayLevel)
              This method is responsible for the creation of a gateway setup request.
     void handleConnectionSetupResponse(String node, byte[] gatewaySetupResponse)
              This method is responsible for processing the connection set up response.
     void handleGatewayCreationRequest(String node, byte[] gatewayCreationRequest)
              This method is used for establishing a connection between two units in the system.
    static void main(String[] args)
              The test function for the gateway propagation protocol.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    GatewayPropagationProtocol

    public GatewayPropagationProtocol(short[] connectionVector,
                                      GatewayInfo gatewayInfo)
    The GatewayPropagation Protocol - Testing purposes

    Parameters:
    connectionVector - The connection vector for the node in question, which maintains information regarding the number of allowed conncurrent connections at different levels.
    gatewayInfo - The connectivity graph handle

    GatewayPropagationProtocol

    public GatewayPropagationProtocol(short[] connectionVector,
                                      GatewayInfo gatewayInfo,
                                      ProtocolHandler protocolHandler)
    The GatewayPropagation Protocol - Constructor

    Parameters:
    connectionVector - The connection vector for the node in question, which maintains information regarding the number of allowed conncurrent connections at different levels.
    gatewayInfo - The connectivity graph handle
    protocolHandler - A reference to the protocol Handler. To be able to setup gateways, the node in question should have an assigned address.
    Method Detail

    handleGatewayCreationRequest

    public void handleGatewayCreationRequest(String node,
                                             byte[] gatewayCreationRequest)
    This method is used for establishing a connection between two units in the system. This request can succed only if the following hold true.
  • This node has been assigned a logical address by the system.
  • If the node seeks to be a level k gateway, their logical address should differ at level k. Higher level addresses should be the same. Thus if we can create a level-1 connection between server nodes A.b.12.x and A.b.11.y. A similar connection request between A.b.12.x and B.c.11.y is going to fail.


  • handleConnectionSetupResponse

    public void handleConnectionSetupResponse(String node,
                                              byte[] gatewaySetupResponse)
    This method is responsible for processing the connection set up response. If the connection setup was successful, this method is also responsible for the dissemination of connection information throughout the relevant parts of the system.

    Parameters:
    node - The node issuing the response, this node is then mapped to a logical hop of this server node.
    gatewaySetupResponse - A marshalled representation of the gateway setup response.

    constructGatewaySetupRequest

    public byte[] constructGatewaySetupRequest(String node,
                                               int gatewayLevel)
    This method is responsible for the creation of a gateway setup request. Each request needs to have a unique id associated with it, upon success this ID would be used as the connection ID of the newly created connection.

    Parameters:
    node - The node to which this request needs to be issued to, this node has not yet been configured as a hop by the system.
    gatewayLevel - The gateway level that this node seeks to be.
    Returns:
    The marshalled connection setup request.

    main

    public static void main(String[] args)
    The test function for the gateway propagation protocol.



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