public class HTTP2Stream extends IdleTimeout implements IStream, Callback
Stream.ListenerCallback.Completable, Callback.NestedInvocable.InvocationTypeCHANNEL_ATTRIBUTE__nonBlocking| Constructor and Description |
|---|
HTTP2Stream(Scheduler scheduler,
ISession session,
int streamId,
boolean local) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Forcibly closes this stream.
|
void |
data(DataFrame frame,
Callback callback)
Sends the given DATA
frame. |
void |
failed(Throwable x) |
Object |
getAttribute(String key) |
int |
getId() |
Stream.Listener |
getListener() |
int |
getRecvWindow() |
int |
getSendWindow() |
ISession |
getSession() |
void |
headers(HeadersFrame frame,
Callback callback)
Sends the given HEADERS
frame representing a HTTP response. |
boolean |
isClosed() |
boolean |
isLocal() |
boolean |
isLocallyClosed() |
boolean |
isOpen() |
boolean |
isRemotelyClosed() |
boolean |
isReset() |
protected void |
onIdleExpired(TimeoutException timeout) |
void |
process(Frame frame,
Callback callback)
Processes the given
frame, belonging to this stream. |
void |
push(PushPromiseFrame frame,
Promise<Stream> promise,
Stream.Listener listener)
Sends the given PUSH_PROMISE
frame. |
Object |
removeAttribute(String key) |
void |
reset(ResetFrame frame,
Callback callback)
Sends the given RST_STREAM
frame. |
void |
setAttribute(String key,
Object value) |
void |
setListener(Stream.Listener listener) |
void |
succeeded() |
String |
toString() |
boolean |
updateClose(boolean update,
boolean local)
Updates the close state of this stream.
|
int |
updateRecvWindow(int delta)
Updates the stream receive window by the given
delta. |
int |
updateSendWindow(int delta)
Updates the stream send window by the given
delta. |
checkIdleTimeout, getIdleFor, getIdleTimeout, getIdleTimestamp, getScheduler, notIdle, onClose, onOpen, setIdleTimeoutclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIdleTimeout, setIdleTimeoutasPreferred, getInvocationType, getInvocationType, invokeNonBlocking, invokePreferNonBlocking, invokePreferred, isNonBlockingInvocationpublic boolean isLocal()
public ISession getSession()
getSession in interface StreamgetSession in interface IStreampublic void headers(HeadersFrame frame, Callback callback)
StreamSends the given HEADERS frame representing a HTTP response.
public void push(PushPromiseFrame frame, Promise<Stream> promise, Stream.Listener listener)
StreamSends the given PUSH_PROMISE frame.
public void data(DataFrame frame, Callback callback)
StreamSends the given DATA frame.
public void reset(ResetFrame frame, Callback callback)
StreamSends the given RST_STREAM frame.
public Object getAttribute(String key)
getAttribute in interface Streamkey - the attribute keyStream.setAttribute(String, Object)public void setAttribute(String key, Object value)
setAttribute in interface Streamkey - the attribute keyvalue - an arbitrary object to associate with the given key to this streamStream.getAttribute(String),
Stream.removeAttribute(String)public Object removeAttribute(String key)
removeAttribute in interface Streamkey - the attribute keyStream.setAttribute(String, Object)public boolean isReset()
public boolean isClosed()
public boolean isRemotelyClosed()
public boolean isLocallyClosed()
public boolean isOpen()
isOpen in class IdleTimeoutprotected void onIdleExpired(TimeoutException timeout)
onIdleExpired in class IdleTimeoutpublic Stream.Listener getListener()
getListener in interface IStreamStream.Listener associated with this stream#setListener(Listener)public void setListener(Stream.Listener listener)
setListener in interface IStreamlistener - the Stream.Listener associated with this streamIStream.getListener()public void process(Frame frame, Callback callback)
IStreamProcesses the given frame, belonging to this stream.
public boolean updateClose(boolean update,
boolean local)
IStreamUpdates the close state of this stream.
updateClose in interface IStreamupdate - 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 framepublic int getSendWindow()
public int getRecvWindow()
public int updateSendWindow(int delta)
IStreamUpdates the stream send window by the given delta.
updateSendWindow in interface IStreamdelta - the delta value (positive or negative) to add to the stream send windowpublic int updateRecvWindow(int delta)
IStreamUpdates the stream receive window by the given delta.
updateRecvWindow in interface IStreamdelta - the delta value (positive or negative) to add to the stream receive windowpublic void close()
IStreamForcibly closes this stream.
Copyright © 1995–2017 Webtide. All rights reserved.