public class SslConnection.DecryptedEndPoint extends AbstractEndPoint
Modifier and Type | Class and Description |
---|---|
private class |
SslConnection.DecryptedEndPoint.FailWrite |
private class |
SslConnection.DecryptedEndPoint.WriteCallBack |
Modifier and Type | Field and Description |
---|---|
private boolean |
_cannotAcceptMoreAppDataToFlush |
private boolean |
_fillRequiresFlushToProgress |
private boolean |
_flushRequiresFillToProgress |
private java.util.concurrent.atomic.AtomicReference<SslConnection.Handshake> |
_handshake |
private boolean |
_underFlown |
private Callback |
_writeCallback |
Constructor and Description |
---|
DecryptedEndPoint() |
Modifier and Type | Method and Description |
---|---|
private boolean |
allowRenegotiate(javax.net.ssl.SSLEngineResult.HandshakeStatus handshakeStatus) |
private void |
closeInbound() |
void |
doClose() |
void |
doShutdownOutput() |
private void |
ensureFillInterested() |
int |
fill(java.nio.ByteBuffer buffer)
Fill the passed buffer with data from this endpoint.
|
boolean |
flush(java.nio.ByteBuffer... appOuts)
Flush data from the passed header/buffer to this endpoint.
|
long |
getIdleTimeout()
Get the max idle time in ms.
|
java.net.InetSocketAddress |
getLocalAddress() |
java.net.InetSocketAddress |
getRemoteAddress() |
SslConnection |
getSslConnection() |
java.lang.Object |
getTransport() |
protected WriteFlusher |
getWriteFlusher() |
private void |
handshakeFailed(java.lang.Throwable failure) |
private void |
handshakeSucceeded() |
boolean |
isInputShutdown()
Test if the input is shutdown.
|
boolean |
isOpen()
This abstract method should be called to check if idle timeouts
should still be checked.
|
boolean |
isOutputShutdown()
Test if output is shutdown.
|
protected void |
needsFillInterest() |
private void |
notifyHandshakeFailed(javax.net.ssl.SSLEngine sslEngine,
java.lang.Throwable failure) |
private void |
notifyHandshakeSucceeded(javax.net.ssl.SSLEngine sslEngine) |
protected void |
onIncompleteFlush() |
private void |
releaseEncryptedOutputBuffer() |
void |
setConnection(Connection connection) |
void |
setIdleTimeout(long idleTimeout)
Set the idle timeout.
|
private void |
terminateInput() |
java.lang.String |
toString() |
checkFill, checkFlush, close, close, doShutdownInput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, isFillInterested, isOptimizedForDirectBuffers, onClose, onClose, onIdleExpired, onOpen, reset, shutdownInput, shutdownOutput, toConnectionString, toEndPointString, tryFillInterested, upgrade, write
checkIdleTimeout, getIdleFor, getIdleTimestamp, getScheduler, notIdle
private boolean _fillRequiresFlushToProgress
private boolean _flushRequiresFillToProgress
private boolean _cannotAcceptMoreAppDataToFlush
private java.util.concurrent.atomic.AtomicReference<SslConnection.Handshake> _handshake
private boolean _underFlown
private final Callback _writeCallback
public long getIdleTimeout()
EndPoint
The max idle time is the time the endpoint can be idle before extraordinary handling takes place.
getIdleTimeout
in interface EndPoint
getIdleTimeout
in class IdleTimeout
public void setIdleTimeout(long idleTimeout)
EndPoint
setIdleTimeout
in interface EndPoint
setIdleTimeout
in class IdleTimeout
idleTimeout
- the idle timeout in MS. Timeout <= 0 implies an infinite timeoutpublic boolean isOpen()
IdleTimeout
isOpen
in interface EndPoint
isOpen
in class AbstractEndPoint
public java.net.InetSocketAddress getLocalAddress()
EndPoint
is bound, or null
if this EndPoint
does not represent a network connection.public java.net.InetSocketAddress getRemoteAddress()
EndPoint
is bound, or null
if this EndPoint
does not represent a network connection.protected WriteFlusher getWriteFlusher()
getWriteFlusher
in class AbstractEndPoint
protected void onIncompleteFlush()
onIncompleteFlush
in class AbstractEndPoint
protected void needsFillInterest() throws java.io.IOException
needsFillInterest
in class AbstractEndPoint
java.io.IOException
public void setConnection(Connection connection)
setConnection
in interface EndPoint
setConnection
in class AbstractEndPoint
connection
- the Connection
associated with this EndPoint
EndPoint.getConnection()
,
EndPoint.upgrade(Connection)
public SslConnection getSslConnection()
public int fill(java.nio.ByteBuffer buffer) throws java.io.IOException
EndPoint
buffer
- The buffer to fill. The position and limit are modified during the fill. After the
operation, the position is unchanged and the limit is increased to reflect the new data filled.int
value indicating the number of bytes
filled or -1 if EOF is read or the input is shutdown.java.io.IOException
- if the endpoint is closed.private void handshakeSucceeded()
private void handshakeFailed(java.lang.Throwable failure)
private boolean allowRenegotiate(javax.net.ssl.SSLEngineResult.HandshakeStatus handshakeStatus)
private void terminateInput()
private void closeInbound() throws javax.net.ssl.SSLException
javax.net.ssl.SSLException
public boolean flush(java.nio.ByteBuffer... appOuts) throws java.io.IOException
EndPoint
appOuts
- the buffers to flushjava.io.IOException
- If the endpoint is closed or output is shutdown.private void releaseEncryptedOutputBuffer()
public void doShutdownOutput()
doShutdownOutput
in class AbstractEndPoint
private void ensureFillInterested()
public boolean isOutputShutdown()
EndPoint
EndPoint.shutdownOutput()
or EndPoint.close()
.isOutputShutdown
in interface EndPoint
isOutputShutdown
in class AbstractEndPoint
public void doClose()
doClose
in class AbstractEndPoint
public java.lang.Object getTransport()
public boolean isInputShutdown()
EndPoint
EndPoint.fill(ByteBuffer)
. Once the input is shutdown, all calls to
EndPoint.fill(ByteBuffer)
will return -1, until such time as the
end point is close, when they will return EofException
.isInputShutdown
in interface EndPoint
isInputShutdown
in class AbstractEndPoint
private void notifyHandshakeSucceeded(javax.net.ssl.SSLEngine sslEngine)
private void notifyHandshakeFailed(javax.net.ssl.SSLEngine sslEngine, java.lang.Throwable failure)
public java.lang.String toString()
toString
in class AbstractEndPoint