Open SiteSearch 4.1.1
Final

ORG.oclc.z39.client
Class Z39search

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

public class Z39search
extends Object

Z39search creates SearchRequests and translates SearchResponses.


Field Summary
 AccessControl accessControl
          AccessControl object created when an access control request is received.
 TermComponentPostings[] componentResults
          TermComponentPostings Information, if present.
 DbResults[] dbResults
          Search Results information.
 int errorCode
          Error code if Search failed.
 String errorMsg
          Error message if Search failed.
 oclcUserInformation7 oclc7
          The partial search results information.
 oclcUserInformation8 oclc8
          The ranked query results.
 Z39present Present
          PresentResponse if piggybacked Present was requested.
 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 resultCount
          Number of records located by Search.
 int resultSetStatus
          Piggybacked Present Status.
 int searchStatus
          Status.
 Z39session zsession
          Z39session
 
Constructor Summary
Z39search()
           
Z39search(Z39session z)
           
 
Method Summary
 void doSearch(int referenceId, int smallSetUpperBound, int largeSetLowerBound, int mediumSetPresentNumber, int replaceIndicator, String resultSetName, String databaseNames, String smallSetElementSetNames, String mediumSetElementSetNames, String preferredRecordSyntax, String query, int query_type, String searchResultsOID, DataDir Z39attributesPlusTerm, boolean fMakeDataDir)
          Creates and sends a Z39.50 SearchRequest, gets and processes the Z3950 response
 void doSearch(int referenceId, int smallSetUpperBound, int largeSetLowerBound, int mediumSetPresentNumber, int replaceIndicator, String resultSetName, String databaseNames, String smallSetElementSetNames, String mediumSetElementSetNames, String preferredRecordSyntax, String query, int query_type, String searchResultsOID, DataDir Z39attributesPlusTerm, DataDir oclcUserInfo, String oclcUserInfoOID, Object rankQuery, String rankOID, boolean fMakeDataDir)
          Creates and sends a Z39.50 SearchRequest, gets and processes the Z39.50 response
static boolean makeZ39AttributesPlusTerm(DataDir dir, String query, int query_type)
           
static boolean makeZ39AttributesPlusTerm(DataDir dir, String query, int query_type, boolean addOIDData)
           
 BerString Request(int referenceId, int smallSetUpperBound, int largeSetLowerBound, int mediumSetPresentNumber, int replaceIndicator, String resultSetName, String databaseNames, String smallSetElementSetNames, String mediumSetElementSetNames, String preferredRecordSyntax, String query, int query_type, String searchResultsOID, DataDir Z39attributesPlusTerm)
          Creates a Z39.50 SearchRequest.
 BerString Request(int referenceId, int smallSetUpperBound, int largeSetLowerBound, int mediumSetPresentNumber, int replaceIndicator, String resultSetName, String databaseNames, String smallSetElementSetNames, String mediumSetElementSetNames, String preferredRecordSyntax, String query, int query_type, String searchResultsOID, DataDir Z39attributesPlusTerm, DataDir oclcUserInfo, String oclcUserInfoOID, Object rankQuery, String rankOID)
           
 BerString Request(int referenceId, int smallSetUpperBound, int largeSetLowerBound, int mediumSetPresentNumber, int replaceIndicator, String resultSetName, String databaseNames, String smallSetElementSetNames, String mediumSetElementSetNames, String preferredRecordSyntax, String query, int query_type, String searchResultsOID, DataDir Z39attributesPlusTerm, DataDir oclcUserInfo, String oclcUserInfoOID, Object rankQuery, String rankOID, int extraLen, int offset)
          Creates a Z39.50 SearchRequest.
 void Response(BerString response)
           
 void Response(DataDir response)
           
 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.

resultCount

public int resultCount
Number of records located by Search.

searchStatus

public int searchStatus
Status.

resultSetStatus

public int resultSetStatus
Piggybacked Present Status.

errorCode

public int errorCode
Error code if Search failed.

errorMsg

public String errorMsg
Error message if Search failed.

Present

public Z39present Present
PresentResponse if piggybacked Present was requested.

