cgl.narada.protocol
Class NodeAdditionProtocol

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

public class NodeAdditionProtocol
extends Object
implements ProtocolDebugFlags

NodeAdditionProtocol.java This call is responsible for the node addtion protocol. Specific responsibilities for this class include the following


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
NodeAdditionProtocol()
           
NodeAdditionProtocol(NodeAddress nodeAddress, short[] connectionVector, String ipDiscriminator, GatewayInfo gatewayInfo)
           
 
Method Summary
 byte[] constructNodeAdditionRequest(int[] levels, boolean from)
          This method is responsible for constructing the node addition request.
 void forwardNodeAddressRequest(int requestedLevel, ProtocolID requestId, Destinations origin, Destinations toReach, Destinations traversedSoFar)
           
 void forwardNodeAddressResponse(byte[] nodeAddressResponse)
           
static void main(String[] args)
           
 void processNodeAdditionRequest(String node, byte[] connectionRequestPacket)
          Process the node addition request.
 void processNodeAdditionResponse(String node, byte[] nodeAdditionResponse)
          This method processes the Node Addition Response.
 void processNodeAddressRequest(byte[] nodeAddressRequest)
          Not all addresses can be assigned at the node which has received a node addition request.
 void processNodeAddressResponse(byte[] nodeAddressResponse)
           
 void setAddressAssignerForLevel(int level)
          This method sets this node to be the node assigner at a certain level.
 void setNodeAddress(NodeAddress nodeAddress)
           
 void setProtocolHandler(ProtocolHandler protocolHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeAdditionProtocol

public NodeAdditionProtocol()

NodeAdditionProtocol

public NodeAdditionProtocol(NodeAddress nodeAddress,
                            short[] connectionVector,
                            String ipDiscriminator,
                            GatewayInfo gatewayInfo)
Method Detail

setProtocolHandler

public void setProtocolHandler(ProtocolHandler protocolHandler)

setNodeAddress

public void setNodeAddress(NodeAddress nodeAddress)

setAddressAssignerForLevel

public void setAddressAssignerForLevel(int level)
This method sets this node to be the node assigner at a certain level.

Parameters:
level - The level for which this node is the address assigner.

processNodeAddressRequest

public void processNodeAddressRequest(byte[] nodeAddressRequest)
Not all addresses can be assigned at the node which has received a node addition request. This request thus needs to be forwarded to the node which is responsible for assigning addresses within a certain level As a general rule 1.1.1.1 is responsible for the assigning addresses to clusters in 1.1.1 and super clusters in 1.1 .... while 28.29.23.1 is responsible for assigning addresses to nodes in the cluster 28.29.23 level indicates a request for assigning the address at level-l This also rules out sending this request over hops with level > than level. fromAddress - This includes routing information from level-0 upwards till level for which an address is requested.


processNodeAddressResponse

public void processNodeAddressResponse(byte[] nodeAddressResponse)

forwardNodeAddressResponse

public void forwardNodeAddressResponse(byte[] nodeAddressResponse)

forwardNodeAddressRequest

public void forwardNodeAddressRequest(int requestedLevel,
                                      ProtocolID requestId,
                                      Destinations origin,
                                      Destinations toReach,
                                      Destinations traversedSoFar)

processNodeAdditionRequest

public void processNodeAdditionRequest(String node,
                                       byte[] connectionRequestPacket)
Process the node addition request. This method is responsible for
  • Assigning the address, if it is allowed to do so.
  • Forward the request to assign addresses.

    Parameters:
    node - - The unassigned node from which this request was received.
    connectionRequestPacket - - The request for set up.

  • processNodeAdditionResponse

    public void processNodeAdditionResponse(String node,
                                            byte[] nodeAdditionResponse)
    This method processes the Node Addition Response. The information contained in the nodeAdditionResponse provides indications regarding the status of the node addition request. In the event that this request was successfully completed, the node address of the node in question is provided.

    Parameters:
    nodeAdditionResponse - The response to a node/unit addition request.

    constructNodeAdditionRequest

    public byte[] constructNodeAdditionRequest(int[] levels,
                                               boolean from)
    This method is responsible for constructing the node addition request. A node specifies the kind of gateways it seeks to be in the integer array, while specifying the to/from charachteristics of the node addition request

    Parameters:
    levels - - Integer array specifying the kind of gateways the node seeks to be.
    from - - Speicification of the to/from relationship for node addition.

    main

    public static void main(String[] args)


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