Open SiteSearch 4.1.1
Final

ORG.oclc.z39.client
Class Z39present

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

public class Z39present
extends Object

Z39present creates PresentRequests and translates PresentResponses.


Field Summary
 String[] dbnames
          Array of source database names for each record returned in Response.
 Object[][] duplicateRecords
          Array of duplicate records associated with the records.
 String[][] duplicateRecordsDbnames
          Array of duplicate records dbnames associated with the records.
 String[][] duplicateRecordsSyntax
          Syntax of duplicate returned records.
 int errorCode
          Error code if Present failed.
 String errorMsg
          Error message if Present failed.
 int nextResultsSetPosition
          Starting point for next PresentRequest.
 int numberOfRecordsReturned
          Number of records returned in Response.
 String preferredRecordSyntax
          String data type containing the preferredRecordSyntax in the request
 Vector presentData
          Vector of DbPresentData objects containing the database names and source records returned in the present response.
 int presentStatus
          Status.
 Object[] records
          Array of records returned in Response.
 String[] recordSyntax
          Syntax of returned records.
 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.
 
Constructor Summary
Z39present()
           
Z39present(Z39session z)
           
 
Method Summary
static DataDir decodeBerStringData(Object record, String recordSyntax)
          Decodes an input BerString data object into a DataDir object according to the input Z39.50 record syntax of the record.
 boolean decodeRecords()
           
 void doPresent(int referenceId, String resultSetName, int resultSetStartPoint, int numberOfRecordsRequested, int resultSetEndPoint, String ElementSetNames, String preferredRecordSyntax, boolean fMakeDataDir)
          Creates, sends and proceeses a Z39.50 PresentRequest until the number of Records requested is returned or there is a failure
 BerString Request(int referenceId, String resultSetName, int resultSetStartPoint, int numberOfRecordsRequested, String ElementSetNames, String preferredRecordSyntax)
          Creates a Z39.50 PresentRequest.
 BerString Request(int referenceId, String resultSetName, int resultSetStartPoint, int numberOfRecordsRequested, String ElementSetNames, String preferredRecordSyntax, int extraLen, int offset)
          Creates a Z39.50 PresentRequest.
 void Response(BerString response)
          Processes a Z39.50 PresentResponse.
 void Response(DataDir response)
          Processes a Z39.50 PresentResponse.
 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.

preferredRecordSyntax

public String preferredRecordSyntax
String data type containing the preferredRecordSyntax in the request

numberOfRecordsReturned

public int numberOfRecordsReturned
Number of records returned in Response.

nextResultsSetPosition

public int nextResultsSetPosition
Starting point for next PresentRequest.

presentStatus

public int presentStatus
Status.

errorCode

public int errorCode
Error code if Present failed.

errorMsg

public String errorMsg
Error message if Present failed.

recordSyntax

public String[] recordSyntax
Syntax of returned records.

records

public Object[] records
Array of records returned in Response.

duplicateRecords

public Object[][] duplicateRecords
Array of duplicate records associated with the records.

duplicateRecordsDbnames

public String[][] duplicateRecordsDbnames
Array of duplicate records dbnames associated with the records.

duplicateRecordsSyntax

public String[][] duplicateRecordsSyntax
Syntax of duplicate returned records.

dbnames

public String[] dbnames
Array of source database names for each record returned in Response.

presentData

public Vector presentData
Vector of DbPresentData objects containing the database names and source records returned in the present response.

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.
Constructor Detail

Z39present

public Z39present()

Z39present

public Z39present(Z39session z)
Method Detail

doPresent

public void doPresent(int referenceId,
                      String resultSetName,
                      int resultSetStartPoint,
                      int numberOfRecordsRequested,
                      int resultSetEndPoint,
                      String ElementSetNames,
                      String preferredRecordSyntax,
                      boolean fMakeDataDir)
               throws Exception,
                      Diagnostic1
Creates, sends and proceeses a Z39.50 PresentRequest until the number of Records requested is returned or there is a failure
Parameters:
referenceId - Will be returned on Response.
resultSetName - Identifies the results from a SearchRequest.
resultSetStartPoint - Relative number of first record to Present.
numberOfRecordsRequested - Number of records to return.
resultSetEndPoint - number of postings Plus the relative number of the first record to present
ElementSetNames - Requested data in returned records.
preferredRecordSyntax - Requested syntax of returned records.
fMakeDataDir - flag to indicate whether decode to decode record data into a DataDir which fills in the presentData Vector
Throws:
Exception - exceptions from BerConnect
Diagnostic1 - Z39.50 diagnostics

Request

public BerString Request(int referenceId,
                         String resultSetName,
                         int resultSetStartPoint,
                         int numberOfRecordsRequested,
                         String ElementSetNames,
                         String preferredRecordSyntax)
Creates a Z39.50 PresentRequest.
Parameters:
referenceId - Will be returned on Response.
resultSetName - Identifies the results from a SearchRequest.
resultSetStartPoint - Relative number of first record to Present.
numberOfRecordsRequested - Number of records to return.
ElementSetNames - Requested data in returned records.
preferredRecordSyntax - Requested syntax of returned records.
Returns:
BerString containing Request or null if space was unavailable

Request

public BerString Request(int referenceId,
                         String resultSetName,
                         int resultSetStartPoint,
                         int numberOfRecordsRequested,
                         String ElementSetNames,
                         String preferredRecordSyntax,
                         int extraLen,
                         int offset)
Creates a Z39.50 PresentRequest.
Parameters:
referenceId - Will be returned on Response.
resultSetName - Identifies the results from a SearchRequest.
resultSetStartPoint - Relative number of first record to Present.
numberOfRecordsRequested - Number of records to return.
ElementSetNames - Requested data in returned records.
preferredRecordSyntax - Requested syntax of returned records.
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 PresentResponse.
Parameters:
response - BerString containing response.

Response

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

toString

public String toString()
Overrides:
toString in class Object

decodeRecords

public boolean decodeRecords()

decodeBerStringData

public static final DataDir decodeBerStringData(Object record,
                                                String recordSyntax)
Decodes an input BerString data object into a DataDir object according to the input Z39.50 record syntax of the record.
Parameters:
record - the BerString object.
recordSyntax - the record syntax of the BerString object.
Returns:
DataDir

Open SiteSearch 4.1.1
Final