HPSearch

cgl.hpsearch.services.BrokerInstantiator
Class Broker

java.lang.Object
  extended bycgl.hpsearch.services.BrokerInstantiator.Broker

public class Broker
extends Object

Frontend to creating broker nodes and creating links between brokers
Created on Sep 26, 2004

Author:
Harshawardhan Gadgil (hgadgil@grids.ucs.indiana.edu)

Constructor Summary
Broker(String opt_BrokerConfigFile)
          Creates a broker at a specifed node...
Broker(String opt_BrokerConfigFile, String opt_ServiceConfig)
          Creates a broker at a specifed node...
 
Method Summary
 void closeLink(String linkID)
          Delete the link specified by the linkID parameter
 String connectTo(String host, String portNum, String medium, String opt_confFileName)
          Creates a link to the specified broker.
 void disableMonitoring()
          Disables the Performance Monitoring Service
 void enableMonitoring()
          Starts the Performance Monitoring Service
 String[] getLinks()
          Get all the links on this broker Node
 boolean requestGatewayAddress(String client, String s_level)
          Tell the broker to request a gateway address from the specified broker
 boolean requestNodeAddress(String client, String s_level)
          Tell the broker to request a node address from the specified client
 void setBrokerLocator(String blHost, int blPort)
          Sets the broker Locator
 boolean shutdown()
          Dispose the broker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Broker

public Broker(String opt_BrokerConfigFile,
              String opt_ServiceConfig)
       throws NullPointerException
Creates a broker at a specifed node... If the parameter opt_BrokerConfigFile is "" then the broker is created using the default config file else we use the one specified.
If an error occurs, a NullPointerException is thrown
Constructor for NB version 1.0

Parameters:
opt_BrokerConfigFile -

Broker

public Broker(String opt_BrokerConfigFile)
       throws NullPointerException
Creates a broker at a specifed node... If the parameter opt_BrokerConfigFile is "" then the broker is created using the default config file else we use the one specified.
If an error occurs, a NullPointerException is thrown

Parameters:
opt_BrokerConfigFile -
Method Detail

connectTo

public String connectTo(String host,
                        String portNum,
                        String medium,
                        String opt_confFileName)
                 throws BrokerServiceException
Creates a link to the specified broker. Helps to generate a broker network topology.

Parameters:
host - The host on which the target boker resides
portNum - The port number to which a connection is requested
medium - The transport protocol to be used. Valid values are
  • 't' - tcp
  • 'p' - ptcp
  • 'u' - udp
  • 'nio' - niotcp
  • 'http' or 'ssl' <- Requires to set the 4th parameter confFileName
  • opt_confFileName - May be blank unless the medium is http or ssl
    Returns:
    A String representing the linkId of the created link if successful
    Throws:
    BrokerServiceException - - If the broker does not exist OR an error occurred when creating the link

requestNodeAddress

public boolean requestNodeAddress(String client,
                                  String s_level)
                           throws BrokerServiceException
Tell the broker to request a node address from the specified client

Parameters:
client - - The link id of the connection on which the request is to be sent
s_level - - address level
Returns:
- True if the Request was carried out successfully
Throws:
BrokerServiceException

requestGatewayAddress

public boolean requestGatewayAddress(String client,
                                     String s_level)
                              throws BrokerServiceException
Tell the broker to request a gateway address from the specified broker

Parameters:
client - - The link id of the connection on which the request is to be sent
s_level - - address level
Returns:
- True if the Request was carried out successfully
Throws:
BrokerServiceException

getLinks

public String[] getLinks()
Get all the links on this broker Node

Returns:
An Array of Strings containing the names of various links on this broker

closeLink

public void closeLink(String linkID)
Delete the link specified by the linkID parameter

Parameters:
linkID - - Specifies the link to delete

shutdown

public boolean shutdown()
Dispose the broker


setBrokerLocator

public void setBrokerLocator(String blHost,
                             int blPort)
                      throws BrokerServiceException
Sets the broker Locator

Parameters:
blHost - - Host
blPort - - Port
Throws:
BrokerServiceException - If BrokerNode is null

enableMonitoring

public void enableMonitoring()
                      throws BrokerServiceException
Starts the Performance Monitoring Service

Throws:
BrokerServiceException - If error occurs

disableMonitoring

public void disableMonitoring()
Disables the Performance Monitoring Service


HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006