Open SiteSearch 4.1.1
Final

ORG.oclc.z39.client
Class Z39scan

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

public class Z39scan
extends Object

Z39scan creates ScanRequests and translates ScanResponses.


Field Summary
 AccessControl accessControl
          AccessControl object created when an access control request is received.
 int errorCode
          Error code if Scan failed.
 String errorMsg
          Error message if Scan failed.
 int numberOfEntriesReturned
          Number of terms returned.
 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.
 int scanStatus
          Status.
 TermInfo[] terms
          Scan results
 Z39session zsession
          Z39session
 
Constructor Summary
Z39scan()
           
Z39scan(Z39session z)
           
 
Method Summary
 void doScan(int referenceId, String databaseName, String term, String resultsAttributes, int stepSize, int numberOfTermsRequested, int preferredPositionInResponse)
          Creates and sends a Z39.50 ScanRequest, processes a Z39.50 Scan Response
protected  void GetScanTerms(DataDir parm)
          Build term, displayTerm and postings arrays from ScanResponse.
protected  String getTerm(String termPlusAttributes)
           
static boolean makeZ39AttributesPlusTerm(String termPlusAttributes, DataDir parent, boolean fNewton)
           
 BerString Request(int referenceId, String databaseName, String term, String resultsAttributes, int stepSize, int numberOfTermsRequested, int preferredPositionInResponse)
          Creates a Z39.50 ScanRequest.
 BerString Request(int referenceId, String databaseName, String term, String resultsAttributes, int stepSize, int numberOfTermsRequested, int preferredPositionInResponse, int extraLen, int offset)
          Creates a Z39.50 ScanRequest.
 void Response(BerString response)
          Processes a Z39.50 ScanResponse.
 void Response(DataDir response)
          Processes a Z39.50 ScanResponse.
 void sortTerms(TermInfo[] sort)
           
 String termsToString()
          Format a newline separated String of terms and postings.
 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.

numberOfEntriesReturned

public int numberOfEntriesReturned
Number of terms returned.

scanStatus

public int scanStatus
Status.

errorCode

public int errorCode
Error code if Scan failed.

errorMsg

public String errorMsg
Error message if Scan failed.

terms

public TermInfo[] terms
Scan results

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.

accessControl

public AccessControl accessControl
AccessControl object created when an access control request is received.

zsession

public Z39session zsession
Z39session
Constructor Detail

Z39scan

public Z39scan()

Z39scan

public Z39scan(Z39session z)
Method Detail

doScan

public void doScan(int referenceId,
                   String databaseName,
                   String term,
                   String resultsAttributes,
                   int stepSize,
                   int numberOfTermsRequested,
                   int preferredPositionInResponse)
            throws Exception,
                   Diagnostic1,
                   AccessControl
Creates and sends a Z39.50 ScanRequest, processes a Z39.50 Scan Response
Parameters:
referenceId - Will be returned on Response.
databaseName - Database to be Scanned.
term - Starting point for Scan.
stepSize - 'N' means Newton indexes ???.
numberOfTermsRequested - How many terms to return.
preferredPositionInResponse - Where the Scan term should appear in the list.
Throws:
Exception - exceptions from BerConnect
Diagnostic1 - Z39.50 Diagnostics
AccessControl - exception when server issues AccessControl request

Request

public BerString Request(int referenceId,
                         String databaseName,
                         String term,
                         String resultsAttributes,
                         int stepSize,
                         int numberOfTermsRequested,
                         int preferredPositionInResponse)
Creates a Z39.50 ScanRequest.
Parameters:
referenceId - Will be returned on Response.
databaseName - Database to be Scanned.
term - Starting point for Scan.
stepSize - 'N' means Newton indexes ???.
numberOfTermsRequested - How many terms to return.
preferredPositionInResponse - Where the Scan term should appear in the list.
Returns:
BerString containing Request or null if space was unavailable.

Request

public BerString Request(int referenceId,
                         String databaseName,
                         String term,
                         String resultsAttributes,
                         int stepSize,
                         int numberOfTermsRequested,
                         int preferredPositionInResponse,
                         int extraLen,
                         int offset)
Creates a Z39.50 ScanRequest.
Parameters:
referenceId - Will be returned on Response.
databaseName - Database to be Scanned.
term - Starting point for Scan.
stepSize - 'N' means Newton indexes ???.
numberOfTermsRequested - How many terms to return.
preferredPositionInResponse - Where the Scan term should appear in the list.
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)
              throws AccessControl
Processes a Z39.50 ScanResponse.
Parameters:
response - BerString containing response.
Throws:
AccessControl - exception when server issues AccessControl request

Response

public void Response(DataDir response)
              throws AccessControl
Processes a Z39.50 ScanResponse.
Parameters:
response - DataDir containing response.
Throws:
AccessControl - exception when server issues AccessControl request

GetScanTerms

protected void GetScanTerms(DataDir parm)
Build term, displayTerm and postings arrays from ScanResponse.
Parameters:
parm - ScanResponse Z39scanApi.entries field.

toString

public String toString()
Overrides:
toString in class Object

termsToString

public String termsToString()
Format a newline separated String of terms and postings. 'united'('united') 17 (use=21;oluc:3;maps:9)

getTerm

protected String getTerm(String termPlusAttributes)

makeZ39AttributesPlusTerm

public static boolean makeZ39AttributesPlusTerm(String termPlusAttributes,
                                                DataDir parent,
                                                boolean fNewton)

sortTerms

public void sortTerms(TermInfo[] sort)

Open SiteSearch 4.1.1
Final