blob: a48af792e23527a04aa256ce3677c3dd35a5b9cc [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>Request</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Request";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":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";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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">
<li><a href="../../../../javax/ws/rs/core/PathSegment.html" title="interface in javax.ws.rs.core"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../javax/ws/rs/core/Response.html" title="class in javax.ws.rs.core"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?javax/ws/rs/core/Request.html" target="_top">Frames</a></li>
<li><a href="Request.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&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 name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.ws.rs.core</div>
<h2 title="Interface Request" class="title">Interface Request</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Request</span></pre>
<div class="block">An injectable helper for request processing, all methods throw an
<code>IllegalStateException</code> if called outside the scope of a request
(e.g. from a provider constructor).
Precondition processing (see the <code>evaluatePreconditions</code> methods)
can result in either a <code>null</code> return value to indicate that
preconditions have been met and that the request should continue, or
a non-<code>null</code> return value to indicate that preconditions were not met. In the
event that preconditions were not met, the returned <code>ResponseBuilder</code>
instance will have an appropriate status and will also include a <code>Vary</code>
header if the <a href="../../../../javax/ws/rs/core/Request.html#selectVariant-java.util.List-"><code>selectVariant(List)</code></a> method was called prior to to calling
<code>evaluatePreconditions</code>. It is the responsibility of the caller
to check the status and add additional metadata if required. E.g., see
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1, section 10.3.5</a>
for details of the headers that are expected to accompany a <code>304 Not Modified</code>
response.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<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="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/ws/rs/core/Request.html#evaluatePreconditions--">evaluatePreconditions</a></span>()</code>
<div class="block">Evaluate request preconditions for a resource that does not currently
exist.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/ws/rs/core/Request.html#evaluatePreconditions-java.util.Date-">evaluatePreconditions</a></span>(java.util.Date&nbsp;lastModified)</code>
<div class="block">Evaluate request preconditions based on the passed in value.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/ws/rs/core/Request.html#evaluatePreconditions-java.util.Date-javax.ws.rs.core.EntityTag-">evaluatePreconditions</a></span>(java.util.Date&nbsp;lastModified,
<a href="../../../../javax/ws/rs/core/EntityTag.html" title="class in javax.ws.rs.core">EntityTag</a>&nbsp;eTag)</code>
<div class="block">Evaluate request preconditions based on the passed in value.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/ws/rs/core/Request.html#evaluatePreconditions-javax.ws.rs.core.EntityTag-">evaluatePreconditions</a></span>(<a href="../../../../javax/ws/rs/core/EntityTag.html" title="class in javax.ws.rs.core">EntityTag</a>&nbsp;eTag)</code>
<div class="block">Evaluate request preconditions based on the passed in value.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/ws/rs/core/Request.html#getMethod--">getMethod</a></span>()</code>
<div class="block">Get the request method, e.g.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../javax/ws/rs/core/Variant.html" title="class in javax.ws.rs.core">Variant</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../javax/ws/rs/core/Request.html#selectVariant-java.util.List-">selectVariant</a></span>(java.util.List&lt;<a href="../../../../javax/ws/rs/core/Variant.html" title="class in javax.ws.rs.core">Variant</a>&gt;&nbsp;variants)</code>
<div class="block">Select the representation variant that best matches the request.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getMethod--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMethod</h4>
<pre>java.lang.String&nbsp;getMethod()</pre>
<div class="block">Get the request method, e.g. GET, POST, etc.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the request method.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../javax/ws/rs/HttpMethod.html" title="annotation in javax.ws.rs"><code>HttpMethod</code></a></dd>
</dl>
</li>
</ul>
<a name="selectVariant-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectVariant</h4>
<pre><a href="../../../../javax/ws/rs/core/Variant.html" title="class in javax.ws.rs.core">Variant</a>&nbsp;selectVariant(java.util.List&lt;<a href="../../../../javax/ws/rs/core/Variant.html" title="class in javax.ws.rs.core">Variant</a>&gt;&nbsp;variants)</pre>
<div class="block">Select the representation variant that best matches the request. Returns
<code>null</code> in case there is no matching variant in the list.
<p>
More explicit variants are chosen ahead of less explicit ones. A vary header
is computed from the supplied list and automatically added to the response.
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>variants</code> - a list of Variant that describe all of the available representation
variants.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the variant that best matches the request or <code>null</code> if there's no match.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if variants is empty or <code>null</code>.</dd>
<dd><code>java.lang.IllegalStateException</code> - if called outside the scope of a request.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../javax/ws/rs/core/Variant.VariantListBuilder.html" title="class in javax.ws.rs.core"><code>Variant.VariantListBuilder</code></a></dd>
</dl>
</li>
</ul>
<a name="evaluatePreconditions-javax.ws.rs.core.EntityTag-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluatePreconditions</h4>
<pre><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a>&nbsp;evaluatePreconditions(<a href="../../../../javax/ws/rs/core/EntityTag.html" title="class in javax.ws.rs.core">EntityTag</a>&nbsp;eTag)</pre>
<div class="block">Evaluate request preconditions based on the passed in value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>eTag</code> - an ETag for the current state of the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>null</code> if the preconditions are met or a <code>ResponseBuilder</code> set with
the appropriate status if the preconditions are not met. A returned
<code>ResponseBuilder</code> will include an ETag header set with the value of eTag,
provided none of the precondition evaluation has failed, in which case
the ETag header would not be included and the status code of the returned
<code>ResponseBuilder</code> would be set to <a href="../../../../javax/ws/rs/core/Response.Status.html#PRECONDITION_FAILED"><code>Response.Status.PRECONDITION_FAILED</code></a>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if eTag is <code>null</code>.</dd>
<dd><code>java.lang.IllegalStateException</code> - if called outside the scope of a request.</dd>
</dl>
</li>
</ul>
<a name="evaluatePreconditions-java.util.Date-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluatePreconditions</h4>
<pre><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a>&nbsp;evaluatePreconditions(java.util.Date&nbsp;lastModified)</pre>
<div class="block">Evaluate request preconditions based on the passed in value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>lastModified</code> - a date that specifies the modification date of the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>null</code> if the preconditions are met or a <code>ResponseBuilder</code> set with
the appropriate status if the preconditions are not met.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if lastModified is <code>null</code>.</dd>
<dd><code>java.lang.IllegalStateException</code> - if called outside the scope of a request.</dd>
</dl>
</li>
</ul>
<a name="evaluatePreconditions-java.util.Date-javax.ws.rs.core.EntityTag-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>evaluatePreconditions</h4>
<pre><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a>&nbsp;evaluatePreconditions(java.util.Date&nbsp;lastModified,
<a href="../../../../javax/ws/rs/core/EntityTag.html" title="class in javax.ws.rs.core">EntityTag</a>&nbsp;eTag)</pre>
<div class="block">Evaluate request preconditions based on the passed in value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>lastModified</code> - a date that specifies the modification date of the resource</dd>
<dd><code>eTag</code> - an ETag for the current state of the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>null</code> if the preconditions are met or a <code>ResponseBuilder</code> set with
the appropriate status if the preconditions are not met. A returned
<code>ResponseBuilder</code> will include an ETag header set with the value of eTag,
provided none of the precondition evaluation has failed, in which case
the ETag header would not be included and the status code of the returned
<code>ResponseBuilder</code> would be set to <a href="../../../../javax/ws/rs/core/Response.Status.html#PRECONDITION_FAILED"><code>Response.Status.PRECONDITION_FAILED</code></a>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if lastModified or eTag is <code>null</code>.</dd>
<dd><code>java.lang.IllegalStateException</code> - if called outside the scope of a request.</dd>
</dl>
</li>
</ul>
<a name="evaluatePreconditions--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>evaluatePreconditions</h4>
<pre><a href="../../../../javax/ws/rs/core/Response.ResponseBuilder.html" title="class in javax.ws.rs.core">Response.ResponseBuilder</a>&nbsp;evaluatePreconditions()</pre>
<div class="block">Evaluate request preconditions for a resource that does not currently
exist. The primary use of this method is to support the <a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24">
If-Match: *</a> and <a
href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26">
If-None-Match: *</a> preconditions.
<p>Note that both preconditions <code>If-None-Match: *</code> and
<code>If-None-Match: <i>something</i></code> will always be considered to
have been met and it is the applications responsibility
to enforce any additional method-specific semantics. E.g. a
<code>PUT</code> on a resource that does not exist might succeed whereas
a <code>GET</code> on a resource that does not exist would likely result
in a 404 response. It would be the responsibility of the application to
generate the 404 response.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>null</code> if the preconditions are met or a <code>ResponseBuilder</code> set with
the appropriate status if the preconditions are not met.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if called outside the scope of a request.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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">
<li><a href="../../../../javax/ws/rs/core/PathSegment.html" title="interface in javax.ws.rs.core"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../javax/ws/rs/core/Response.html" title="class in javax.ws.rs.core"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?javax/ws/rs/core/Request.html" target="_top">Frames</a></li>
<li><a href="Request.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&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 name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>