dbResults

public DbResults[] dbResults
Search Results information.

oclc7

public oclcUserInformation7 oclc7
The partial search results information.

oclc8

public oclcUserInformation8 oclc8
The ranked query results.

componentResults

public TermComponentPostings[] componentResults
TermComponentPostings Information, if present.

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

Z39search

public Z39search(Z39session z)

Z39search

public Z39search()
Method Detail

doSearch

public void doSearch(int referenceId,
                     int smallSetUpperBound,
                     int largeSetLowerBound,
                     int mediumSetPresentNumber,
                     int replaceIndicator,
                     String resultSetName,
                     String databaseNames,
                     String smallSetElementSetNames,
                     String mediumSetElementSetNames,
                     String preferredRecordSyntax,
                     String query,
                     int query_type,
                     String searchResultsOID,
                     DataDir Z39attributesPlusTerm,
                     boolean fMakeDataDir)
              throws Exception,
                     Diagnostic1,
                     AccessControl
Creates and sends a Z39.50 SearchRequest, gets and processes the Z3950 response
Parameters:
referenceId - Will be returned on Response.
smallSetUpperBound - Result set boundary to return all records.
largeSetLowerBound - Result set boundary to return no records.
mediumSetPresentNumber - Number of records to return for medium sets.
replaceIndicator - Indicates response in cases where the resultSetName already exists.
resultSetName - Identifies the results from a SearchRequest.
databaseNames - Set of databases to which the query applies.
smallSetElementSetNames - Preferred composition of records.
mediumSetElementSetNames - Preferred composition of records.
preferredRecordSyntax - Requested syntax of returned records.
query - Search query.
query_type - Identifies the type of query. Types 0, 1, 100 & 101 are supported.
searchResultsOID - Requests additional information to be returned with search.
Z39attributesPlusTerm - the pre-built z39.50 query part
fMakeDataDir - flag indicating whether to convert returned recs to DataDir format
Throws:
Exception - exceptions from BerConnect
Diagnostic1 - Z39.50 diagnostics

doSearch

public void doSearch(int referenceId,
                     int smallSetUpperBound,
                     int largeSetLowerBound,
                     int mediumSetPresentNumber,
                     int replaceIndicator,
                     String resultSetName,
                     String databaseNames,
                     String smallSetElementSetNames,
                     String mediumSetElementSetNames,
                     String preferredRecordSyntax,
                     String query,
                     int query_type,
                     String searchResultsOID,
                     DataDir Z39attributesPlusTerm,
                     DataDir oclcUserInfo,
                     String oclcUserInfoOID,
                     Object rankQuery,
                     String rankOID,
                     boolean fMakeDataDir)
              throws Exception,
                     Diagnostic1,
                     AccessControl
Creates and sends a Z39.50 SearchRequest, gets and processes the Z39.50 response
Parameters:
referenceId - Will be returned on Response.
smallSetUpperBound - Result set boundary to return all records.
largeSetLowerBound - Result set boundary to return no records.
mediumSetPresentNumber - Number of records to return for medium sets.
replaceIndicator - Indicates response in cases where the resultSetName already exists.
resultSetName - Identifies the results from a SearchRequest.
databaseNames - Set of databases to which the query applies.
smallSetElementSetNames - Preferred composition of records.
mediumSetElementSetNames - Preferred composition of records.
preferredRecordSyntax - Requested syntax of returned records.
query - Search query.
query_type - Identifies the type of query. Types 0, 1, 100 & 101 are supported.
searchResultsOID - Requests additional information to be returned with search.
Z39attributesPlusTerm - the pre-built z39.50 query part
oclcUserInfo - additional search info that is ready to add to the request
oclcUserInfoOID - object identifier for the additional search info
rankQuery - type 101 query (DataDir) or RPN (String) query for ranking the result set
rankOID - ranking algorithm identifier
fMakeDataDir - flag indicating whether to convert returned recs to DataDir format
Throws:
Exception - exceptions from BerConnect
Diagnostic1 - Z39.50 diagnostics

Request

