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 AppRequesterprotected static final intprotected static final intprotected Socketprotected static final intprotected static final intprotected intprotected DatabaseTable of databases accessed in this session.protected static final intprotected Stringprotected DssTraceprotected static final intprotected LocalizedResourceprivate NetworkServerControlImplprotected intprotected static final intprotected InputStreamprotected OutputStreamprotected intprotected intprotected Stringprivate static final Stringprivate static final Stringprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionSession(NetworkServerControlImpl nsctrl, int connNum, Socket clientSocket, String traceDirectory, boolean traceOn) Session constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd database to session tableprotected StringbuildRuntimeInfo(String indent, LocalizedResource localLangUtil) protected voidclose()Close session - close connection sockets and set state to closedprotected intGet connection numberprotected DatabasegetDatabase(String dbName) Get databaseprotected intGet requried security checkpoint.private voidinitialize(String traceDirectory) Get session into initial stateprotected voidinitialize a server trace for the DRDA protocolprotected booleanGet whether tracing is onprotected booleanCheck if a security codepoint is requiredprotected voidsetState(int s) Set Session stateprotected voidSet tracing offprotected voidsetTraceOn(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
-
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:
IOExceptionException
-
setTraceOn
-
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
-
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
-
buildRuntimeInfo
-