org.apache.derby.impl.drda
Class Session

java.lang.Object
  extended byorg.apache.derby.impl.drda.Session

class Session
extends java.lang.Object

Session stores information about the current session It is used so that a DRDAConnThread can work on any session.


Field Summary
protected  AppRequester appRequester
           
protected static int ATTEXC
           
protected static int CHKSEC
           
protected  java.net.Socket clientSocket
           
protected static int CLOSED
           
protected static int CMD_SESSION
           
protected  int connNum
           
protected  Database database
           
private  java.util.Hashtable dbtable
           
protected static int DRDA_SESSION
           
protected  java.lang.String drdaID
           
protected  DssTrace dssTrace
           
protected static int INIT
           
protected  LocalizedResource langUtil
           
protected  int qryinsid
           
protected static int SECACC
           
protected  java.io.InputStream sessionInput
           
protected  java.io.OutputStream sessionOutput
           
protected  int sessionType
           
protected  int state
           
protected  java.lang.String traceFileName
           
private static java.lang.String TRACENAME_PREFIX
           
private static java.lang.String TRACENAME_SUFFIX
           
protected  boolean traceOn
           
 
Constructor Summary
protected Session(int connNum, java.net.Socket clientSocket, java.lang.String traceDirectory, boolean traceOn)
          Session constructor
 
Method Summary
protected  void addDatabase(Database d)
          Add database to session table
protected  java.lang.String buildRuntimeInfo(java.lang.String indent, LocalizedResource localLangUtil)
           
protected  void close()
          Close session - close connection sockets and set state to closed
protected  int getConnNum()
          Get connection number
protected  Database getDatabase(java.lang.String dbName)
          Get database
protected  int getRequiredSecurityCodepoint()
          Get requried security checkpoint.
private  java.lang.String getStateString(int s)
           
private  java.lang.String getTypeString(int t)
           
private  void initialize(java.lang.String traceDirectory)
          Get session into initial state
protected  void initTrace(java.lang.String traceDirectory)
          initialize a server trace for the DRDA protocol
protected  boolean isTraceOn()
          Get whether tracing is on
protected  boolean requiresSecurityCodepoint()
          Check if a security codepoint is required
protected  void setState(int s)
          Set Session state
protected  void setTraceOff()
          Set tracing off
protected  void setTraceOn(java.lang.String traceDirectory)
          Set tracing on
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT

protected static final int INIT
See Also:
Constant Field Values

ATTEXC

protected static final int ATTEXC
See Also:
Constant Field Values

SECACC

protected static final int SECACC
See Also:
Constant Field Values

CHKSEC

protected static final int CHKSEC
See Also:
Constant Field Values

CLOSED

protected static final int CLOSED
See Also:
Constant Field Values

DRDA_SESSION

protected static final int DRDA_SESSION
See Also:
Constant Field Values

CMD_SESSION

protected static final int CMD_SESSION
See Also:
Constant Field Values

TRACENAME_PREFIX

private static final java.lang.String TRACENAME_PREFIX
See Also:
Constant Field Values

TRACENAME_SUFFIX

private static final java.lang.String TRACENAME_SUFFIX
See Also:
Constant Field Values

clientSocket

protected java.net.Socket clientSocket

connNum

protected int connNum

sessionInput

protected java.io.InputStream sessionInput

sessionOutput

protected java.io.OutputStream sessionOutput

traceFileName

protected java.lang.String traceFileName

traceOn

protected boolean traceOn

state

protected int state

sessionType

protected int sessionType

drdaID

protected java.lang.String drdaID

dssTrace

protected DssTrace dssTrace

appRequester

protected AppRequester appRequester

database

protected Database database

qryinsid

protected int qryinsid

langUtil

protected LocalizedResource langUtil

dbtable

private java.util.Hashtable dbtable
Constructor Detail

Session

protected Session(int connNum,
                  java.net.Socket clientSocket,
                  java.lang.String traceDirectory,
                  boolean traceOn)
           throws java.io.IOException
Session constructor

Parameters:
connNum - connection number
clientSocket - communications socket for this session
traceDirectory - location for trace files
traceOn - whether to start tracing this connection
Throws:
throws - IOException
java.io.IOException
Method Detail

close

protected void close()
              throws java.sql.SQLException
Close session - close connection sockets and set state to closed

Throws:
java.sql.SQLException

initTrace

protected void initTrace(java.lang.String traceDirectory)
initialize a server trace for the DRDA protocol

Parameters:
traceDirectory - - directory for trace file

setTraceOn

protected void setTraceOn(java.lang.String traceDirectory)
Set tracing on

Parameters:
traceDirectory - directory for trace files

isTraceOn

protected boolean isTraceOn()
Get whether tracing is on

Returns:
true if tracing is on false otherwise

getConnNum

protected int getConnNum()
Get connection number

Returns:
connection number

setTraceOff

protected void setTraceOff()
Set tracing off


addDatabase

protected void addDatabase(Database d)
Add database to session table


getDatabase

protected Database getDatabase(java.lang.String dbName)
Get database


getRequiredSecurityCodepoint

protected int getRequiredSecurityCodepoint()
Get requried security checkpoint. Used to verify EXCSAT/ACCSEC/SECCHK order.

Returns:
next required Security checkpoint or -1 if neither ACCSEC or SECCHK are required at this time.

requiresSecurityCodepoint

protected boolean requiresSecurityCodepoint()
Check if a security codepoint is required

Returns:
true if ACCSEC or SECCHK are required at this time.

setState

protected void setState(int s)
Set Session state


initialize

private void initialize(java.lang.String traceDirectory)
                 throws java.io.IOException
Get session into initial state

Parameters:
traceDirectory - - directory for trace files
Throws:
java.io.IOException

buildRuntimeInfo

protected java.lang.String buildRuntimeInfo(java.lang.String indent,
                                            LocalizedResource localLangUtil)

getStateString

private java.lang.String getStateString(int s)

getTypeString

private java.lang.String getTypeString(int t)

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.