Class HttpConnectionOverHTTP
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractConnection
-
- org.eclipse.jetty.client.http.HttpConnectionOverHTTP
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Connection,Connection,Connection.UpgradeFrom,Sweeper.Sweepable
public class HttpConnectionOverHTTP extends AbstractConnection implements Connection, Connection.UpgradeFrom, Sweeper.Sweepable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Constructor Summary
Constructors Constructor Description HttpConnectionOverHTTP(EndPoint endPoint, HttpDestination destination, Promise<Connection> promise)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Performs a logical close of this connection.longgetBytesIn()longgetBytesOut()HttpChannelOverHTTPgetHttpChannel()HttpDestinationOverHTTPgetHttpDestination()longgetMessagesIn()longgetMessagesOut()booleanisClosed()voidonFillable()Callback method invoked when the endpoint is ready to be read.booleanonIdleExpired()Callback method invoked upon an idle timeout event.voidonOpen()Callback method invoked when this connection is opened.java.nio.ByteBufferonUpgradeFrom()Takes the input buffer from the connection on upgrade.voidrelease()voidremove()voidsend(Request request, Response.CompleteListener listener)Sends a request with an associated response listener.booleansweep()java.lang.StringtoConnectionString()-
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addListener, fillInterested, getCreatedTimeStamp, getEndPoint, getInputBufferSize, isFillInterested, onClose, removeListener, setInputBufferSize, toString, tryFillInterested, tryFillInterested
-
-
-
-
Constructor Detail
-
HttpConnectionOverHTTP
public HttpConnectionOverHTTP(EndPoint endPoint, HttpDestination destination, Promise<Connection> promise)
-
-
Method Detail
-
getHttpChannel
public HttpChannelOverHTTP getHttpChannel()
-
getHttpDestination
public HttpDestinationOverHTTP getHttpDestination()
-
getBytesIn
public long getBytesIn()
- Specified by:
getBytesInin interfaceConnection- Overrides:
getBytesInin classAbstractConnection
-
getBytesOut
public long getBytesOut()
- Specified by:
getBytesOutin interfaceConnection- Overrides:
getBytesOutin classAbstractConnection
-
getMessagesIn
public long getMessagesIn()
- Specified by:
getMessagesInin interfaceConnection- Overrides:
getMessagesInin classAbstractConnection
-
getMessagesOut
public long getMessagesOut()
- Specified by:
getMessagesOutin interfaceConnection- Overrides:
getMessagesOutin classAbstractConnection
-
send
public void send(Request request, Response.CompleteListener listener)
Description copied from interface:ConnectionSends a request with an associated response listener.Request.send(Response.CompleteListener)will eventually call this method to send the request. It is exposed to allow applications to send requests via unpooled connections.- Specified by:
sendin interfaceConnection- Parameters:
request- the request to sendlistener- the response listener
-
onOpen
public void onOpen()
Description copied from interface:ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpenin interfaceConnection- Overrides:
onOpenin classAbstractConnection
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceConnection- Returns:
- whether this connection has been closed
- See Also:
Connection.close()
-
onIdleExpired
public boolean onIdleExpired()
Description copied from interface:ConnectionCallback method invoked upon an idle timeout event.
Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.
When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.
- Specified by:
onIdleExpiredin interfaceConnection- Overrides:
onIdleExpiredin classAbstractConnection- Returns:
- true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.
-
onFillable
public void onFillable()
Description copied from class:AbstractConnectionCallback method invoked when the endpoint is ready to be read.
- Specified by:
onFillablein classAbstractConnection- See Also:
AbstractConnection.fillInterested()
-
onUpgradeFrom
public java.nio.ByteBuffer onUpgradeFrom()
Description copied from interface:Connection.UpgradeFromTakes the input buffer from the connection on upgrade.
This method is used to take any unconsumed input from a connection during an upgrade.
- Specified by:
onUpgradeFromin interfaceConnection.UpgradeFrom- Returns:
- A buffer of unconsumed input. The caller must return the buffer to the bufferpool when consumed and this connection must not.
-
release
public void release()
-
close
public void close()
Description copied from interface:ConnectionPerforms a logical close of this connection.
For simple connections, this may just mean to delegate the close to the associated
EndPointbut, for example, SSL connections should write the SSL close message before closing the associatedEndPoint.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceConnection- Specified by:
closein interfaceConnection- Overrides:
closein classAbstractConnection
-
sweep
public boolean sweep()
- Specified by:
sweepin interfaceSweeper.Sweepable- Returns:
- whether this resource should be swept
-
remove
public void remove()
-
toConnectionString
public java.lang.String toConnectionString()
- Overrides:
toConnectionStringin classAbstractConnection
-
-