Class NetAgent

java.lang.Object
org.apache.derby.client.am.Agent
org.apache.derby.client.net.NetAgent

public class NetAgent extends Agent
  • Field Details

  • Constructor Details

  • Method Details

    • resetAgent_

      protected void resetAgent_(LogWriter netLogWriter, int loginTimeout, String server, int port) throws SqlException
      Specified by:
      resetAgent_ in class Agent
      Throws:
      SqlException
    • setSvrcod

      void setSvrcod(int svrcod)
    • clearSvrcod

      void clearSvrcod()
    • getSvrcod

      private int getSvrcod()
    • flush_

      public void flush_() throws DisconnectException
      Specified by:
      flush_ in class Agent
      Throws:
      DisconnectException
    • close_

      public void close_() throws SqlException
      Specified by:
      close_ in class Agent
      Throws:
      SqlException
    • setTimeout

      protected void setTimeout(int timeout)
      Specifies the maximum blocking time that should be used when sending and receiving messages. The timeout is implemented by using the the underlying socket implementation's timeout support. Note that the support for timeout on sockets is dependent on the OS implementation. For the same reason we ignore any exceptions thrown by the call to the socket layer.
      Parameters:
      timeout - The timeout value in seconds. A value of 0 corresponds to infinite timeout.
    • getTimeout

      protected int getTimeout()
      Returns the current timeout value that is set on the socket. Note that the support for timeout on sockets is dependent on the OS implementation. For the same reason we ignore any exceptions thrown by the call to the socket layer.
      Returns:
      The timeout value in seconds. A value of 0 corresponds to that no timeout is specified on the socket.
    • sendRequest

      private void sendRequest() throws DisconnectException
      Throws:
      DisconnectException
    • getInputStream

      public InputStream getInputStream()
    • getCurrentCcsidManager

      public CcsidManager getCurrentCcsidManager()
    • getOutputStream

      public OutputStream getOutputStream()
    • setInputStream

      void setInputStream(InputStream inputStream)
    • setOutputStream

      void setOutputStream(OutputStream outputStream)
    • throwCommunicationsFailure

      void throwCommunicationsFailure(Throwable cause) throws DisconnectException
      Throws:
      DisconnectException
    • markChainBreakingException_

      protected void markChainBreakingException_()
      Specified by:
      markChainBreakingException_ in class Agent
    • checkForChainBreakingException_

      public void checkForChainBreakingException_() throws SqlException
      Specified by:
      checkForChainBreakingException_ in class Agent
      Throws:
      SqlException
    • writeDeferredResetConnection

      private void writeDeferredResetConnection() throws SqlException
      Throws:
      SqlException
    • markWriteChainAsDirty

      void markWriteChainAsDirty()
      Marks the agent's write chain as dirty. A write chain is dirty when data from it has been sent to the server. A dirty write chain cannot be reset and reused for another request until the remaining data has been sent to the server and the write chain properly ended. Resetting a dirty chain will cause the new request to be appended to the unfinished request already at the server, which will likely lead to cryptic syntax errors.
    • verifyWriteChainIsClean

      private void verifyWriteChainIsClean() throws DisconnectException
      Throws:
      DisconnectException
    • beginWriteChainOutsideUOW

      public void beginWriteChainOutsideUOW() throws SqlException
      Specified by:
      beginWriteChainOutsideUOW in class Agent
      Throws:
      SqlException
    • beginWriteChain

      public void beginWriteChain(ClientStatement statement) throws SqlException
      Overrides:
      beginWriteChain in class Agent
      Throws:
      SqlException
    • endWriteChain

      protected void endWriteChain()
      Specified by:
      endWriteChain in class Agent
    • readDeferredResetConnection

      private void readDeferredResetConnection() throws SqlException
      Throws:
      SqlException
    • beginReadChain

      protected void beginReadChain(ClientStatement statement) throws SqlException
      Overrides:
      beginReadChain in class Agent
      Throws:
      SqlException
    • beginReadChainOutsideUOW

      protected void beginReadChainOutsideUOW() throws SqlException
      Overrides:
      beginReadChainOutsideUOW in class Agent
      Throws:
      SqlException
    • switchToUtf8CcsidMgr

      void switchToUtf8CcsidMgr()
      Switches the current CCSID manager to UTF-8
    • switchToEbcdicMgr

      void switchToEbcdicMgr()
      Switches the current CCSID manager to EBCDIC