Stream.Listener
Callback.Completable, Callback.Nested
Invocable.InvocationType
__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 . |
java.lang.String |
dump() |
void |
dump(java.lang.Appendable out,
java.lang.String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.
|
void |
failed(java.lang.Throwable x)
Callback invoked when the operation fails.
|
java.lang.Object |
getAttachment() |
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()
This abstract method should be called to check if idle timeouts
should still be checked.
|
boolean |
isRemotelyClosed() |
boolean |
isReset() |
void |
onClose() |
protected void |
onIdleExpired(java.util.concurrent.TimeoutException timeout)
This abstract method is called when the idle timeout has expired.
|
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 |
setAttachment(java.lang.Object attachment)
Attaches the given object to this stream for later retrieval.
|
void |
setAttribute(java.lang.String key,
java.lang.Object value) |
void |
setListener(Stream.Listener listener) |
void |
succeeded()
Callback invoked when the operation completes.
|
java.lang.String |
toString() |
boolean |
updateClose(boolean update,
CloseState.Event event)
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, onOpen, setIdleTimeout
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIdleTimeout, setIdleTimeout
getInvocationType, getInvocationType, invokeNonBlocking, isNonBlockingInvocation
dump, dumpObject, dumpObjects, dumpSelf
public java.lang.Object getAttachment()
getAttachment
in interface IStream
IStream.setAttachment(Object)
public void setAttachment(java.lang.Object attachment)
IStream
setAttachment
in interface IStream
attachment
- the object to attach to this streampublic boolean isLocal()
public ISession getSession()
getSession
in interface Stream
getSession
in interface IStream
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()
isRemotelyClosed
in interface IStream
Stream.isClosed()
public boolean isLocallyClosed()
public boolean isOpen()
IdleTimeout
isOpen
in class IdleTimeout
protected void onIdleExpired(java.util.concurrent.TimeoutException timeout)
IdleTimeout
onIdleExpired
in class IdleTimeout
timeout
- a TimeoutExceptionpublic Stream.Listener getListener()
getListener
in interface IStream
Stream.Listener
associated with this streamIStream.setListener(Stream.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, CloseState.Event event)
IStream
Updates the close state of this stream.
updateClose
in interface IStream
update
- whether to update the close stateevent
- the event that caused the close state updatepublic 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 void onClose()
onClose
in class IdleTimeout
public void succeeded()
Callback
Callback invoked when the operation completes.
succeeded
in interface Callback
Callback.failed(Throwable)
public void failed(java.lang.Throwable x)
Callback
Callback invoked when the operation fails.
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Dumpable
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2023 Webtide. All rights reserved.