cgl.narada.discovery.broker.bdn
Class BrokerConnection

java.lang.Object
  extended by cgl.narada.discovery.broker.bdn.BrokerConnection

public class BrokerConnection
extends Object

Helps maintain Active connections to brokers within the Brokering network
Created on Mar 29, 2005


Field Summary
static int BROKER_PING_INTERVAL
           
static String NB_HOME
           
 
Constructor Summary
BrokerConnection(String id, BrokerAdvertisement bad)
           
 
Method Summary
static void main(String[] args)
           
 long ping()
          Sends a TCP Ping request to the Broker
 void releaseResources()
           
 boolean sendDiscoveryRequest(byte[] discoBytes)
          Sends the discovery request to the broker
 double UDPPing()
          Pings the broker and returns the RTT time required
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BROKER_PING_INTERVAL

public static final int BROKER_PING_INTERVAL
See Also:
Constant Field Values

NB_HOME

public static final String NB_HOME
See Also:
Constant Field Values
Constructor Detail

BrokerConnection

public BrokerConnection(String id,
                        BrokerAdvertisement bad)
Method Detail

sendDiscoveryRequest

public boolean sendDiscoveryRequest(byte[] discoBytes)
Sends the discovery request to the broker

Parameters:
discoBytes - - The Marshalled BrokerDiscoveryRequest object
Returns:
True if the request was sent w/o errors, false otherwise

UDPPing

public double UDPPing()
Pings the broker and returns the RTT time required

Returns:
Ping time if successful, -1 if time out occurred and 0 if any other error occurred !

ping

public long ping()
Sends a TCP Ping request to the Broker

Returns:
Ping time in milliseconds

releaseResources

public void releaseResources()

main

public static void main(String[] args)


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