All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ibs.ebf.protocol.EbfConnector

java.lang.Object
   |
   +----ibs.ebf.protocol.EbfConnector

public class EbfConnector
extends Object
implements IProtocol10, IConnector
Class EbfConnector provides a communication agent for communicating with ebfServer framework from local/remote machine. All communications with ebfServer must be conducted thru this class.


Constructor Index

 o EbfConnector(String, int)
Constructor for class EbfConnector.
 o EbfConnector(String, int, int)
Constructor for class EbfConnector.

Method Index

 o getSessionId()
Returns SessionId as supplied by the remove connection.
 o next()
Returns next line of result from remote connection.
 o processRequest()
Start processing request.
 o setCookies(Hashtable)
Cookies hashtable may contain one or more cookies in the following format:
* Hashtable key: Cookie Name
* Hashtable value: Cookie value.
 o setData(Hashtable)
Data hashtable must contain 0 or more submitted parameter names and parameter values in following format:
* Hashtable key: Parameter name - A String object.
 o setExec(Hashtable)
Set Hashtable exec_request.
 o setHeader(Hashtable)
Header hashtable must contain one or more HTTP headers in the following format:
* Hashtable key: HTTP Header Name
* Hashtable key value: HTTP HEader value.
 o setIdString(String)
Login info is required if a connection is being made to the Admin or Peer port of the EbfServer.
 o setTraceDir(String)
Use this method for debugging purpose only.
If you are using Servlets, there is no clean way to trace activities.

Constructors

 o EbfConnector
 public EbfConnector(String conn_addr,
                     int conn_port) throws Exception
Constructor for class EbfConnector. This constructor asssumes socket timeout value of 30 seconds.

Parameters:
conn_addr - Connection Host Address
conn_port - An integer number for the Connection Port
 o EbfConnector
 public EbfConnector(String conn_addr,
                     int conn_port,
                     int sock_timeout_secs) throws Exception
Constructor for class EbfConnector.

Parameters:
conn_addr - Connection Host Address
conn_port - An integer number for the Connection Port
sock_timeout - An integer number indicating socket timeout value in Seconds.

Methods

 o setTraceDir
 public boolean setTraceDir(String trace_directory)
Use this method for debugging purpose only.
If you are using Servlets, there is no clean way to trace activities. In such event, you may want to use this additional feature provided to you. To trace all activities of EbfConnector, simply set the trace directory for this object and it will dump all traces of activities into a SessionId.trace file in the given directory.

Parameters:
trace_directory - Trace all activities and dump'em to a file in this directory.
Returns:
A boolean value - 'false' if it's not directory, or can't write to it. 'true' otherwise.
 o setIdString
 public void setIdString(String id_string)
Login info is required if a connection is being made to the Admin or Peer port of the EbfServer. Not used in ebfServer V2.1 or V2.2

Parameters:
login_id - A Login Id (also known as an identification string) for access verification
 o setHeader
 public void setHeader(Hashtable header)
Header hashtable must contain one or more HTTP headers in the following format:
* Hashtable key: HTTP Header Name
* Hashtable key value: HTTP HEader value.

Parameters:
header - A Hashtable containing headers for http request.
 o setCookies
 public void setCookies(Hashtable cookies)
Cookies hashtable may contain one or more cookies in the following format:
* Hashtable key: Cookie Name
* Hashtable value: Cookie value.

Parameters:
cookies - A Hashtable containing cookies.
 o setData
 public void setData(Hashtable data)
Data hashtable must contain 0 or more submitted parameter names and parameter values in following format:
* Hashtable key: Parameter name - A String object.
* Hashtable Key Value: Parameter value(s) - A String[] object.

Parameters:
data - A Hashtable containing submitted keys and its values
 o setExec
 public void setExec(Hashtable exec_request)
Set Hashtable exec_request.

A Hashtable containing following keys "CMD", "PARAMS", "ENVVARS" and its values.
* Key: CMD Value: A command that needs to be executed - Required
* Key: PARAMS Value: Command parameters - Not Required (Can be null or empty string)
* Key: ENVVARS Value: Environment Variables - Not Required (Can be null or empty string)

Parameters:
exec_request - A Hashtable containg keys "CMD", "PARAMS", and "ENVVARS" and its values.
 o processRequest
 public boolean processRequest() throws IOException
Start processing request. I.e. connect to ebfServer, send request and read results.

Returns:
IOException
 o getSessionId
 public String getSessionId()
Returns SessionId as supplied by the remove connection. Call to this method is bit tricky. First you must make atleast one call to the 'next()' method. First response from ebfServer is always either a SessionId OR one of the exceptions defined in documentation for next() method.

Returns:
A String containing Session ID for the current request.
 o next
 public String next() throws EndOfResultException, BadRequestException, UnknownErrorException, AccessDeniedException, ServerBusyException
Returns next line of result from remote connection. Note: It throws EndOfResultException when there is no more data available.

Returns:
A String for next line of output from remote connection.
Throws: EndOfResultException
Thrown when end of result is reached and there is no more data available.
Throws: BadRequestException
Thrown when given request format is not acceptable.
Throws: UnknownErrorException
Thrown when remote system encounteres unknown error.
Throws: AccessDeniedException
Thrown when attempt is made to access certain services without providing proper identification.
Throws: IOException
Thrown when IO error encoutered while communicating with remote system.
Throws: ServerBusyException
Thrown when ebfServer is busy and cannot process the request.

All Packages  Class Hierarchy  This Package  Previous  Next  Index