All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ORG.oclc.z39.client.Z39Connect

java.lang.Object
   |
   +----ORG.oclc.z39.client.Z39Connect

public class Z39Connect
extends Object
Z39Connect handles the I/0 between a Z39 client and a Z39 server.

Version:
@(#)Z39Connect.java 1.1 07/09/97

Constructor Index

 o Z39Connect(String, int)

Method Index

 o close()
Close the connection
 o closeDumpFile()
Close logging file
 o connection()
 o doZRequest(BerString)
Send a request.
 o doZRequest(BerString, String, int)
Send a request.
 o openDumpFile(String)
Open a file for logging transactions
 o readZResponse()
Read a response.
 o sendZRequest(BerString)
Send a request.
 o toString()

Constructors

 o Z39Connect
 public Z39Connect(String hostname,
                   int port) throws UnknownHostException, IOException

Methods

 o toString
 public String toString()
Overrides:
toString in class Object
 o openDumpFile
 public void openDumpFile(String fileName)
Open a file for logging transactions

 o closeDumpFile
 public void closeDumpFile()
Close logging file

 o doZRequest
 public BerString doZRequest(BerString z_request,
                             String hostname,
                             int port) throws UnknownHostException, EOFException, FileNotFoundException, IOException
Send a request. If the socket connection fails, re-connect to hostname and port. Return a response

Parameters:
z_request - Z39.50 request
hostname - save this hostname for re-connects
port - save this port for re-connects
Returns:
Z39.50 Response
Throws: UnknownHostException
the server cannot be located
Throws: EOFException
the server is unavailable
Throws: FileNotFoundException
the server is unavailable
Throws: IOException
the server is unavailable
 o doZRequest
 public BerString doZRequest(BerString z_request) throws UnknownHostException, EOFException, FileNotFoundException, IOException
Send a request. If the socket connection fails, re-connect to the last specified hostname and port. Return a response

Parameters:
z_request - Z39.50 request
Returns:
Z39.50 Response
Throws: UnknownHostException
the server cannot be located
Throws: EOFException
the server is unavailable
Throws: FileNotFoundException
the server is unavailable
Throws: IOException
the server is unavailable
 o sendZRequest
 public boolean sendZRequest(BerString z_request) throws UnknownHostException, EOFException, FileNotFoundException, IOException
Send a request. If the socket connection fails, re-connect to the last specified hostname and port

Parameters:
z_request - Z39.50 request
Returns:
true if write succeeded
Throws: UnknownHostException
the server cannot be located
Throws: EOFException
the server is unavailable
Throws: FileNotFoundException
the server is unavailable
Throws: IOException
the server is unavailable
 o readZResponse
 public BerString readZResponse() throws UnknownHostException, EOFException, FileNotFoundException, IOException
Read a response. If the socket connection fails, re-connect to the last specified hostname and port

Returns:
Z39.50 response
Throws: UnknownHostException
the server cannot be located
Throws: EOFException
the server is unavailable
Throws: FileNotFoundException
the server is unavailable
Throws: IOException
the server is unavailable
 o close
 public void close() throws IOException
Close the connection

 o connection
 public Socket connection()
Returns:
the connection

All Packages  Class Hierarchy  This Package  Previous  Next  Index