Package org.apache.derby.impl.drda
Class Session
- java.lang.Object
-
- org.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
Fields Modifier and Type Field Description 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<java.lang.String,Database>
dbtable
Table of databases accessed in this session.protected static int
DRDA_SESSION
protected java.lang.String
drdaID
protected DssTrace
dssTrace
protected static int
INIT
protected LocalizedResource
langUtil
private NetworkServerControlImpl
nsctrl
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
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 void
addDatabase(Database d)
Add database to session tableprotected java.lang.String
buildRuntimeInfo(java.lang.String indent, LocalizedResource localLangUtil)
protected void
close()
Close session - close connection sockets and set state to closedprotected int
getConnNum()
Get connection numberprotected Database
getDatabase(java.lang.String dbName)
Get databaseprotected int
getRequiredSecurityCodepoint()
Get requried security checkpoint.private void
initialize(java.lang.String traceDirectory)
Get session into initial stateprotected void
initTrace(java.lang.String traceDirectory, boolean throwException)
initialize a server trace for the DRDA protocolprotected boolean
isTraceOn()
Get whether tracing is onprotected boolean
requiresSecurityCodepoint()
Check if a security codepoint is requiredprotected void
setState(int s)
Set Session stateprotected void
setTraceOff()
Set tracing offprotected void
setTraceOn(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.SQLException
Close 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.Exception
initialize 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.IOException
java.lang.Exception
-
setTraceOn
protected void setTraceOn(java.lang.String traceDirectory, boolean throwException) throws java.lang.Exception
Set 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.Exception
Get 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)
-
-