|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.discovery.broker.BrokerDiscoveryHelper
public class BrokerDiscoveryHelper
A client can use the Broker Locator to locate a suitable broker to connect
to.
The BrokerDiscoveryHelper sends BrokerDiscoveryRequest to (a)
known (BDN)s. If the BDN is not available then the request is broadcasted
using UDP multicast.
Created on Mar 26, 2005
| Field Summary | |
|---|---|
static double |
BROKER_DISCOVERY_PING_TIME
50% weightage is given to the Ping time |
static int |
MAX_PINGS
|
static int |
RESPONSE_PACKET_SIZE
|
static int |
TIMEOUT
|
static double |
WEIGHTAGE_FREE_TO_TOTAL_MEMORY
4% weightage is given to the %age of free memory |
static double |
WEIGHTAGE_NUM_LINKS
5% weightage is given to the Number of links a broker has |
static double |
WEIGHTAGE_TOTAL_MEMORY
10% weightage is given to the amount of memory present |
| Constructor Summary | |
|---|---|
BrokerDiscoveryHelper(int entityId,
String configFilePath,
int timeout,
int maxResponses,
int maxSetSize)
|
|
| Method Summary | |
|---|---|
double |
computeBrokerWeightage(BrokerDiscoveryResponse resp)
Computes weight for the given broker using the values in the BrokerDiscoveryResponse |
BrokerDiscoveryResponse[] |
discover(String[] protocols,
String secCerts,
String brokerNetworks)
We first initialize and run the UDPReciever thread. |
String |
getBrokerLocation(BrokerDiscoveryResponse bdr)
|
static void |
main(String[] args)
Testing purposes only |
long |
ping(String host,
int port,
int timeout)
Pings a given broker |
BrokerDiscoveryResponse |
selectBestBroker(BrokerDiscoveryResponse[] brokers)
Selects the best broker among the specified set of brokers from the broker discovery responses |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int TIMEOUT
public static final int RESPONSE_PACKET_SIZE
public static final double BROKER_DISCOVERY_PING_TIME
public static final double WEIGHTAGE_TOTAL_MEMORY
public static final double WEIGHTAGE_NUM_LINKS
public static final double WEIGHTAGE_FREE_TO_TOTAL_MEMORY
public static final int MAX_PINGS
| Constructor Detail |
|---|
public BrokerDiscoveryHelper(int entityId,
String configFilePath,
int timeout,
int maxResponses,
int maxSetSize)
| Method Detail |
|---|
public BrokerDiscoveryResponse[] discover(String[] protocols,
String secCerts,
String brokerNetworks)
protocols - -
A list of 1 or more matching protocols the broker MUST
support.secCerts - -
Security Certificate. TODO: Replace w/ X.509 CertificatebrokerNetworks - -
brokers belonging to which networks must be considered. "*" to
match any network
public long ping(String host,
int port,
int timeout)
host - -
IP address of the brokerport - -
UDP port of brokertimeout - -
Time for which to wait
public double computeBrokerWeightage(BrokerDiscoveryResponse resp)
resp - -
The BrokerDiscoveryResponse containing the metrics for the
broker
public String getBrokerLocation(BrokerDiscoveryResponse bdr)
public BrokerDiscoveryResponse selectBestBroker(BrokerDiscoveryResponse[] brokers)
brokers - An array of BrokerDiscoveryResponses
public static void main(String[] args)
args -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||