Class SslConnection.SslEndPoint
- All Implemented Interfaces:
Closeable, AutoCloseable, EndPoint, EndPoint.Wrapper
- Enclosing class:
SslConnection
-
Nested Class Summary
Nested classes/interfaces inherited from interface EndPoint
EndPoint.Pipe, EndPoint.SslSessionData, EndPoint.Wrapper -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoClose()voidintfill(ByteBuffer buffer) Fills the passed buffer with data from this endpoint.booleanflush(ByteBuffer... appOuts) Flushes data from the passed header/buffer to this endpoint.longReturns the idle timeout in ms.Returns the SslSessionData of a secure end point.booleanTests if the input is shutdown.booleanisOpen()This abstract method should be called to check if idle timeouts should still be checked.booleanTests if output is shutdown.protected voidprotected voidprotected voidonFillableFail(Throwable failure) protected voidvoidsetConnection(Connection connection) voidsetIdleTimeout(long idleTimeout) Sets the idle timeout in milliseconds.toString()unwrap()Methods inherited from class AbstractEndPoint
close, close, doShutdownInput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, isFillInterested, onClose, onClose, onIdleExpired, onOpen, reset, shutdownInput, shutdownOutput, toConnectionString, toEndPointString, tryFillInterested, upgrade, writeMethods inherited from class IdleTimeout
checkIdleTimeout, getIdleFor, getScheduler, notIdle
-
Constructor Details
-
SslEndPoint
public SslEndPoint()
-
-
Method Details
-
unwrap
- Specified by:
unwrapin interfaceEndPoint.Wrapper- Returns:
- The wrapped
EndPoint
-
getIdleTimeout
public long getIdleTimeout()Description copied from interface:EndPointReturns the idle timeout in ms.
The idle timeout is the time the endpoint can be idle before its close is initiated.
A timeout less than or equal to
0implies an infinite timeout.- Specified by:
getIdleTimeoutin interfaceEndPoint- Overrides:
getIdleTimeoutin classIdleTimeout- Returns:
- the idle timeout in milliseconds
- See Also:
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout) Description copied from class:IdleTimeoutSets the idle timeout in milliseconds.
A value that is less than or zero disables the idle timeout checks.
- Specified by:
setIdleTimeoutin interfaceEndPoint- Overrides:
setIdleTimeoutin classIdleTimeout- Parameters:
idleTimeout- the idle timeout in milliseconds- See Also:
-
isOpen
public boolean isOpen()Description copied from class:IdleTimeoutThis abstract method should be called to check if idle timeouts should still be checked.- Specified by:
isOpenin interfaceEndPoint- Overrides:
isOpenin classAbstractEndPoint- Returns:
- True if the entity monitored should still be checked for idle timeouts
-
getLocalSocketAddress
- Specified by:
getLocalSocketAddressin interfaceEndPoint- Specified by:
getLocalSocketAddressin classAbstractEndPoint- Returns:
- the local SocketAddress to which this
EndPointis bound ornullif thisEndPointis not bound to a Socket address.
-
getRemoteSocketAddress
- Specified by:
getRemoteSocketAddressin interfaceEndPoint- Specified by:
getRemoteSocketAddressin classAbstractEndPoint- Returns:
- The remote SocketAddress to which this
EndPointis connected, ornullif thisEndPointis not connected to a Socket address.
-
getWriteFlusher
- Overrides:
getWriteFlusherin classAbstractEndPoint
-
onFillable
protected void onFillable() -
onFillableFail
-
setConnection
- Specified by:
setConnectionin interfaceEndPoint- Overrides:
setConnectionin classAbstractEndPoint- Parameters:
connection- theConnectionassociated with this EndPoint- See Also:
-
getSslConnection
-
fill
Description copied from interface:EndPointFills the passed buffer with data from this endpoint.
The bytes are appended to any data already in the buffer by writing from the buffers limit up to its capacity. The limit is updated to include the filled bytes.
- Specified by:
fillin interfaceEndPoint- Parameters:
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.- Returns:
- an
intvalue indicating the number of bytes filled or -1 if EOF is read or the input is shutdown. - Throws:
IOException- if the endpoint is closed.
-
needsFillInterest
protected void needsFillInterest()- Specified by:
needsFillInterestin classAbstractEndPoint
-
flush
Description copied from interface:EndPointFlushes data from the passed header/buffer to this endpoint.
As many bytes as can be consumed are taken from the header/buffer position up until the buffer limit. The header/buffers position is updated to indicate how many bytes have been consumed.
- Specified by:
flushin interfaceEndPoint- Parameters:
appOuts- the buffers to flush- Returns:
- True IFF all the buffers have been consumed and the endpoint has flushed the data to its destination (ie is not buffering any data).
- Throws:
IOException- If the endpoint is closed or output is shutdown.
-
onIncompleteFlush
protected void onIncompleteFlush()- Specified by:
onIncompleteFlushin classAbstractEndPoint
-
doShutdownOutput
public void doShutdownOutput()- Overrides:
doShutdownOutputin classAbstractEndPoint
-
isOutputShutdown
public boolean isOutputShutdown()Description copied from interface:EndPointTests if output is shutdown.
The output is shutdown by a call to
EndPoint.shutdownOutput()orEndPoint.close().- Specified by:
isOutputShutdownin interfaceEndPoint- Overrides:
isOutputShutdownin classAbstractEndPoint- Returns:
- true if the output is shutdown or the endpoint is closed.
-
doClose
public void doClose()- Overrides:
doClosein classAbstractEndPoint
-
getTransport
- Specified by:
getTransportin interfaceEndPoint- Returns:
- The underlying transport object (socket, channel, etc.)
-
isInputShutdown
public boolean isInputShutdown()Description copied from interface:EndPointTests if the input is shutdown.
The input is shutdown if an EOF has been read while doing a
EndPoint.fill(ByteBuffer). Once the input is shutdown, all calls toEndPoint.fill(ByteBuffer)will return -1, until such time as the end point is close, when they will returnEofException.- Specified by:
isInputShutdownin interfaceEndPoint- Overrides:
isInputShutdownin classAbstractEndPoint- Returns:
- true if the input is shutdown or the endpoint is closed.
-
getSslSessionData
Description copied from interface:EndPointReturns the SslSessionData of a secure end point.
- Specified by:
getSslSessionDatain interfaceEndPoint- Returns:
- A
EndPoint.SslSessionDatainstance (with possibly null field values) if secure, elsenull.
-
toString
- Overrides:
toStringin classAbstractEndPoint
-