Class LoggingIOSession
- java.lang.Object
-
- org.apache.hc.client5.http.impl.async.LoggingIOSession
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.ByteChannel
,java.nio.channels.Channel
,java.nio.channels.ReadableByteChannel
,java.nio.channels.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 java.lang.Object implements org.apache.hc.core5.reactor.IOSession
-
-
Constructor Summary
Constructors Constructor Description LoggingIOSession(org.apache.hc.core5.reactor.IOSession session, org.slf4j.Logger log, org.slf4j.Logger wireLog)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.channels.ByteChannel
channel()
void
clearEvent(int op)
void
close()
void
close(org.apache.hc.core5.io.CloseMode closeMode)
void
enqueue(org.apache.hc.core5.reactor.Command command, org.apache.hc.core5.reactor.Command.Priority priority)
private static java.lang.String
formatOps(int ops)
int
getEventMask()
org.apache.hc.core5.reactor.IOEventHandler
getHandler()
java.lang.String
getId()
long
getLastEventTime()
long
getLastReadTime()
long
getLastWriteTime()
java.net.SocketAddress
getLocalAddress()
java.util.concurrent.locks.Lock
getLock()
java.net.SocketAddress
getRemoteAddress()
org.apache.hc.core5.util.Timeout
getSocketTimeout()
org.apache.hc.core5.reactor.IOSession.Status
getStatus()
boolean
hasCommands()
boolean
isOpen()
private void
logData(java.nio.ByteBuffer data, java.lang.String prefix)
org.apache.hc.core5.reactor.Command
poll()
int
read(java.nio.ByteBuffer dst)
void
setEvent(int op)
void
setEventMask(int ops)
void
setSocketTimeout(org.apache.hc.core5.util.Timeout timeout)
java.lang.String
toString()
void
updateReadTime()
void
updateWriteTime()
void
upgrade(org.apache.hc.core5.reactor.IOEventHandler handler)
int
write(java.nio.ByteBuffer src)
-
-
-
Method Detail
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfaceorg.apache.hc.core5.util.Identifiable
-
getLock
public java.util.concurrent.locks.Lock getLock()
- Specified by:
getLock
in interfaceorg.apache.hc.core5.reactor.IOSession
-
hasCommands
public boolean hasCommands()
- Specified by:
hasCommands
in interfaceorg.apache.hc.core5.reactor.IOSession
-
poll
public org.apache.hc.core5.reactor.Command poll()
- Specified by:
poll
in interfaceorg.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 interfaceorg.apache.hc.core5.reactor.IOSession
-
channel
public java.nio.channels.ByteChannel channel()
- Specified by:
channel
in interfaceorg.apache.hc.core5.reactor.IOSession
-
getLocalAddress
public java.net.SocketAddress getLocalAddress()
- Specified by:
getLocalAddress
in interfaceorg.apache.hc.core5.reactor.IOSession
-
getRemoteAddress
public java.net.SocketAddress getRemoteAddress()
- Specified by:
getRemoteAddress
in interfaceorg.apache.hc.core5.reactor.IOSession
-
getEventMask
public int getEventMask()
- Specified by:
getEventMask
in interfaceorg.apache.hc.core5.reactor.IOSession
-
formatOps
private static java.lang.String formatOps(int ops)
-
setEventMask
public void setEventMask(int ops)
- Specified by:
setEventMask
in interfaceorg.apache.hc.core5.reactor.IOSession
-
setEvent
public void setEvent(int op)
- Specified by:
setEvent
in interfaceorg.apache.hc.core5.reactor.IOSession
-
clearEvent
public void clearEvent(int op)
- Specified by:
clearEvent
in interfaceorg.apache.hc.core5.reactor.IOSession
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfacejava.nio.channels.Channel
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.nio.channels.Channel
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceorg.apache.hc.core5.reactor.IOSession
-
getStatus
public org.apache.hc.core5.reactor.IOSession.Status getStatus()
- Specified by:
getStatus
in interfaceorg.apache.hc.core5.reactor.IOSession
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode)
- Specified by:
close
in interfaceorg.apache.hc.core5.io.ModalCloseable
-
getSocketTimeout
public org.apache.hc.core5.util.Timeout getSocketTimeout()
- Specified by:
getSocketTimeout
in interfaceorg.apache.hc.core5.reactor.IOSession
- Specified by:
getSocketTimeout
in interfaceorg.apache.hc.core5.http.SocketModalCloseable
-
setSocketTimeout
public void setSocketTimeout(org.apache.hc.core5.util.Timeout timeout)
- Specified by:
setSocketTimeout
in interfaceorg.apache.hc.core5.reactor.IOSession
- Specified by:
setSocketTimeout
in interfaceorg.apache.hc.core5.http.SocketModalCloseable
-
getLastReadTime
public long getLastReadTime()
- Specified by:
getLastReadTime
in interfaceorg.apache.hc.core5.reactor.IOSession
-
getLastWriteTime
public long getLastWriteTime()
- Specified by:
getLastWriteTime
in interfaceorg.apache.hc.core5.reactor.IOSession
-
updateReadTime
public void updateReadTime()
- Specified by:
updateReadTime
in interfaceorg.apache.hc.core5.reactor.IOSession
-
updateWriteTime
public void updateWriteTime()
- Specified by:
updateWriteTime
in interfaceorg.apache.hc.core5.reactor.IOSession
-
getLastEventTime
public long getLastEventTime()
- Specified by:
getLastEventTime
in interfaceorg.apache.hc.core5.reactor.IOSession
-
getHandler
public org.apache.hc.core5.reactor.IOEventHandler getHandler()
- Specified by:
getHandler
in interfaceorg.apache.hc.core5.reactor.IOSession
-
upgrade
public void upgrade(org.apache.hc.core5.reactor.IOEventHandler handler)
- Specified by:
upgrade
in interfaceorg.apache.hc.core5.reactor.IOSession
-
logData
private void logData(java.nio.ByteBuffer data, java.lang.String prefix) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
- Specified by:
read
in interfacejava.nio.channels.ReadableByteChannel
- Throws:
java.io.IOException
-
write
public int write(java.nio.ByteBuffer src) throws java.io.IOException
- Specified by:
write
in interfacejava.nio.channels.WritableByteChannel
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-