Open SiteSearch 4.1.1
Final

ORG.oclc.z39.client
Class Z39sort

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

public class Z39sort
extends Object

Z39sort creates SortRequests and translates SortResponses.


Field Summary
 int errorCode
           
 String errorMsg
          Error message if Sort failed.
 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 sortStatus
          Status.
 
Constructor Summary
Z39sort()
           
Z39sort(Z39session z)
           
 
Method Summary
 void doSort(int referenceId, String resultSetName, String sortResultSetName, String[] sortKeys, int[] sortOrder, boolean fUseSortAttributes, boolean sortAccrossDatabases)
          Creates and sends a Z39.50 SortRequest, gets and processes the Z39.50 response
 BerString Request(int referenceId, String resultSetName, String sortResultSetName, String[] sortKeys, int[] sortOrder, boolean fUseSortAttributes)
          Creates a Z39.50 SortRequest.
 BerString Request(int referenceId, String resultSetName, String sortResultSetName, String[] sortKeys, int[] sortOrder, boolean fUseSortAttributes, boolean sortAccrossDatabases)
          Creates a Z39.50 SortRequest.
 BerString Request(int referenceId, String resultSetName, String sortResultSetName, String[] sortKeys, int[] sortOrder, boolean fUseSortAttributes, boolean sortAccrossDatabases, int extraLen, int offset)
          Creates a Z39.50 SortRequest.
 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.

sortStatus

public int sortStatus
Status.

errorCode

public int errorCode

errorMsg

public String errorMsg
Error message if Sort failed.

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

Z39sort

public Z39sort(Z39session z)

Z39sort

public Z39sort()
Method Detail

doSort

public void doSort(int referenceId,
                   String resultSetName,
                   String sortResultSetName,
                   String[] sortKeys,
                   int[] sortOrder,
                   boolean fUseSortAttributes,
                   boolean sortAccrossDatabases)
            throws Exception,
                   Diagnostic1
Creates and sends a Z39.50 SortRequest, gets and processes the Z39.50 response
Parameters:
referenceId - Will be returned on Response.
resultSetName - name of the resultSet to sort
sortResultSetName - name of the sorted resultSet
sortKeys - array of sort keys
sortOrder - array of the order to sort corresponding to the sort keys
fUseSortAttributes - flag to indicate how to build the sort request. true=request uses the sortAttributes encoding. see the Z39.50 specification
sortAccrossDatabases - flag to indicate to tell the ZBase that the results should be the sort of all the records from all the databases in the group vs. having the sorts be within each db not merged together where true indicates to sort accross database boundaries.
Throws:
Exception - exceptions from Z39 send/receive
Diagnostic1 - Z39.50 diagnostics

Request

public BerString Request(int referenceId,
                         String resultSetName,
                         String sortResultSetName,
                         String[] sortKeys,
                         int[] sortOrder,
                         boolean fUseSortAttributes)
Creates a Z39.50 SortRequest.
Parameters:
referenceId - Will be returned on Response.
resultSetName - name of the resultSet to sort
sortResultSetName - name of the sorted resultSet
sortKeys - array of sort keys
sortOrder - array of the order to sort corresponding to the sort keys
fUseSortAttributes - flag to indicate how to build the sort request. true=request uses the sortAttributes encoding. see the Z39.50 specification
Returns:
BerString containing Request or null if space was unavailable

Request

public BerString Request(int referenceId,
                         String resultSetName,
                         String sortResultSetName,
                         String[] sortKeys,
                         int[] sortOrder,
                         boolean fUseSortAttributes,
                         boolean sortAccrossDatabases)
Creates a Z39.50 SortRequest.
Parameters:
referenceId - Will be returned on Response.
resultSetName - name of the resultSet to sort
sortResultSetName - name of the sorted resultSet
sortKeys - array of sort keys
sortOrder - array of the order to sort corresponding to the sort keys
fUseSortAttributes - flag to indicate how to build the sort request. true=request uses the sortAttributes encoding. see the Z39.50 specification
sortAccrossDatabases - flag to indicate to tell the ZBase that the results should be the sort of all the records from all the databases in the group vs. having the sorts be within each db not merged together where true indicates to sort accross database boundaries.
Returns:
BerString containing Request or null if space was unavailable

Request

public BerString Request(int referenceId,
                         String resultSetName,
                         String sortResultSetName,
                         String[] sortKeys,
                         int[] sortOrder,
                         boolean fUseSortAttributes,
                         boolean sortAccrossDatabases,
                         int extraLen,
                         int offset)
Creates a Z39.50 SortRequest.
Parameters:
referenceId - Will be returned on Response.
resultSetName - name of the resultSet to sort
sortResultSetName - name of the sorted resultSet
sortKeys - array of sort keys up to 6
sortOrder - array of the order to sort corresponding to the sort keys
fUseSortAttributes - flag to indicate how to build the sort request. true=request uses the sortAttributes encoding. see the Z39.50 specification
sortAccrossDatabases - flag to indicate to tell the ZBase that the results should be the sort of all the records from all the databases in the group vs. having the sorts be within each db not merged together where true indicates to sort accross database boundaries.
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)

Response

public void Response(DataDir response)

toString

public String toString()
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final