net.agmodel.genericBroker
Class ServerHTTP

java.lang.Object
  |
  +--net.agmodel.genericBroker.ServiceHTTP
        |
        +--net.agmodel.genericBroker.ServerHTTP
Direct Known Subclasses:
GenericBrokerHTTP, ResourceHTTP

public abstract class ServerHTTP
extends ServiceHTTP

An HTTP servlet wrapper interface to a remote RMI-based server. The HTTP servlet wrapper is used when direct RMI connnections are blocked by firewalls. Each method below corresponding to a ServerRMI method. Method parameters are serialized and sent using HTTP to a wrapper servlet which calls the corresponding ServerRMI method and returns the results. int constants are used to identify which ServerRMI method to call

See Also:
ServerRMI

Field Summary
static int CONNECT
          call ServerRMI.connect(String, String)
static int CONNECTUSER
          call ServerRMI.connect(String, String, String, String, int)
static int DISCONNECT
          call ServerRMI.disconnect(String)
 
Fields inherited from class net.agmodel.genericBroker.ServiceHTTP
HOSTPARAMEXTENSION, PORTPARAMEXTENSION, servlet
 
Constructor Summary
ServerHTTP(String host)
          Create a linking class to communicate with the wrapper servlet on the default HTTP port (80).
ServerHTTP(String host, int port)
          Create a linking class to communicate with the wrapper servlet on a nominated port.
 
Method Summary
 void disconnect(String sessionID)
          Disconnect from MetBroker
 String getConnection(String clientInfo, String language)
          Establishes a broker session for the client application.
 String getConnection(String clientInfo, String language, String brokerUser, String brokerPassword, int userType)
          Establishes a broker session for the client application.
 
Methods inherited from class net.agmodel.genericBroker.ServiceHTTP
getServletPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECT

public static final int CONNECT
call ServerRMI.connect(String, String)

See Also:
Constant Field Values

CONNECTUSER

public static final int CONNECTUSER
call ServerRMI.connect(String, String, String, String, int)

See Also:
Constant Field Values

DISCONNECT

public static final int DISCONNECT
call ServerRMI.disconnect(String)

See Also:
Constant Field Values
Constructor Detail

ServerHTTP

public ServerHTTP(String host,
                  int port)
           throws GeneralException
Create a linking class to communicate with the wrapper servlet on a nominated port. Usually port 80 (default HTTP) or 8080 (Tomcat servlet container default) are used.

Parameters:
host - the web server hosting the wrapper servlet
Throws:
GeneralException

ServerHTTP

public ServerHTTP(String host)
           throws GeneralException
Create a linking class to communicate with the wrapper servlet on the default HTTP port (80).

Parameters:
host - the web server hosting the wrapper servlet
Throws:
GeneralException
Method Detail

getConnection

public String getConnection(String clientInfo,
                            String language)
                     throws IOException,
                            GeneralException
Establishes a broker session for the client application.

Parameters:
clientInfo - the client application name (useful for debugging)
language - the language to use for the session (eg for database names)
Returns:
a sessionID.
IOException
GeneralException

getConnection

public String getConnection(String clientInfo,
                            String language,
                            String brokerUser,
                            String brokerPassword,
                            int userType)
                     throws GeneralException
Establishes a broker session for the client application.

Parameters:
brokerUser - the username for the broker
brokerPassword - the password for the broker
language - the language to use for the session (eg for station names)
Returns:
a sessionID.
GeneralException

disconnect

public void disconnect(String sessionID)
                throws GeneralException
Disconnect from MetBroker

Parameters:
sessionID - the ID returned by getConnection
GeneralException