public BerString Request(int referenceId,
                         int smallSetUpperBound,
                         int largeSetLowerBound,
                         int mediumSetPresentNumber,
                         int replaceIndicator,
                         String resultSetName,
                         String databaseNames,
                         String smallSetElementSetNames,
                         String mediumSetElementSetNames,
                         String preferredRecordSyntax,
                         String query,
                         int query_type,
                         String searchResultsOID,
                         DataDir Z39attributesPlusTerm)
Creates a Z39.50 SearchRequest.
Parameters:
referenceId - Will be returned on Response.
smallSetUpperBound - Result set boundary to return all records.
largeSetLowerBound - Result set boundary to return no records.
mediumSetPresentNumber - Number of records to return for medium sets.
replaceIndicator - Indicates response in cases where the resultSetName already exists.
resultSetName - Identifies the results from a SearchRequest.
databaseNames - Set of databases to which the query applies.
smallSetElementSetNames - Preferred composition of records.
mediumSetElementSetNames - Preferred composition of records.
preferredRecordSyntax - Requested syntax of returned records.
query - Search query.
query_type - Identifies the type of query. Types 0, 1, 100 & 101 are supported.
searchResultsOID - Requests additional information to be returned with search.
Z39attributesPlusTerm - the pre-built z39.50 query part
Returns:
BerString containing Request or null if space was unavailable

Request

public BerString Request(int referenceId,
                         int smallSetUpperBound,
                         int largeSetLowerBound,
                         int mediumSetPresentNumber,
                         int replaceIndicator,
                         String resultSetName,
                         String databaseNames,
                         String smallSetElementSetNames,
                         String mediumSetElementSetNames,
                         String preferredRecordSyntax,
                         String query,
                         int query_type,
                         String searchResultsOID,
                         DataDir Z39attributesPlusTerm,
                         DataDir oclcUserInfo,
                         String oclcUserInfoOID,
                         Object rankQuery,
                         String rankOID)

Request

public BerString Request(int referenceId,
                         int smallSetUpperBound,
                         int largeSetLowerBound,
                         int mediumSetPresentNumber,
                         int replaceIndicator,
                         String resultSetName,
                         String databaseNames,
                         String smallSetElementSetNames,
                         String mediumSetElementSetNames,
                         String preferredRecordSyntax,
                         String query,
                         int query_type,
                         String searchResultsOID,
                         DataDir Z39attributesPlusTerm,
                         DataDir oclcUserInfo,
                         String oclcUserInfoOID,
                         Object rankQuery,
                         String rankOID,
                         int extraLen,
                         int offset)
Creates a Z39.50 SearchRequest.
Parameters:
referenceId - Will be returned on Response.
smallSetUpperBound - Result set boundary to return all records.
largeSetLowerBound - Result set boundary to return no records.
mediumSetPresentNumber - Number of records to return for medium sets.
replaceIndicator - Indicates response in cases where the resultSetName already exists.
resultSetName - Identifies the results from a SearchRequest.
databaseNames - Set of databases to which the query applies.
smallSetElementSetNames - Preferred composition of records.
mediumSetElementSetNames - Preferred composition of records.
preferredRecordSyntax - Requested syntax of returned records.
query - Search query.
query_type - Identifies the type of query. Types 0, 1, 100 & 101 are supported.
searchResultsOID - Requests additional information to be returned with search.
Z39attributesPlusTerm - the pre-built z39.50 query part
oclcUserInfo - additional search info that is ready to add to the request
oclcUserInfoOID - object identifier for the additional search info
rankQuery - type 101 query (DataDir) or RPN (String) query for ranking the result set
rankOID - ranking algorithm identifier
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

makeZ39AttributesPlusTerm

public static final boolean makeZ39AttributesPlusTerm(DataDir dir,
                                                      String query,
                                                      int query_type)

makeZ39AttributesPlusTerm

public static final boolean makeZ39AttributesPlusTerm(DataDir dir,
                                                      String query,
                                                      int query_type,
                                                      boolean addOIDData)

Response

public void Response(BerString response)
              throws AccessControl

Response

public void Response(DataDir response)
              throws AccessControl

toString

public String toString()
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final