Top Description Fields Constructors Methods
org.apache.derby.impl.drda

pack-priv Class Session

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.net.Socket, java.sql.SQLException, java.util.Enumeration, .Hashtable, org.apache.derby.iapi.tools.i18n.LocalizedResource

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

Field Summary

Modifier and TypeField and Description
protected AppRequester
protected static final int
protected static final int
protected Socket
protected static final int
protected static final int
protected int
protected Database
private Hashtable<String, Database>
dbtable

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

AccessConstructor and Description
pack-priv
Session(NetworkServerControlImpl nsctrl, int
connection number
connNum
,
Socket
communications socket for this session
clientSocket
,
String
location for trace files
traceDirectory
,
boolean
whether to start tracing this connection
traceOn
)

Session constructor

Method Summary

Modifier and TypeMethod and Description
protected void
addDatabase(Database d)

Add database to session table

protected String
buildRuntimeInfo(String indent, LocalizedResource localLangUtil)

protected void
close()

Close session - close connection sockets and set state to closed

protected int

Returns:

connection number
getConnNum
()

Get connection number

protected Database
getDatabase(String dbName)

Get database

protected int

Returns:

next required Security checkpoint or -1 if neither ACCSEC or SECCHK are required at this time.
getRequiredSecurityCodepoint
()

Get requried security checkpoint.

private void
initialize(String
- directory for trace files
traceDirectory
)

Get session into initial state

protected void
initTrace(String
- directory for trace file
traceDirectory
,
boolean
- true if we should throw an exception if turning on tracing fails. We do this for NetworkServerControl API commands.
throwException
)

initialize a server trace for the DRDA protocol

protected boolean

Returns:

true if tracing is on false otherwise
isTraceOn
()

Get whether tracing is on

protected boolean

Returns:

true if ACCSEC or SECCHK are required at this time.
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(String
directory for trace files
traceDirectory
,
boolean throwException)

Set tracing on

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

appRequesterback to summary
protected AppRequester appRequester
ATTEXCback to summary
protected static final int ATTEXC
CHKSECback to summary
protected static final int CHKSEC
clientSocketback to summary
protected Socket clientSocket
CLOSEDback to summary
protected static final int CLOSED
CMD_SESSIONback to summary
protected static final int CMD_SESSION
connNumback to summary
protected int connNum
databaseback to summary
protected Database database
dbtableback to summary
private Hashtable<String, Database> dbtable

Table of databases accessed in this session.

DRDA_SESSIONback to summary
protected static final int DRDA_SESSION
drdaIDback to summary
protected String drdaID
dssTraceback to summary
protected DssTrace dssTrace
INITback to summary
protected static final int INIT
langUtilback to summary
protected LocalizedResource langUtil
nsctrlback to summary
private NetworkServerControlImpl nsctrl
qryinsidback to summary
protected int qryinsid
SECACCback to summary
protected static final int SECACC
sessionInputback to summary
protected InputStream sessionInput
sessionOutputback to summary
protected OutputStream sessionOutput
sessionTypeback to summary
protected int sessionType
stateback to summary
protected int state
traceFileNameback to summary
protected String traceFileName
TRACENAME_PREFIXback to summary
private static final String TRACENAME_PREFIX
TRACENAME_SUFFIXback to summary
private static final String TRACENAME_SUFFIX
traceOnback to summary
protected boolean traceOn

Constructor Detail

Sessionback to summary
pack-priv Session(NetworkServerControlImpl nsctrl, int connNum, Socket clientSocket, String traceDirectory, boolean traceOn) throws Exception

Session constructor

Parameters
connNum:int

connection number

clientSocket:Socket

communications socket for this session

traceDirectory:String

location for trace files

traceOn:boolean

whether to start tracing this connection

Method Detail

addDatabaseback to summary
protected void addDatabase(Database d)

Add database to session table

buildRuntimeInfoback to summary
protected String buildRuntimeInfo(String indent, LocalizedResource localLangUtil)
closeback to summary
protected void close() throws SQLException

Close session - close connection sockets and set state to closed

getConnNumback to summary
protected int getConnNum()

Get connection number

Returns:int

connection number

getDatabaseback to summary
protected Database getDatabase(String dbName)

Get database

getRequiredSecurityCodepointback to summary
protected int getRequiredSecurityCodepoint()

Get requried security checkpoint. Used to verify EXCSAT/ACCSEC/SECCHK order.

Returns:int

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

initializeback to summary
private void initialize(String traceDirectory) throws Exception

Get session into initial state

Parameters
traceDirectory:String

- directory for trace files

initTraceback to summary
protected void initTrace(String traceDirectory, boolean throwException) throws Exception

initialize a server trace for the DRDA protocol

Parameters
traceDirectory:String

- directory for trace file

throwException:boolean

- true if we should throw an exception if turning on tracing fails. We do this for NetworkServerControl API commands.

isTraceOnback to summary
protected boolean isTraceOn()

Get whether tracing is on

Returns:boolean

true if tracing is on false otherwise

requiresSecurityCodepointback to summary
protected boolean requiresSecurityCodepoint()

Check if a security codepoint is required

Returns:boolean

true if ACCSEC or SECCHK are required at this time.

setStateback to summary
protected void setState(int s)

Set Session state

setTraceOffback to summary
protected void setTraceOff()

Set tracing off

setTraceOnback to summary
protected void setTraceOn(String traceDirectory, boolean throwException) throws Exception

Set tracing on

Parameters
traceDirectory:String

directory for trace files