Class 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 Detail

      • 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
      • qryinsid

        protected int qryinsid
      • dbtable

        private java.util.Hashtable<java.lang.String,​Database> dbtable
        Table of databases accessed in this session.
    • 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 number
        clientSocket - communications socket for this session
        traceDirectory - location for trace files
        traceOn - 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 file
        throwException - - 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)