Open SiteSearch 4.1.1
Final

ORG.oclc.zbroker
Class TransactionHandler

java.lang.Object
  |
  +--ORG.oclc.zbroker.TransactionHandler

public class TransactionHandler
extends Object
implements Runnable

Process a Z39.50 request. Accepts the request from an ZBrokerThread object, passes the message to the correct ZBrokerClient object and replies to the client.


Field Summary
protected  DataOutputStream dataOut
          Output stream for response.
protected  boolean holdConnection
          Flag to caller (ZBrokerThread) that connection should be held open.
protected  String lastNewSessionId
          Last assigned session id.
protected  BerString message
          Z39.50 request.
protected  BerString response
          Z39.50 response.
 
Constructor Summary
TransactionHandler()
          Just initialize the thread group.
TransactionHandler(BerString message, ThreadGroup t, DataOutputStream dataOut)
          Set up and run().
 
Method Summary
protected  BerString Close(DataDir dir)
          Z39.50 Close request.
protected  BerString DedupError(DataDir dir, Diagnostic1 d)
          Z39.50 DedupError response.
protected  BerString DeleteError(DataDir dir, Diagnostic1 d)
          Z39.50 Delete Hitlist Error response.
protected  BerString ExtsvcError(DataDir dir, Diagnostic1 d)
          Z39.50 Extended Services request.
 BerString handle(BerString message)
          Handle the request.
protected  BerString Init(DataDir dir)
          Z39.50 Init request.
static void init(IniFile ini, String serverName)
          init should only be called once.
protected  BerString PresentError(DataDir dir, Diagnostic1 d)
          Z39.50 PresentError response.
 void run()
          Used by ZBrokerMultiThread.
protected  BerString ScanError(DataDir dir, Diagnostic1 d)
          Z39.50 ScanError response.
protected  BerString SearchError(DataDir dir, Diagnostic1 d)
          Z39.50 SearchError response.
protected  BerString sendRequest(DataDir dir, boolean expectResponse)
          Z39.50 Request.
protected  BerString SortError(DataDir dir, Diagnostic1 d)
          Z39.50 SortError response.
protected  void Stop(DataDir dir)
          Z39.50 Trigger Resource Control request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

protected BerString message
Z39.50 request.

response

protected BerString response
Z39.50 response.

dataOut

protected DataOutputStream dataOut
Output stream for response.

lastNewSessionId

protected String lastNewSessionId
Last assigned session id. A traditional (connection-full) Z39.50 connection gets its session id from this. A connection-less Z39.50 connections gets its session id from the request.

holdConnection

protected boolean holdConnection
Flag to caller (ZBrokerThread) that connection should be held open. This is set to true when the client is a traditional (connection-full) Z39.50 connection.
Constructor Detail

TransactionHandler

public TransactionHandler()
Just initialize the thread group. Used by ZBrokerSingleThread.

TransactionHandler

public TransactionHandler(BerString message,
                          ThreadGroup t,
                          DataOutputStream dataOut)
Set up and run(). Used by ZBrokerMultiThread.
Method Detail

init

public static void init(IniFile ini,
                        String serverName)
init should only be called once. It sets some static variables and opens the databases.
Parameters:
ini - configuration file
name - section name for this thread

run

public void run()
Used by ZBrokerMultiThread. Handle the message and respond to dataOut.
Specified by:
run in interface Runnable

handle

public BerString handle(BerString message)
Handle the request. Invoke an action method based on the fldid of the request.
Parameters:
message - the request
Returns:
the response

Init

protected BerString Init(DataDir dir)
Z39.50 Init request.
Parameters:
sessionId - the assigned session id
dir - the request
Returns:
the response

sendRequest

protected BerString sendRequest(DataDir dir,
                                boolean expectResponse)
Z39.50 Request.
Parameters:
dir - the request
Returns:
the response

SortError

protected BerString SortError(DataDir dir,
                              Diagnostic1 d)
Z39.50 SortError response.
Parameters:
dir - the request
Returns:
the response

DedupError

protected BerString DedupError(DataDir dir,
                               Diagnostic1 d)
Z39.50 DedupError response.
Parameters:
dir - the request
Returns:
the response

ScanError

protected BerString ScanError(DataDir dir,
                              Diagnostic1 d)
Z39.50 ScanError response.
Parameters:
dir - the request
Returns:
the response

PresentError

protected BerString PresentError(DataDir dir,
                                 Diagnostic1 d)
Z39.50 PresentError response.
Parameters:
dir - the request
Returns:
the response

SearchError

protected BerString SearchError(DataDir dir,
                                Diagnostic1 d)
Z39.50 SearchError response.
Parameters:
dir - the request
Returns:
the response

DeleteError

protected BerString DeleteError(DataDir dir,
                                Diagnostic1 d)
Z39.50 Delete Hitlist Error response.
Parameters:
dir - the request
Returns:
the response

Close

protected BerString Close(DataDir dir)
Z39.50 Close request.
Parameters:
dir - the request
Returns:
the response

ExtsvcError

protected BerString ExtsvcError(DataDir dir,
                                Diagnostic1 d)
Z39.50 Extended Services request.

Stop

protected void Stop(DataDir dir)
Z39.50 Trigger Resource Control request.
Parameters:
dir - the request
Returns:
the response

Open SiteSearch 4.1.1
Final