Package org.eclipse.jetty.http2
Class HTTP2Stream
- java.lang.Object
-
- org.eclipse.jetty.io.IdleTimeout
-
- org.eclipse.jetty.http2.HTTP2Stream
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Stream,IStream
public class HTTP2Stream extends org.eclipse.jetty.io.IdleTimeout implements IStream
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Stream
Stream.Listener
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jetty.http2.IStream
CHANNEL_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description HTTP2Stream(org.eclipse.jetty.util.thread.Scheduler scheduler, ISession session, int streamId, boolean local)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Forcibly closes this stream.voiddata(DataFrame frame, org.eclipse.jetty.util.Callback callback)Sends the given DATAframe.ObjectgetAttribute(String key)intgetId()Stream.ListenergetListener()intgetRecvWindow()intgetSendWindow()ISessiongetSession()voidheaders(HeadersFrame frame, org.eclipse.jetty.util.Callback callback)Sends the given HEADERSframerepresenting a HTTP response.booleanisClosed()booleanisLocal()booleanisLocallyClosed()booleanisOpen()booleanisRemotelyClosed()booleanisReset()protected voidonIdleExpired(TimeoutException timeout)voidprocess(Frame frame, org.eclipse.jetty.util.Callback callback)Processes the givenframe, belonging to this stream.voidpush(PushPromiseFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener)Sends the given PUSH_PROMISEframe.ObjectremoveAttribute(String key)voidreset(ResetFrame frame, org.eclipse.jetty.util.Callback callback)Sends the given RST_STREAMframe.voidsetAttribute(String key, Object value)voidsetListener(Stream.Listener listener)StringtoString()booleanupdateClose(boolean update, boolean local)Updates the close state of this stream.intupdateRecvWindow(int delta)Updates the stream receive window by the givendelta.intupdateSendWindow(int delta)Updates the stream send window by the givendelta.-
Methods inherited from class org.eclipse.jetty.io.IdleTimeout
checkIdleTimeout, getIdleFor, getIdleTimeout, getIdleTimestamp, getScheduler, notIdle, onClose, onOpen, setIdleTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.http2.api.Stream
getIdleTimeout, setIdleTimeout
-
-
-
-
Constructor Detail
-
HTTP2Stream
public HTTP2Stream(org.eclipse.jetty.util.thread.Scheduler scheduler, ISession session, int streamId, boolean local)
-
-
Method Detail
-
isLocal
public boolean isLocal()
-
getSession
public ISession getSession()
- Specified by:
getSessionin interfaceIStream- Specified by:
getSessionin interfaceStream- Returns:
- the session this stream is associated to
-
headers
public void headers(HeadersFrame frame, org.eclipse.jetty.util.Callback callback)
Description copied from interface:StreamSends the given HEADERS
framerepresenting a HTTP response.
-
push
public void push(PushPromiseFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener)
Description copied from interface:StreamSends the given PUSH_PROMISE
frame.
-
data
public void data(DataFrame frame, org.eclipse.jetty.util.Callback callback)
Description copied from interface:StreamSends the given DATA
frame.
-
reset
public void reset(ResetFrame frame, org.eclipse.jetty.util.Callback callback)
Description copied from interface:StreamSends the given RST_STREAM
frame.
-
getAttribute
public Object getAttribute(String key)
- Specified by:
getAttributein interfaceStream- Parameters:
key- the attribute key- Returns:
- an arbitrary object associated with the given key to this stream or null if no object can be found for the given key.
- See Also:
Stream.setAttribute(String, Object)
-
setAttribute
public void setAttribute(String key, Object value)
- Specified by:
setAttributein interfaceStream- Parameters:
key- the attribute keyvalue- an arbitrary object to associate with the given key to this stream- See Also:
Stream.getAttribute(String),Stream.removeAttribute(String)
-
removeAttribute
public Object removeAttribute(String key)
- Specified by:
removeAttributein interfaceStream- Parameters:
key- the attribute key- Returns:
- the arbitrary object associated with the given key to this stream
- See Also:
Stream.setAttribute(String, Object)
-
isReset
public boolean isReset()
-
isClosed
public boolean isClosed()
-
isRemotelyClosed
public boolean isRemotelyClosed()
-
isLocallyClosed
public boolean isLocallyClosed()
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin classorg.eclipse.jetty.io.IdleTimeout
-
onIdleExpired
protected void onIdleExpired(TimeoutException timeout)
- Specified by:
onIdleExpiredin classorg.eclipse.jetty.io.IdleTimeout
-
getListener
public Stream.Listener getListener()
- Specified by:
getListenerin interfaceIStream- Returns:
- the
Stream.Listenerassociated with this stream - See Also:
IStream.setListener(Listener)
-
setListener
public void setListener(Stream.Listener listener)
- Specified by:
setListenerin interfaceIStream- Parameters:
listener- theStream.Listenerassociated with this stream- See Also:
IStream.getListener()
-
process
public void process(Frame frame, org.eclipse.jetty.util.Callback callback)
Description copied from interface:IStreamProcesses the given
frame, belonging to this stream.
-
updateClose
public boolean updateClose(boolean update, boolean local)Description copied from interface:IStreamUpdates the close state of this stream.
- Specified by:
updateClosein interfaceIStream- Parameters:
update- whether to update the close statelocal- whether the update comes from a local operation (such as sending a frame that ends the stream) or a remote operation (such as receiving a frame- Returns:
- whether the stream has been fully closed by this invocation
-
getSendWindow
public int getSendWindow()
-
getRecvWindow
public int getRecvWindow()
-
updateSendWindow
public int updateSendWindow(int delta)
Description copied from interface:IStreamUpdates the stream send window by the given
delta.- Specified by:
updateSendWindowin interfaceIStream- Parameters:
delta- the delta value (positive or negative) to add to the stream send window- Returns:
- the previous value of the stream send window
-
updateRecvWindow
public int updateRecvWindow(int delta)
Description copied from interface:IStreamUpdates the stream receive window by the given
delta.- Specified by:
updateRecvWindowin interfaceIStream- Parameters:
delta- the delta value (positive or negative) to add to the stream receive window- Returns:
- the previous value of the stream receive window
-
close
public void close()
Description copied from interface:IStreamForcibly closes this stream.
-
-