Package org.apache.derby.impl.drda
Class Session
- java.lang.Object
-
- org.apache.derby.impl.drda.Session
-
class Session extends java.lang.ObjectSession stores information about the current session It is used so that a DRDAConnThread can work on any session.
-
-
Field Summary
Fields Modifier and Type Field Description protected AppRequesterappRequesterprotected static intATTEXCprotected static intCHKSECprotected java.net.SocketclientSocketprotected static intCLOSEDprotected static intCMD_SESSIONprotected intconnNumprotected Databasedatabaseprivate java.util.Hashtable<java.lang.String,Database>dbtableTable of databases accessed in this session.protected static intDRDA_SESSIONprotected java.lang.StringdrdaIDprotected DssTracedssTraceprotected static intINITprotected LocalizedResourcelangUtilprivate NetworkServerControlImplnsctrlprotected intqryinsidprotected static intSECACCprotected java.io.InputStreamsessionInputprotected java.io.OutputStreamsessionOutputprotected intsessionTypeprotected intstateprotected java.lang.StringtraceFileNameprivate static java.lang.StringTRACENAME_PREFIXprivate static java.lang.StringTRACENAME_SUFFIXprotected booleantraceOn
-
Constructor Summary
Constructors Constructor Description Session(NetworkServerControlImpl nsctrl, int connNum, java.net.Socket clientSocket, java.lang.String traceDirectory, boolean traceOn)Session constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDatabase(Database d)Add database to session tableprotected java.lang.StringbuildRuntimeInfo(java.lang.String indent, LocalizedResource localLangUtil)protected voidclose()Close session - close connection sockets and set state to closedprotected intgetConnNum()Get connection numberprotected DatabasegetDatabase(java.lang.String dbName)Get databaseprotected intgetRequiredSecurityCodepoint()Get requried security checkpoint.private voidinitialize(java.lang.String traceDirectory)Get session into initial stateprotected voidinitTrace(java.lang.String traceDirectory, boolean throwException)initialize a server trace for the DRDA protocolprotected booleanisTraceOn()Get whether tracing is onprotected booleanrequiresSecurityCodepoint()Check if a security codepoint is requiredprotected voidsetState(int s)Set Session stateprotected voidsetTraceOff()Set tracing offprotected voidsetTraceOn(java.lang.String traceDirectory, boolean throwException)Set tracing on
-
-
-
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<java.lang.String,Database> dbtable
Table of databases accessed in this session.
-
nsctrl
private NetworkServerControlImpl nsctrl
-
-
Constructor Detail
-
Session
Session(NetworkServerControlImpl nsctrl, int connNum, java.net.Socket clientSocket, java.lang.String traceDirectory, boolean traceOn) throws java.lang.Exception
Session constructor- Parameters:
connNum- connection numberclientSocket- communications socket for this sessiontraceDirectory- location for trace filestraceOn- whether to start tracing this connection- Throws:
java.lang.Exception
-
-
Method Detail
-
close
protected void close() throws java.sql.SQLExceptionClose session - close connection sockets and set state to closed- Throws:
java.sql.SQLException
-
initTrace
protected void initTrace(java.lang.String traceDirectory, boolean throwException) throws java.lang.Exceptioninitialize a server trace for the DRDA protocol- Parameters:
traceDirectory- - directory for trace filethrowException- - true if we should throw an exception if turning on tracing fails. We do this for NetworkServerControl API commands.- Throws:
java.io.IOExceptionjava.lang.Exception
-
setTraceOn
protected void setTraceOn(java.lang.String traceDirectory, boolean throwException) throws java.lang.ExceptionSet tracing on- Parameters:
traceDirectory- directory for trace files- Throws:
java.lang.Exception
-
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.lang.ExceptionGet session into initial state- Parameters:
traceDirectory- - directory for trace files- Throws:
java.lang.Exception
-
buildRuntimeInfo
protected java.lang.String buildRuntimeInfo(java.lang.String indent, LocalizedResource localLangUtil)
-
-