Class LoggingIOSession

java.lang.Object
org.apache.hc.client5.http.impl.async.LoggingIOSession
All Implemented Interfaces:
Closeable, AutoCloseable, ByteChannel, Channel, ReadableByteChannel, WritableByteChannel, org.apache.hc.core5.http.SocketModalCloseable, org.apache.hc.core5.io.ModalCloseable, org.apache.hc.core5.reactor.IOSession, org.apache.hc.core5.util.Identifiable

class LoggingIOSession extends Object implements org.apache.hc.core5.reactor.IOSession
  • Field Details

    • log

      private final org.slf4j.Logger log
    • wireLog

      private final org.slf4j.Logger wireLog
    • session

      private final org.apache.hc.core5.reactor.IOSession session
  • Constructor Details

    • LoggingIOSession

      public LoggingIOSession(org.apache.hc.core5.reactor.IOSession session, org.slf4j.Logger log, org.slf4j.Logger wireLog)
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface org.apache.hc.core5.util.Identifiable
    • getLock

      public Lock getLock()
      Specified by:
      getLock in interface org.apache.hc.core5.reactor.IOSession
    • hasCommands

      public boolean hasCommands()
      Specified by:
      hasCommands in interface org.apache.hc.core5.reactor.IOSession
    • poll

      public org.apache.hc.core5.reactor.Command poll()
      Specified by:
      poll in interface org.apache.hc.core5.reactor.IOSession
    • enqueue

      public void enqueue(org.apache.hc.core5.reactor.Command command, org.apache.hc.core5.reactor.Command.Priority priority)
      Specified by:
      enqueue in interface org.apache.hc.core5.reactor.IOSession
    • channel

      public ByteChannel channel()
      Specified by:
      channel in interface org.apache.hc.core5.reactor.IOSession
    • getLocalAddress

      public SocketAddress getLocalAddress()
      Specified by:
      getLocalAddress in interface org.apache.hc.core5.reactor.IOSession
    • getRemoteAddress

      public SocketAddress getRemoteAddress()
      Specified by:
      getRemoteAddress in interface org.apache.hc.core5.reactor.IOSession
    • getEventMask

      public int getEventMask()
      Specified by:
      getEventMask in interface org.apache.hc.core5.reactor.IOSession
    • formatOps

      private static String formatOps(int ops)
    • setEventMask

      public void setEventMask(int ops)
      Specified by:
      setEventMask in interface org.apache.hc.core5.reactor.IOSession
    • setEvent

      public void setEvent(int op)
      Specified by:
      setEvent in interface org.apache.hc.core5.reactor.IOSession
    • clearEvent

      public void clearEvent(int op)
      Specified by:
      clearEvent in interface org.apache.hc.core5.reactor.IOSession
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Channel
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Channel
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.hc.core5.reactor.IOSession
    • getStatus

      public org.apache.hc.core5.reactor.IOSession.Status getStatus()
      Specified by:
      getStatus in interface org.apache.hc.core5.reactor.IOSession
    • close

      public void close(org.apache.hc.core5.io.CloseMode closeMode)
      Specified by:
      close in interface org.apache.hc.core5.io.ModalCloseable
    • getSocketTimeout

      public org.apache.hc.core5.util.Timeout getSocketTimeout()
      Specified by:
      getSocketTimeout in interface org.apache.hc.core5.reactor.IOSession
      Specified by:
      getSocketTimeout in interface org.apache.hc.core5.http.SocketModalCloseable
    • setSocketTimeout

      public void setSocketTimeout(org.apache.hc.core5.util.Timeout timeout)
      Specified by:
      setSocketTimeout in interface org.apache.hc.core5.reactor.IOSession
      Specified by:
      setSocketTimeout in interface org.apache.hc.core5.http.SocketModalCloseable
    • getLastReadTime

      public long getLastReadTime()
      Specified by:
      getLastReadTime in interface org.apache.hc.core5.reactor.IOSession
    • getLastWriteTime

      public long getLastWriteTime()
      Specified by:
      getLastWriteTime in interface org.apache.hc.core5.reactor.IOSession
    • updateReadTime

      public void updateReadTime()
      Specified by:
      updateReadTime in interface org.apache.hc.core5.reactor.IOSession
    • updateWriteTime

      public void updateWriteTime()
      Specified by:
      updateWriteTime in interface org.apache.hc.core5.reactor.IOSession
    • getLastEventTime

      public long getLastEventTime()
      Specified by:
      getLastEventTime in interface org.apache.hc.core5.reactor.IOSession
    • getHandler

      public org.apache.hc.core5.reactor.IOEventHandler getHandler()
      Specified by:
      getHandler in interface org.apache.hc.core5.reactor.IOSession
    • upgrade

      public void upgrade(org.apache.hc.core5.reactor.IOEventHandler handler)
      Specified by:
      upgrade in interface org.apache.hc.core5.reactor.IOSession
    • logData

      private void logData(ByteBuffer data, String prefix) throws IOException
      Throws:
      IOException
    • read

      public int read(ByteBuffer dst) throws IOException
      Specified by:
      read in interface ReadableByteChannel
      Throws:
      IOException
    • write

      public int write(ByteBuffer src) throws IOException
      Specified by:
      write in interface WritableByteChannel
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object