Package org.eclipse.jetty.io.ssl
Class SslConnection.DecryptedEndPoint
- java.lang.Object
-
- org.eclipse.jetty.io.IdleTimeout
-
- org.eclipse.jetty.io.AbstractEndPoint
-
- org.eclipse.jetty.io.ssl.SslConnection.DecryptedEndPoint
-
- All Implemented Interfaces:
Closeable,AutoCloseable,EndPoint
- Enclosing class:
- SslConnection
public class SslConnection.DecryptedEndPoint extends AbstractEndPoint
-
-
Constructor Summary
Constructors Constructor Description DecryptedEndPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close any backing stream associated with the endpointprotected voidclose(Throwable failure)intfill(ByteBuffer buffer)Fill the passed buffer with data from this endpoint.booleanflush(ByteBuffer... appOuts)Flush data from the passed header/buffer to this endpoint.longgetIdleTimeout()Get the max idle time in ms.SslConnectiongetSslConnection()ObjectgetTransport()protected WriteFlushergetWriteFlusher()booleanisInputShutdown()Test if the input is shutdown.booleanisOpen()This abstract method should be called to check if idle timeouts should still be checked.booleanisOutputShutdown()Test if output is shutdown.protected voidneedsFillInterest()protected voidonIncompleteFlush()voidsetConnection(Connection connection)voidsetIdleTimeout(long idleTimeout)Set the idle timeout.voidshutdownOutput()Shutdown the output.StringtoString()-
Methods inherited from class org.eclipse.jetty.io.AbstractEndPoint
fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, isFillInterested, isOptimizedForDirectBuffers, onIdleExpired, onOpen, tryFillInterested, upgrade, write
-
Methods inherited from class org.eclipse.jetty.io.IdleTimeout
checkIdleTimeout, getIdleFor, getIdleTimestamp, getScheduler, notIdle, onClose
-
-
-
-
Method Detail
-
getIdleTimeout
public long getIdleTimeout()
Description copied from interface:EndPointGet the max idle time in ms.The max idle time is the time the endpoint can be idle before extraordinary handling takes place.
- Specified by:
getIdleTimeoutin interfaceEndPoint- Overrides:
getIdleTimeoutin classIdleTimeout- Returns:
- the max idle time in ms or if ms <= 0 implies an infinite timeout
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout)
Description copied from interface:EndPointSet the idle timeout.- Specified by:
setIdleTimeoutin interfaceEndPoint- Overrides:
setIdleTimeoutin classIdleTimeout- Parameters:
idleTimeout- the idle timeout in MS. Timeout <= 0 implies an infinite timeout
-
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- Specified by:
isOpenin classIdleTimeout- Returns:
- True if the entity monitored should still be checked for idle timeouts
-
getWriteFlusher
protected WriteFlusher getWriteFlusher()
- Overrides:
getWriteFlusherin classAbstractEndPoint
-
onIncompleteFlush
protected void onIncompleteFlush()
- Specified by:
onIncompleteFlushin classAbstractEndPoint
-
needsFillInterest
protected void needsFillInterest() throws IOException- Specified by:
needsFillInterestin classAbstractEndPoint- Throws:
IOException
-
setConnection
public void setConnection(Connection connection)
- Specified by:
setConnectionin interfaceEndPoint- Overrides:
setConnectionin classAbstractEndPoint- Parameters:
connection- theConnectionassociated with thisEndPoint- See Also:
EndPoint.getConnection(),EndPoint.upgrade(Connection)
-
getSslConnection
public SslConnection getSslConnection()
-
fill
public int fill(ByteBuffer buffer) throws IOException
Description copied from interface:EndPointFill 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 it's capacity. The limit is updated to include the filled bytes.- 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.
-
flush
public boolean flush(ByteBuffer... appOuts) throws IOException
Description copied from interface:EndPointFlush 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.- 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.
-
shutdownOutput
public void shutdownOutput()
Description copied from interface:EndPointShutdown the output.This call indicates that no more data will be sent on this endpoint that that the remote end should read an EOF once all previously sent data has been consumed. Shutdown may be done either at the TCP/IP level, as a protocol exchange (Eg TLS close handshake) or both.
If the endpoint has
EndPoint.isInputShutdown()true, then this call has the same effect asEndPoint.close().
-
isOutputShutdown
public boolean isOutputShutdown()
Description copied from interface:EndPointTest if output is shutdown. The output is shutdown by a call toEndPoint.shutdownOutput()orEndPoint.close().- Returns:
- true if the output is shutdown or the endpoint is closed.
-
close
public void close()
Description copied from interface:EndPointClose any backing stream associated with the endpoint- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceEndPoint- Overrides:
closein classAbstractEndPoint
-
close
protected void close(Throwable failure)
- Overrides:
closein classAbstractEndPoint
-
getTransport
public Object getTransport()
- Returns:
- The underlying transport object (socket, channel, etc.)
-
isInputShutdown
public boolean isInputShutdown()
Description copied from interface:EndPointTest if the input is shutdown. The input is shutdown if an EOF has been read while doing aEndPoint.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.- Returns:
- True if the input is shutdown or the endpoint is closed.
-
toString
public String toString()
- Overrides:
toStringin classAbstractEndPoint
-
-