Package org.apache.derby.impl.drda
Class Session
java.lang.Object
org.apache.derby.impl.drda.Session
Session stores information about the current session
It is used so that a DRDAConnThread can work on any session.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AppRequester
protected static final int
protected static final int
protected Socket
protected static final int
protected static final int
protected int
protected Database
Table of databases accessed in this session.protected static final int
protected String
protected DssTrace
protected static final int
protected LocalizedResource
private NetworkServerControlImpl
protected int
protected static final int
protected InputStream
protected OutputStream
protected int
protected int
protected String
private static final String
private static final String
protected boolean
-
Constructor Summary
ConstructorsConstructorDescriptionSession
(NetworkServerControlImpl nsctrl, int connNum, Socket clientSocket, String traceDirectory, boolean traceOn) Session constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add database to session tableprotected String
buildRuntimeInfo
(String indent, LocalizedResource localLangUtil) protected void
close()
Close session - close connection sockets and set state to closedprotected int
Get connection numberprotected Database
getDatabase
(String dbName) Get databaseprotected int
Get requried security checkpoint.private void
initialize
(String traceDirectory) Get session into initial stateprotected void
initialize a server trace for the DRDA protocolprotected boolean
Get whether tracing is onprotected boolean
Check if a security codepoint is requiredprotected void
setState
(int s) Set Session stateprotected void
Set tracing offprotected void
setTraceOn
(String traceDirectory, boolean throwException) Set tracing on
-
Field Details
-
INIT
protected static final int INIT- See Also:
-
ATTEXC
protected static final int ATTEXC- See Also:
-
SECACC
protected static final int SECACC- See Also:
-
CHKSEC
protected static final int CHKSEC- See Also:
-
CLOSED
protected static final int CLOSED- See Also:
-
DRDA_SESSION
protected static final int DRDA_SESSION- See Also:
-
CMD_SESSION
protected static final int CMD_SESSION- See Also:
-
TRACENAME_PREFIX
- See Also:
-
TRACENAME_SUFFIX
- See Also:
-
clientSocket
-
connNum
protected int connNum -
sessionInput
-
sessionOutput
-
traceFileName
-
traceOn
protected boolean traceOn -
state
protected int state -
sessionType
protected int sessionType -
drdaID
-
dssTrace
-
appRequester
-
database
-
qryinsid
protected int qryinsid -
langUtil
-
dbtable
Table of databases accessed in this session. -
nsctrl
-
-
Constructor Details
-
Session
Session(NetworkServerControlImpl nsctrl, int connNum, Socket clientSocket, String traceDirectory, boolean traceOn) throws Exception Session constructor- Parameters:
connNum
- connection numberclientSocket
- communications socket for this sessiontraceDirectory
- location for trace filestraceOn
- whether to start tracing this connection- Throws:
Exception
-
-
Method Details
-
close
Close session - close connection sockets and set state to closed- Throws:
SQLException
-
initTrace
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:
IOException
Exception
-
setTraceOn
Set tracing on- Parameters:
traceDirectory
- directory for trace files- Throws:
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
Add database to session table -
getDatabase
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
Get session into initial state- Parameters:
traceDirectory
- - directory for trace files- Throws:
Exception
-
buildRuntimeInfo
-