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.
-
EbfConnector(String, int)
- Constructor for class
EbfConnector.
-
EbfConnector(String, int, int)
- Constructor for class
EbfConnector.
-
getSessionId()
- Returns SessionId as supplied by the remove connection.
-
next()
- Returns next line of result from remote connection.
-
processRequest()
- Start processing request.
-
setCookies(Hashtable)
- Cookies hashtable may contain one or more cookies in the following format:
* Hashtable key: Cookie Name
* Hashtable value: Cookie value.
-
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.
-
setExec(Hashtable)
- Set Hashtable exec_request.
-
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.
-
setIdString(String)
- Login info is required if a connection is being made to the Admin or Peer port of
the EbfServer.
-
setTraceDir(String)
- Use this method for debugging purpose only.
If you are using Servlets, there is no clean way to trace activities.
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
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.
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.
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
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.
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.
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
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.
processRequest
public boolean processRequest() throws IOException
- Start processing request. I.e. connect to ebfServer, send request and read
results.
- Returns:
- IOException
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.
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