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
-
Z39Connect(String, int)
-
-
close()
- Close the connection
-
closeDumpFile()
- Close logging file
-
connection()
-
-
doZRequest(BerString)
- Send a request.
-
doZRequest(BerString, String, int)
- Send a request.
-
openDumpFile(String)
- Open a file for logging transactions
-
readZResponse()
- Read a response.
-
sendZRequest(BerString)
- Send a request.
-
toString()
-
Z39Connect
public Z39Connect(String hostname,
int port) throws UnknownHostException, IOException
toString
public String toString()
- Overrides:
- toString in class Object
openDumpFile
public void openDumpFile(String fileName)
- Open a file for logging transactions
closeDumpFile
public void closeDumpFile()
- Close logging file
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
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
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
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
close
public void close() throws IOException
- Close the connection
connection
public Socket connection()
- Returns:
- the connection
All Packages Class Hierarchy This Package Previous Next Index