Class Session

java.lang.Object
org.apache.derby.impl.drda.Session

class Session extends Object
Session stores information about the current session It is used so that a DRDAConnThread can work on any session.
  • Field Details

  • Constructor Details

    • Session

      Session(NetworkServerControlImpl nsctrl, int connNum, Socket clientSocket, String traceDirectory, boolean traceOn) throws 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:
      Exception
  • Method Details

    • close

      protected void close() throws SQLException
      Close session - close connection sockets and set state to closed
      Throws:
      SQLException
    • initTrace

      protected void initTrace(String traceDirectory, boolean throwException) throws 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:
      IOException
      Exception
    • setTraceOn

      protected void setTraceOn(String traceDirectory, boolean throwException) throws Exception
      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

      protected void addDatabase(Database d)
      Add database to session table
    • getDatabase

      protected Database getDatabase(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(String traceDirectory) throws Exception
      Get session into initial state
      Parameters:
      traceDirectory - - directory for trace files
      Throws:
      Exception
    • buildRuntimeInfo

      protected String buildRuntimeInfo(String indent, LocalizedResource localLangUtil)