Open SiteSearch 4.1.1
Final

ORG.oclc.z39.client
Class Z39init

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

public class Z39init
extends Object

Z39init creates InitRequests and translates InitResponses.


Field Summary
 String[] DBList
          Array of available DatabaseNames.
 String[] DisplayDBList
           
 short failureCode
          Reason InitRequest failed.
 String failureMsg
          Failure message for init request.
 int maximumRecordSize
          Override of preferredMessageSize for retrieval of exceptionally large records.
 String MessageOfTheDay
          String containing message from Z39.50 server.
 String options
          Negotiates whether specific features are available.
 int preferredMessageSize
          Preferred maximum size in bytes of responses to a PresentRequest.
 int referenceId
          Value passed to Request and returned by a target Z39.50 server and Response stores it here.
 int requestLength
          integer data type containing the number of bytes in the request.
 int responseLength
          integer data type containing the number of bytes in the response.
 short result
          'Accept' or 'Reject'.
 String txnId
          Value passed as part of sessionId response containing the transactionId.
 Z39session zsession
          Z39session
 
Constructor Summary
Z39init()
           
Z39init(Z39session z)
           
 
Method Summary
 void doInit(int referenceId, String options, int preferredMessageSize, int maximumRecordSize, String id, String password, String newpassword, DataDir userInformationField, boolean reconnect)
          Creates, sends, and parses the response for a Z39.50 Init.
 String getFailureMsg()
           
 void reInit()
          Reinitializes session to Z39.50 server if connection is gone The init parms to the server are the original parms
 BerString Request(int referenceId, String options, int preferredMessageSize, int maximumRecordSize, String id, String password, String newpassword, DataDir userInformationField, boolean reconnect)
          Creates a Z39.50 InitRequest.
 BerString Request(int referenceId, String options, int preferredMessageSize, int maximumRecordSize, String id, String password, String newpassword, DataDir userInformationField, boolean reconnect, int extraLen, int offset)
          Creates a Z39.50 InitRequest.
 void Response(BerString response)
          Processes a Z39.50 InitResponse.
 void Response(DataDir response)
          Processes a Z39.50 InitResponse.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

referenceId

public int referenceId
Value passed to Request and returned by a target Z39.50 server and Response stores it here.

txnId

public String txnId
Value passed as part of sessionId response containing the transactionId. Response stores it here.

options

public String options
Negotiates whether specific features are available. See Z39.50 Specification.

preferredMessageSize

public int preferredMessageSize
Preferred maximum size in bytes of responses to a PresentRequest. See Z39.50 Specification.

maximumRecordSize

public int maximumRecordSize
Override of preferredMessageSize for retrieval of exceptionally large records. See Z39.50 Specification.

result

public short result
'Accept' or 'Reject'. See Z39.50 Specification.

MessageOfTheDay

public String MessageOfTheDay
String containing message from Z39.50 server.

DBList

public String[] DBList
Array of available DatabaseNames.

DisplayDBList

public String[] DisplayDBList

failureCode

public short failureCode
Reason InitRequest failed.

failureMsg

public String failureMsg
Failure message for init request.

requestLength

public int requestLength
integer data type containing the number of bytes in the request.

responseLength

public int responseLength
integer data type containing the number of bytes in the response.

zsession

public Z39session zsession
Z39session
Constructor Detail

Z39init

public Z39init()

Z39init

public Z39init(Z39session z)
Method Detail

doInit

public void doInit(int referenceId,
                   String options,
                   int preferredMessageSize,
                   int maximumRecordSize,
                   String id,
                   String password,
                   String newpassword,
                   DataDir userInformationField,
                   boolean reconnect)
            throws Exception,
                   Diagnostic1
Creates, sends, and parses the response for a Z39.50 Init.
Parameters:
referenceId - Will be returned on Response and allows Requests and responses to be matched up by the application.
options - See Z39.50 Specification.
preferredMessageSize - See Z39.50 Specification.
maximumRecordSize - See Z39.50 Specification.
id - use null for anonymous access
password - use null for anonymous access
newpassword - See Z39.50 Specification.
userInformationField - See Z39.50 Specification.
Returns:
boolean indicating success of failure of request
Throws:
Exception - caught from BerConnect classes trying to send/receive the message
Diagnostic1 - Z39.50 Diagnostic message

reInit

public void reInit()
            throws Exception,
                   Diagnostic1
Reinitializes session to Z39.50 server if connection is gone The init parms to the server are the original parms
Throws:
Exception - caught from BerConnect classes trying to send/receive the message
Diagnostic1 - Z39.50 Diagnostic message

Request

public BerString Request(int referenceId,
                         String options,
                         int preferredMessageSize,
                         int maximumRecordSize,
                         String id,
                         String password,
                         String newpassword,
                         DataDir userInformationField,
                         boolean reconnect)
Creates a Z39.50 InitRequest.
Parameters:
referenceId - Will be returned on Response and allows Requests and responses to be matched up by the application.
options - See Z39.50 Specification.
preferredMessageSize - See Z39.50 Specification.
maximumRecordSize - See Z39.50 Specification.
id - use null for anonymous access
password - use null for anonymous access
newpassword - See Z39.50 Specification.
userInformationField - See Z39.50 Specification.
Returns:
BerString containing Request or null if space was unavailable

Request

public BerString Request(int referenceId,
                         String options,
                         int preferredMessageSize,
                         int maximumRecordSize,
                         String id,
                         String password,
                         String newpassword,
                         DataDir userInformationField,
                         boolean reconnect,
                         int extraLen,
                         int offset)
Creates a Z39.50 InitRequest.
Parameters:
referenceId - Will be returned on Response and allows Requests and responses to be matched up by the application.
options - See Z39.50 Specification.
preferredMessageSize - See Z39.50 Specification.
maximumRecordSize - See Z39.50 Specification.
id - use null for anonymous access
password - use null for anonymous access
newpassword - See Z39.50 Specification.
userInformationField - See Z39.50 Specification.
reconnect - flag indicating whether to request reconnect information from the server
extraLen - Allow this much extra room in the built BER record.
offset - Build the Request at this offset in the BerString
Returns:
BerString containing Request or null if space was unavailable

Response

public void Response(BerString response)
Processes a Z39.50 InitResponse.
Parameters:
response - BerString containing response.

Response

public void Response(DataDir response)
Processes a Z39.50 InitResponse.
Parameters:
response - DataDir containing response

getFailureMsg

public String getFailureMsg()

toString

public String toString()
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final