blob: 7709c8594d81562a7b0b7402900c97f2323cef08 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.13) on Tue Feb 08 12:41:33 CST 2022 -->
<title>Stream (Eclipse Jetty API Doc - v11.0.8)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2022-02-08">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Stream (Eclipse Jetty API Doc - v11.0.8)";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Stream.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.eclipse.jetty.http3.api</a></div>
<h2 title="Interface Stream" class="title">Interface Stream</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><code><a href="Stream.Client.html" title="interface in org.eclipse.jetty.http3.api">Stream.Client</a></code>, <code><a href="Stream.Server.html" title="interface in org.eclipse.jetty.http3.api">Stream.Server</a></code></dd>
</dl>
<hr>
<pre>public interface <span class="typeNameLabel">Stream</span></pre>
<div class="block"><p>A <a href="Stream.html" title="interface in org.eclipse.jetty.http3.api"><code>Stream</code></a> represents a bidirectional exchange of data within a <a href="Session.html" title="interface in org.eclipse.jetty.http3.api"><code>Session</code></a>.</p>
<p>A <a href="Stream.html" title="interface in org.eclipse.jetty.http3.api"><code>Stream</code></a> maps to an HTTP/3 request/response cycle, and after the request/response
cycle is completed, the stream is closed and removed from the <a href="Session.html" title="interface in org.eclipse.jetty.http3.api"><code>Session</code></a>.</p>
<p>Like <a href="Session.html" title="interface in org.eclipse.jetty.http3.api"><code>Session</code></a>, <a href="Stream.html" title="interface in org.eclipse.jetty.http3.api"><code>Stream</code></a> is the active part and by calling its API applications
can generate events on the stream; conversely, <a href="Stream.Client.Listener.html" title="interface in org.eclipse.jetty.http3.api"><code>Stream.Client.Listener</code></a> and
<a href="Stream.Server.Listener.html" title="interface in org.eclipse.jetty.http3.api"><code>Stream.Server.Listener</code></a> are the passive part, and their callbacks are invoked when
events happen on the stream.</p>
<p>The client initiates a stream by sending a HEADERS frame containing the HTTP/3 request URI
and request headers, and zero or more DATA frames containing request content.</p>
<p>Similarly, the server responds by sending a HEADERS frame containing the HTTP/3 response
status code and response headers, and zero or more DATA frames containing response content.</p>
<p>Both client and server can end their side of the stream by sending a final frame with
the <code>last</code> flag set to <code>true</code>, see <a href="../frames/HeadersFrame.html#%3Cinit%3E(org.eclipse.jetty.http.MetaData,boolean)"><code>HeadersFrame(MetaData, boolean)</code></a>
and <a href="../frames/DataFrame.html#%3Cinit%3E(java.nio.ByteBuffer,boolean)"><code>DataFrame(ByteBuffer, boolean)</code></a>.</p></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Stream.Client.html" title="interface in org.eclipse.jetty.http3.api">Stream.Client</a></span></code></th>
<td class="colLast">
<div class="block">The client side version of <a href="Stream.html" title="interface in org.eclipse.jetty.http3.api"><code>Stream</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api">Stream.Data</a></span></code></th>
<td class="colLast">
<div class="block">A <a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api"><code>Stream.Data</code></a> instance associates a <code>ByteBuffer</code>
containing request bytes or response bytes with a completion event
that applications <em>must</em> trigger when the bytes have been
processed.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Stream.Server.html" title="interface in org.eclipse.jetty.http3.api">Stream.Server</a></span></code></th>
<td class="colLast">
<div class="block">The server side version of <a href="Stream.html" title="interface in org.eclipse.jetty.http3.api"><code>Stream</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.util.concurrent.CompletableFuture&lt;<a href="Stream.html" title="interface in org.eclipse.jetty.http3.api">Stream</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#data(org.eclipse.jetty.http3.frames.DataFrame)">data</a></span>&#8203;(<a href="../frames/DataFrame.html" title="class in org.eclipse.jetty.http3.frames">DataFrame</a>&nbsp;frame)</code></th>
<td class="colLast">
<div class="block">Sends the given DATA frame containing some or all the bytes
of the request content or of the response content.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#demand()">demand</a></span>()</code></th>
<td class="colLast">
<div class="block">Causes <a href="Stream.Client.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Client)"><code>Stream.Client.Listener.onDataAvailable(Stream.Client)</code></a>
on the client, or <a href="Stream.Server.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Server)"><code>Stream.Server.Listener.onDataAvailable(Stream.Server)</code></a>
on the server, to be invoked, possibly at a later time, when the stream
has data to be read.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getId()">getId</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="Session.html" title="interface in org.eclipse.jetty.http3.api">Session</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSession()">getSession</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api">Stream.Data</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#readData()">readData</a></span>()</code></th>
<td class="colLast">
<div class="block">Reads request content bytes or response content bytes.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reset(long,java.lang.Throwable)">reset</a></span>&#8203;(long&nbsp;error,
java.lang.Throwable&nbsp;failure)</code></th>
<td class="colLast">
<div class="block">Abruptly terminates this stream with the given error.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>java.util.concurrent.CompletableFuture&lt;<a href="Stream.html" title="interface in org.eclipse.jetty.http3.api">Stream</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#trailer(org.eclipse.jetty.http3.frames.HeadersFrame)">trailer</a></span>&#8203;(<a href="../frames/HeadersFrame.html" title="class in org.eclipse.jetty.http3.frames">HeadersFrame</a>&nbsp;frame)</code></th>
<td class="colLast">
<div class="block">Sends the given HEADERS frame containing the trailer headers.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre class="methodSignature">long&nbsp;getId()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the stream id</dd>
</dl>
</li>
</ul>
<a id="getSession()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSession</h4>
<pre class="methodSignature"><a href="Session.html" title="interface in org.eclipse.jetty.http3.api">Session</a>&nbsp;getSession()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the session this stream is associated to</dd>
</dl>
</li>
</ul>
<a id="data(org.eclipse.jetty.http3.frames.DataFrame)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>data</h4>
<pre class="methodSignature">java.util.concurrent.CompletableFuture&lt;<a href="Stream.html" title="interface in org.eclipse.jetty.http3.api">Stream</a>&gt;&nbsp;data&#8203;(<a href="../frames/DataFrame.html" title="class in org.eclipse.jetty.http3.frames">DataFrame</a>&nbsp;frame)</pre>
<div class="block"><p>Sends the given DATA frame containing some or all the bytes
of the request content or of the response content.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>frame</code> - the DATA frame containing some or all the bytes of the request or of the response.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>CompletableFuture</code> that gets notified when the frame has been sent</dd>
</dl>
</li>
</ul>
<a id="readData()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readData</h4>
<pre class="methodSignature"><a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api">Stream.Data</a>&nbsp;readData()</pre>
<div class="block"><p>Reads request content bytes or response content bytes.</p>
<p>The returned <a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api"><code>Stream.Data</code></a> object may be <code>null</code>, indicating
that the end of the read side of the stream has not yet been reached, which
may happen in these cases:</p>
<ul>
<li>not all the bytes have been received so far, for example the remote
peer did not send them yet, or they are in-flight</li>
<li>all the bytes have been received, but there is a trailer HEADERS
frame to be received to indicate the end of the read side of the
stream</li>
</ul>
<p>When the returned <a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api"><code>Stream.Data</code></a> object is not <code>null</code>,
applications <em>must</em> call, either immediately or later (possibly
asynchronously) <a href="Stream.Data.html#complete()"><code>Stream.Data.complete()</code></a> to notify the
implementation that the bytes have been processed.</p>
<p><a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api"><code>Stream.Data</code></a> objects may be stored away for later, asynchronous,
processing (for example, to process them only when all of them have been
received).</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="Stream.Data.html" title="class in org.eclipse.jetty.http3.api"><code>Stream.Data</code></a> object containing the request bytes or
the response bytes, or null if no bytes are available</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Stream.Client.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Client)"><code>Stream.Client.Listener.onDataAvailable(Stream.Client)</code></a>,
<a href="Stream.Server.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Server)"><code>Stream.Server.Listener.onDataAvailable(Stream.Server)</code></a></dd>
</dl>
</li>
</ul>
<a id="demand()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>demand</h4>
<pre class="methodSignature">void&nbsp;demand()</pre>
<div class="block"><p>Causes <a href="Stream.Client.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Client)"><code>Stream.Client.Listener.onDataAvailable(Stream.Client)</code></a>
on the client, or <a href="Stream.Server.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Server)"><code>Stream.Server.Listener.onDataAvailable(Stream.Server)</code></a>
on the server, to be invoked, possibly at a later time, when the stream
has data to be read.</p>
<p>This method is idempotent: calling it when there already is an
outstanding demand to invoke <code>onDataAvailable(Stream)</code>
is a no-operation.</p>
<p>The thread invoking this method may invoke directly
<code>onDataAvailable(Stream)</code>, unless another thread
that must invoke <code>onDataAvailable(Stream)</code>
notices the outstanding demand first.</p>
<p>When all bytes have been read (via <a href="#readData()"><code>readData()</code></a>), further
invocations of this method are a no-operation.</p>
<p>It is always guaranteed that invoking this method from within
<code>onDataAvailable(Stream)</code> will not cause a
<code>StackOverflowError</code>.</p></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#readData()"><code>readData()</code></a>,
<a href="Stream.Client.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Client)"><code>Stream.Client.Listener.onDataAvailable(Stream.Client)</code></a>,
<a href="Stream.Server.Listener.html#onDataAvailable(org.eclipse.jetty.http3.api.Stream.Server)"><code>Stream.Server.Listener.onDataAvailable(Stream.Server)</code></a></dd>
</dl>
</li>
</ul>
<a id="trailer(org.eclipse.jetty.http3.frames.HeadersFrame)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>trailer</h4>
<pre class="methodSignature">java.util.concurrent.CompletableFuture&lt;<a href="Stream.html" title="interface in org.eclipse.jetty.http3.api">Stream</a>&gt;&nbsp;trailer&#8203;(<a href="../frames/HeadersFrame.html" title="class in org.eclipse.jetty.http3.frames">HeadersFrame</a>&nbsp;frame)</pre>
<div class="block"><p>Sends the given HEADERS frame containing the trailer headers.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>frame</code> - the HEADERS frame containing the trailer headers</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>CompletableFuture</code> that gets notified when the frame has been sent</dd>
</dl>
</li>
</ul>
<a id="reset(long,java.lang.Throwable)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>reset</h4>
<pre class="methodSignature">void&nbsp;reset&#8203;(long&nbsp;error,
java.lang.Throwable&nbsp;failure)</pre>
<div class="block"><p>Abruptly terminates this stream with the given error.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>error</code> - the error code</dd>
<dd><code>failure</code> - the failure that caused the reset of the stream</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Stream.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 1995&#x2013;2022 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p>
</footer>
</body>
</html>