public class HTTP2Stream extends IdleTimeout implements IStream
Stream.Listener
CHANNEL_ATTRIBUTE
Constructor | Description |
---|---|
HTTP2Stream(Scheduler scheduler,
ISession session,
int streamId,
boolean local) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Forcibly closes this stream.
|
void |
data(DataFrame frame,
Callback callback) |
Sends the given DATA
frame . |
java.lang.Object |
getAttribute(java.lang.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(java.util.concurrent.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 . |
java.lang.Object |
removeAttribute(java.lang.String key) |
|
void |
reset(ResetFrame frame,
Callback callback) |
Sends the given RST_STREAM
frame . |
void |
setAttribute(java.lang.String key,
java.lang.Object value) |
|
void |
setListener(Stream.Listener listener) |
|
java.lang.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, setIdleTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIdleTimeout, setIdleTimeout
public boolean isLocal()
public ISession getSession()
getSession
in interface IStream
getSession
in interface Stream
public void headers(HeadersFrame frame, Callback callback)
Stream
Sends the given HEADERS frame
representing a HTTP response.
public void push(PushPromiseFrame frame, Promise<Stream> promise, Stream.Listener listener)
Stream
Sends the given PUSH_PROMISE frame
.
public void data(DataFrame frame, Callback callback)
Stream
Sends the given DATA frame
.
public void reset(ResetFrame frame, Callback callback)
Stream
Sends the given RST_STREAM frame
.
public java.lang.Object getAttribute(java.lang.String key)
getAttribute
in interface Stream
key
- the attribute keyStream.setAttribute(String, Object)
public void setAttribute(java.lang.String key, java.lang.Object value)
setAttribute
in interface Stream
key
- the attribute keyvalue
- an arbitrary object to associate with the given key to this streamStream.getAttribute(String)
,
Stream.removeAttribute(String)
public java.lang.Object removeAttribute(java.lang.String key)
removeAttribute
in interface Stream
key
- the attribute keyStream.setAttribute(String, Object)
public boolean isReset()
public boolean isClosed()
public boolean isRemotelyClosed()
public boolean isLocallyClosed()
public boolean isOpen()
isOpen
in class IdleTimeout
protected void onIdleExpired(java.util.concurrent.TimeoutException timeout)
onIdleExpired
in class IdleTimeout
public Stream.Listener getListener()
getListener
in interface IStream
Stream.Listener
associated with this streamIStream.setListener(Listener)
public void setListener(Stream.Listener listener)
setListener
in interface IStream
listener
- the Stream.Listener
associated with this streamIStream.getListener()
public void process(Frame frame, Callback callback)
IStream
Processes the given frame
, belonging to this stream.
public boolean updateClose(boolean update, boolean local)
IStream
Updates the close state of this stream.
updateClose
in interface IStream
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 framepublic int getSendWindow()
public int getRecvWindow()
public int updateSendWindow(int delta)
IStream
Updates the stream send window by the given delta
.
updateSendWindow
in interface IStream
delta
- the delta value (positive or negative) to add to the stream send windowpublic int updateRecvWindow(int delta)
IStream
Updates the stream receive window by the given delta
.
updateRecvWindow
in interface IStream
delta
- the delta value (positive or negative) to add to the stream receive windowpublic void close()
IStream
Forcibly closes this stream.
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2017 Webtide. All rights reserved.