Class HttpConnection
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractConnection
-
- org.eclipse.jetty.server.HttpConnection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Runnable,Connection,Connection.UpgradeFrom,Connection.UpgradeTo,WriteFlusher.Listener,HttpTransport
@Deprecated(since="2021-05-27") public class HttpConnection extends AbstractConnection implements java.lang.Runnable, HttpTransport, WriteFlusher.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A
Connectionthat handles the HTTP protocol.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Field Summary
Fields Modifier and Type Field Description static HttpFieldCONNECTION_CLOSEDeprecated.static java.lang.StringUPGRADE_CONNECTION_ATTRIBUTEDeprecated.
-
Constructor Summary
Constructors Constructor Description HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint, HttpCompliance compliance, boolean recordComplianceViolations)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidabort(java.lang.Throwable failure)Deprecated.Aborts this transport.voidasyncReadFillInterested()Deprecated.voidblockingReadFailure(java.lang.Throwable e)Deprecated.voidblockingReadFillInterested()Deprecated.longgetBytesIn()Deprecated.longgetBytesOut()Deprecated.ConnectorgetConnector()Deprecated.static HttpConnectiongetCurrentConnection()Deprecated.Get the current connection that this thread is dispatched to.HttpGeneratorgetGenerator()Deprecated.HttpChannelgetHttpChannel()Deprecated.HttpCompliancegetHttpCompliance()Deprecated.HttpConfigurationgetHttpConfiguration()Deprecated.longgetMessagesIn()Deprecated.longgetMessagesOut()Deprecated.HttpParsergetParser()Deprecated.java.nio.ByteBuffergetRequestBuffer()Deprecated.ServergetServer()Deprecated.booleanisOptimizedForDirectBuffers()Deprecated.Is the underlying transport optimized for DirectBuffer usagebooleanisPushSupported()Deprecated.booleanisRecordHttpComplianceViolations()Deprecated.booleanisRequestBufferEmpty()Deprecated.voidonClose()Deprecated.Callback method invoked when this connection is closed.voidonCompleted()Deprecated.Called to indicated the end of the current request/response cycle (which may be some time after the last content is sent).voidonFillable()Deprecated.Callback method invoked when the endpoint is ready to be read.voidonFlushed(long bytes)Deprecated.Invoked when aWriteFlusherflushed bytes in a non-blocking way, as part of a - possibly larger - write.voidonOpen()Deprecated.Callback method invoked when this connection is opened.java.nio.ByteBufferonUpgradeFrom()Deprecated.Invoked during anupgradeto produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.voidonUpgradeTo(java.nio.ByteBuffer buffer)Deprecated.Invoked during anupgradeto receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.voidpush(MetaData.Request request)Deprecated.voidrun()Deprecated.voidsend(MetaData.Response info, boolean head, java.nio.ByteBuffer content, boolean lastContent, Callback callback)Deprecated.Asynchronous call to send a response (or part) over the transportjava.lang.StringtoConnectionString()Deprecated.-
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addListener, close, fillInterested, getCreatedTimeStamp, getEndPoint, getInputBufferSize, isFillInterested, onIdleExpired, removeListener, setInputBufferSize, toString, tryFillInterested, tryFillInterested
-
-
-
-
Field Detail
-
CONNECTION_CLOSE
public static final HttpField CONNECTION_CLOSE
Deprecated.
-
UPGRADE_CONNECTION_ATTRIBUTE
public static final java.lang.String UPGRADE_CONNECTION_ATTRIBUTE
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpConnection
public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint, HttpCompliance compliance, boolean recordComplianceViolations)
Deprecated.
-
-
Method Detail
-
getCurrentConnection
public static HttpConnection getCurrentConnection()
Deprecated.Get the current connection that this thread is dispatched to. Note that a thread may be processing a request asynchronously and thus not be dispatched to the connection.- Returns:
- the current HttpConnection or null
- See Also:
for a more general way to access the HttpConnection
-
getHttpCompliance
@Deprecated public HttpCompliance getHttpCompliance()
Deprecated.
-
getHttpConfiguration
public HttpConfiguration getHttpConfiguration()
Deprecated.
-
isRecordHttpComplianceViolations
public boolean isRecordHttpComplianceViolations()
Deprecated.
-
getServer
public Server getServer()
Deprecated.
-
getConnector
public Connector getConnector()
Deprecated.
-
getHttpChannel
public HttpChannel getHttpChannel()
Deprecated.
-
getParser
public HttpParser getParser()
Deprecated.
-
getGenerator
public HttpGenerator getGenerator()
Deprecated.
-
isOptimizedForDirectBuffers
public boolean isOptimizedForDirectBuffers()
Deprecated.Description copied from interface:HttpTransportIs the underlying transport optimized for DirectBuffer usage- Specified by:
isOptimizedForDirectBuffersin interfaceHttpTransport- Returns:
- True if direct buffers can be used optimally.
-
getMessagesIn
public long getMessagesIn()
Deprecated.- Specified by:
getMessagesInin interfaceConnection- Overrides:
getMessagesInin classAbstractConnection
-
getMessagesOut
public long getMessagesOut()
Deprecated.- Specified by:
getMessagesOutin interfaceConnection- Overrides:
getMessagesOutin classAbstractConnection
-
onUpgradeFrom
public java.nio.ByteBuffer onUpgradeFrom()
Deprecated.Description copied from interface:Connection.UpgradeFromInvoked during an
upgradeto produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.- Specified by:
onUpgradeFromin interfaceConnection.UpgradeFrom- Returns:
- a buffer of unconsumed bytes to pass to the upgrade-to connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes. The returned buffer may be null if there are no unconsumed bytes.
-
onUpgradeTo
public void onUpgradeTo(java.nio.ByteBuffer buffer)
Deprecated.Description copied from interface:Connection.UpgradeToInvoked during an
upgradeto receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.- Specified by:
onUpgradeToin interfaceConnection.UpgradeTo- Parameters:
buffer- a non-null buffer of unconsumed bytes received from the upgrade-from connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes.
-
onFlushed
public void onFlushed(long bytes) throws java.io.IOExceptionDeprecated.Description copied from interface:WriteFlusher.ListenerInvoked when a
WriteFlusherflushed bytes in a non-blocking way, as part of a - possibly larger - write.This method may be invoked multiple times, for example when writing a large buffer: a first flush of bytes, then the connection became TCP congested, and a subsequent flush of bytes when the connection became writable again.
This method is never invoked concurrently, but may be invoked by different threads, so implementations may not rely on thread-local variables.
Implementations may throw an
IOExceptionto signal that the write should fail, for example if the implementation enforces a minimum data rate.- Specified by:
onFlushedin interfaceWriteFlusher.Listener- Parameters:
bytes- the number of bytes flushed- Throws:
java.io.IOException- if the write should fail
-
getRequestBuffer
public java.nio.ByteBuffer getRequestBuffer()
Deprecated.
-
isRequestBufferEmpty
public boolean isRequestBufferEmpty()
Deprecated.
-
onFillable
public void onFillable()
Deprecated.Description copied from class:AbstractConnectionCallback method invoked when the endpoint is ready to be read.
- Specified by:
onFillablein classAbstractConnection- See Also:
AbstractConnection.fillInterested()
-
onCompleted
public void onCompleted()
Deprecated.Description copied from interface:HttpTransportCalled to indicated the end of the current request/response cycle (which may be some time after the last content is sent).- Specified by:
onCompletedin interfaceHttpTransport
-
onOpen
public void onOpen()
Deprecated.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
-
onClose
public void onClose()
Deprecated.Description copied from interface:ConnectionCallback method invoked when this connection is closed.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onClosein interfaceConnection- Overrides:
onClosein classAbstractConnection
-
run
public void run()
Deprecated.- Specified by:
runin interfacejava.lang.Runnable
-
send
public void send(MetaData.Response info, boolean head, java.nio.ByteBuffer content, boolean lastContent, Callback callback)
Deprecated.Description copied from interface:HttpTransportAsynchronous call to send a response (or part) over the transport- Specified by:
sendin interfaceHttpTransport- Parameters:
info- The header info to send, or null if just sending more data. The first call to send for a response must have a non null info.head- True if the response if for a HEAD request (and the data should not be sent).content- A buffer of content to be sent.lastContent- True if the content is the last content for the current response.callback- The Callback instance that success or failure of the send is notified on
-
abort
public void abort(java.lang.Throwable failure)
Deprecated.Description copied from interface:HttpTransportAborts this transport.This method should terminate the transport in a way that can indicate an abnormal response to the client, for example by abruptly close the connection.
This method is called when an error response needs to be sent, but the response is already committed, or when a write failure is detected. If abort is called,
HttpTransport.onCompleted()is not called- Specified by:
abortin interfaceHttpTransport- Parameters:
failure- the failure that caused the abort.
-
isPushSupported
public boolean isPushSupported()
Deprecated.- Specified by:
isPushSupportedin interfaceHttpTransport- Returns:
- true if responses can be pushed over this transport
-
push
public void push(MetaData.Request request)
Deprecated.- Specified by:
pushin interfaceHttpTransport- Parameters:
request- A request to use as the basis for generating a pushed response.
-
asyncReadFillInterested
public void asyncReadFillInterested()
Deprecated.
-
blockingReadFillInterested
public void blockingReadFillInterested()
Deprecated.
-
blockingReadFailure
public void blockingReadFailure(java.lang.Throwable e)
Deprecated.
-
getBytesIn
public long getBytesIn()
Deprecated.- Specified by:
getBytesInin interfaceConnection- Overrides:
getBytesInin classAbstractConnection
-
getBytesOut
public long getBytesOut()
Deprecated.- Specified by:
getBytesOutin interfaceConnection- Overrides:
getBytesOutin classAbstractConnection
-
toConnectionString
public java.lang.String toConnectionString()
Deprecated.- Overrides:
toConnectionStringin classAbstractConnection
-
-