Open SiteSearch 4.1.1
Final

ORG.oclc.zbase.server
Class TransactionHandler

java.lang.Object
  |
  +--ORG.oclc.zbase.server.TransactionHandler

public class TransactionHandler
extends Object
implements Runnable

Process a Z39.50 request. Accepts the request from an ZBaseThread object, invokes a Db object and replies to the client.


Field Summary
protected  DataOutputStream dataOut
          Output stream for response.
protected  boolean holdConnection
          Flag to caller (ZBaseThread) that connection should be held open.
protected  int 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.
 
Method Summary
protected  BerString AccessControl(DataDir dir)
          Z3950 AccessControl Response.
protected  BerString Close(DataDir dir)
          Z39.50 Close request.
protected  BerString Dedup(DataDir dir)
          Z39.50 Dedup request.
protected  BerString Delete(DataDir dir)
          Z39.50 Delete Hitlist request.
protected  BerString Display(DataDir dir)
          Z39.50 Present request.
protected  BerString Extsvc(DataDir dir)
          Z39.50 Extended Services request.
protected  BerString Find(DataDir dir)
          Z39.50 Search request.
static AccessClient getUserAccessClient(String sessionID)
           
 BerString handle(BerString message)
          Handle the request.
protected  BerString Init(DataDir dir)
          Z39.50 Init request.
static void init(IniFile ini, String serverName)
          Invokes the init method with the input IniFile object, serverName and the verbose flag set to true.
static void init(IniFile ini, String serverName, boolean verbose)
          init should only be called once.
 void run()
          Used by ZBaseMultiThread.
protected  BerString Scan(DataDir dir)
          Z39.50 Scan request.
protected  BerString Sort(DataDir dir)
          Z39.50 Sort request.
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 int 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 (ZBaseThread) 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 ZBaseSingleThread.
Method Detail

getUserAccessClient

public static AccessClient getUserAccessClient(String sessionID)

init

public static void init(IniFile ini,
                        String serverName)
Invokes the init method with the input IniFile object, serverName and the verbose flag set to true.
Parameters:
ini - configuration file
name - section name for this thread

init

public static void init(IniFile ini,
                        String serverName,
                        boolean verbose)
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
verbose - flag indicating whether the configuration information should be dumped to the server log.

run

public void run()
Used by ZBaseMultiThread. 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. Write a stats record if the stats object has been initialized.
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

Sort

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

Dedup

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

Scan

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

Display

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

Find

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

Delete

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

Close

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

Extsvc

protected BerString Extsvc(DataDir dir)
Z39.50 Extended Services request.

AccessControl

protected BerString AccessControl(DataDir dir)
Z3950 AccessControl Response.

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