Package org.eclipse.jetty.server
Class HttpInput
- java.lang.Object
 - 
- java.io.InputStream
 - 
- javax.servlet.ServletInputStream
 - 
- org.eclipse.jetty.server.HttpInput
 
 
 
 
- 
- All Implemented Interfaces:
 java.io.Closeable,java.lang.AutoCloseable,java.lang.Runnable
- Direct Known Subclasses:
 HttpInputOverHTTP
@Deprecated(since="2021-05-27") public class HttpInput extends ServletInputStream implements java.lang.Runnable
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.HttpInputprovides an implementation ofServletInputStreamforHttpChannel.Content may arrive in patterns such as [content(), content(), messageComplete()] so that this class maintains two states: the content state that tells whether there is content to consume and the EOF state that tells whether an EOF has arrived. Only once the content has been consumed the content state is moved to the EOF state.
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpInput.ChainedInterceptorDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static classHttpInput.ContentDeprecated.static classHttpInput.EofContentDeprecated.static interfaceHttpInput.InterceptorDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static classHttpInput.SentinelContentDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported. 
- 
Constructor Summary
Constructors Constructor Description HttpInput(HttpChannelState state)Deprecated. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddContent(HttpInput.Content content)Deprecated.Adds some content to this input stream.voidaddInterceptor(HttpInput.Interceptor interceptor)Deprecated.Set theHttpInput.Interceptor, using aHttpInput.ChainedInterceptorif anHttpInput.Interceptoris already set.voidasyncReadProduce()Deprecated.Called by channel when asynchronous IO needs to produce more contentintavailable()Deprecated.booleanconsumeAll()Deprecated.Consume all available content without blocking.booleanearlyEOF()Deprecated.This method should be called to signal that an EOF has been detected before all the expected content arrived.booleaneof()Deprecated.This method should be called to signal that all the expected content arrived.booleanfailed(java.lang.Throwable x)Deprecated.longgetContentConsumed()Deprecated.longgetContentReceived()Deprecated.HttpInput.InterceptorgetInterceptor()Deprecated.booleanhasContent()Deprecated.booleanisAsync()Deprecated.booleanisError()Deprecated.booleanisFinished()Deprecated.Has the end of this InputStream been reached?booleanisReady()Deprecated.Can data be read from this InputStream without blocking? Returns If this method is called and returns false, the container will invokeReadListener.onDataAvailable()when data is available.booleanonIdleTimeout(java.lang.Throwable x)Deprecated.intread()Deprecated.intread(byte[] b, int off, int len)Deprecated.voidrecycle()Deprecated.voidrun()Deprecated.voidsetInterceptor(HttpInput.Interceptor interceptor)Deprecated.Set the interceptor.voidsetReadListener(ReadListener readListener)Deprecated.Sets theReadListenerfor thisServletInputStreamand thereby switches to non-blocking IO.java.lang.StringtoString()Deprecated.voidunblock()Deprecated.- 
Methods inherited from class javax.servlet.ServletInputStream
readLine 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
HttpInput
public HttpInput(HttpChannelState state)
Deprecated. 
 - 
 
- 
Method Detail
- 
recycle
public void recycle()
Deprecated. 
- 
getInterceptor
public HttpInput.Interceptor getInterceptor()
Deprecated.- Returns:
 - The current Interceptor, or null if none set
 
 
- 
setInterceptor
public void setInterceptor(HttpInput.Interceptor interceptor)
Deprecated.Set the interceptor.- Parameters:
 interceptor- The interceptor to use.
 
- 
addInterceptor
public void addInterceptor(HttpInput.Interceptor interceptor)
Deprecated.Set theHttpInput.Interceptor, using aHttpInput.ChainedInterceptorif anHttpInput.Interceptoris already set.- Parameters:
 interceptor- the nextHttpInput.Interceptorin a chain
 
- 
available
public int available()
Deprecated.- Overrides:
 availablein classjava.io.InputStream
 
- 
read
public int read() throws java.io.IOExceptionDeprecated.- Specified by:
 readin classjava.io.InputStream- Throws:
 java.io.IOException
 
- 
read
public int read(byte[] b, int off, int len) throws java.io.IOExceptionDeprecated.- Overrides:
 readin classjava.io.InputStream- Throws:
 java.io.IOException
 
- 
asyncReadProduce
public void asyncReadProduce() throws java.io.IOExceptionDeprecated.Called by channel when asynchronous IO needs to produce more content- Throws:
 java.io.IOException- if unable to produce content
 
- 
addContent
public boolean addContent(HttpInput.Content content)
Deprecated.Adds some content to this input stream.- Parameters:
 content- the content to add- Returns:
 - true if content channel woken for read
 
 
- 
hasContent
public boolean hasContent()
Deprecated. 
- 
unblock
public void unblock()
Deprecated. 
- 
getContentConsumed
public long getContentConsumed()
Deprecated. 
- 
getContentReceived
public long getContentReceived()
Deprecated. 
- 
earlyEOF
public boolean earlyEOF()
Deprecated.This method should be called to signal that an EOF has been detected before all the expected content arrived.Typically this will result in an EOFException being thrown from a subsequent read rather than a -1 return.
- Returns:
 - true if content channel woken for read
 
 
- 
eof
public boolean eof()
Deprecated.This method should be called to signal that all the expected content arrived.- Returns:
 - true if content channel woken for read
 
 
- 
consumeAll
public boolean consumeAll()
Deprecated.Consume all available content without blocking. Raw content is counted in thegetContentReceived()statistics, but is not intercepted nor counted in thegetContentConsumed()statistics- Returns:
 - True if EOF was reached, false otherwise.
 
 
- 
isError
public boolean isError()
Deprecated. 
- 
isAsync
public boolean isAsync()
Deprecated. 
- 
isFinished
public boolean isFinished()
Deprecated.Description copied from class:ServletInputStreamHas the end of this InputStream been reached?- Specified by:
 isFinishedin classServletInputStream- Returns:
 trueif all the data has been read from the stream, elsefalse
 
- 
isReady
public boolean isReady()
Deprecated.Description copied from class:ServletInputStreamCan data be read from this InputStream without blocking? Returns If this method is called and returns false, the container will invokeReadListener.onDataAvailable()when data is available.- Specified by:
 isReadyin classServletInputStream- Returns:
 trueif data can be read without blocking, elsefalse
 
- 
setReadListener
public void setReadListener(ReadListener readListener)
Deprecated.Description copied from class:ServletInputStreamSets theReadListenerfor thisServletInputStreamand thereby switches to non-blocking IO. It is only valid to switch to non-blocking IO within async processing or HTTP upgrade processing.- Specified by:
 setReadListenerin classServletInputStream- Parameters:
 readListener- The non-blocking IO read listener
 
- 
onIdleTimeout
public boolean onIdleTimeout(java.lang.Throwable x)
Deprecated. 
- 
failed
public boolean failed(java.lang.Throwable x)
Deprecated. 
- 
run
public void run()
Deprecated.- Specified by:
 runin interfacejava.lang.Runnable
 
- 
toString
public java.lang.String toString()
Deprecated.- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -