All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.net.InetProtocolClient

java.lang.Object
   |
   +----COM.ibm.net.InetProtocolClient

public abstract class InetProtocolClient
extends Object
The abstract superclass of all COM.ibm.net Internet protocol client classes.

 Copyright (c) Taligent, Inc.  1996 - 1997.
 Copyright (c) IBM Corporation 1996 - 1997.
 All Rights Reserved.
 


Variable Index

 o connected
Indicates a connection to the server has been established.
 o debug
Set debugging information on/off.
 o inStream
Input stream through which server responses are received.
 o multiline
Indicates multiple line server replies.
 o outStream
Output stream through which server commands are sent.
 o port
Server's port number.
 o rc_length
Length of server return codes.
 o server
Server's name or IP address.
 o servSock
Socket used to connect to the server.

Constructor Index

 o InetProtocolClient()
Empty default constructor.
 o InetProtocolClient(int)
Construct an InetProtocolClient with a port number and null server name.
 o InetProtocolClient(String, int)
Construct an InetProtocolClient with the protocol server and port number.

Method Index

 o checkReply(String, String)
Confirm that the reply string begins with the specified confirmation string.
 o close()
Close the connection to the server.
 o connect()
Establish a connection to the server.
 o getReply()
Retrieve the response text from the server.
 o sendCommand(String)
Send a command string to the server.

Variables

 o server
 public String server
Server's name or IP address.

 o port
 public int port
Server's port number.

 o connected
 public boolean connected
Indicates a connection to the server has been established.

 o debug
 public transient boolean debug
Set debugging information on/off.

 o servSock
 protected transient Socket servSock
Socket used to connect to the server.

 o inStream
 protected transient BufferedReader inStream
Input stream through which server responses are received.

 o outStream
 protected transient DataOutputStream outStream
Output stream through which server commands are sent.

 o rc_length
 protected int rc_length
Length of server return codes.

 o multiline
 protected boolean multiline
Indicates multiple line server replies.

Constructors

 o InetProtocolClient
 protected InetProtocolClient()
Empty default constructor.

 o InetProtocolClient
 protected InetProtocolClient(int port)
Construct an InetProtocolClient with a port number and null server name.

 o InetProtocolClient
 protected InetProtocolClient(String server,
                              int port)
Construct an InetProtocolClient with the protocol server and port number.

Methods

 o connect
 protected String connect() throws IOException, ConnectException
Establish a connection to the server. Must be called prior to performing server operations.

Throws: IOException
Could not connect to server
 o close
 protected void close() throws IOException
Close the connection to the server.

Throws: IOException
Could not close server connection
 o checkReply
 protected void checkReply(String reply,
                           String success) throws IOException
Confirm that the reply string begins with the specified confirmation string.

Parameters:
reply - Server reponse to check
success - String indicating success
Throws: IOException
Confirmation failed; exception contains the reply string indicating the error
 o getReply
 protected String getReply() throws IOException
Retrieve the response text from the server.

Returns:
Response string; specific format depends on the protocol but usually contains a reponse code followed by explanatory text or requested data
Throws: IOException
Could not retrieve server response
 o sendCommand
 protected String sendCommand(String cmd) throws IOException
Send a command string to the server. A newline character is sent following the command.

Throws: IOException
Could not send command to the server

All Packages  Class Hierarchy  This Package  Previous  Next  Index