blob: f5ed315d13273e080fd7304b1d7dfaa4201ec307 [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>ServletConnection</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
<link rel="shortcut icon" href="/img/jakarta-favicon.ico">
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ServletConnection";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":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="../../jakarta/servlet/ServletConfig.html" title="interface in jakarta.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/servlet/ServletContainerInitializer.html" title="interface in jakarta.servlet"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/servlet/ServletConnection.html" target="_top">Frames</a></li>
<li><a href="ServletConnection.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">jakarta.servlet</div>
<h2 title="Interface ServletConnection" class="title">Interface ServletConnection</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">ServletConnection</span></pre>
<div class="block">Provides information about the connection made to the Servlet container. This interface is intended primarily for
debugging purposes and as such provides the raw information as seen by the container. Unless explicitly stated
otherwise in the Javadoc for a method, no adjustment is made for the presence of reverse proxies or similar
configurations.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>Servlet 6.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>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/ServletConnection.html#getConnectionId--">getConnectionId</a></span>()</code>
<div class="block">Obtain a unique (within the lifetime of the JVM) identifier string for the network connection to the JVM that is
being used for the <code>ServletRequest</code> from which this <code>ServletConnection</code> was obtained.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/ServletConnection.html#getProtocol--">getProtocol</a></span>()</code>
<div class="block">Obtain the name of the protocol as presented to the server after the removal, if present, of any TLS or similar
encryption.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/ServletConnection.html#getProtocolConnectionId--">getProtocolConnectionId</a></span>()</code>
<div class="block">Obtain the connection identifier for the network connection to the server that is being used for the
<code>ServletRequest</code> from which this <code>ServletConnection</code> was obtained as defined by the protocol in use.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/ServletConnection.html#isSecure--">isSecure</a></span>()</code>
<div class="block">Determine whether or not the incoming network connection to the server used encryption or not.</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="getConnectionId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getConnectionId</h4>
<pre>java.lang.String&nbsp;getConnectionId()</pre>
<div class="block">Obtain a unique (within the lifetime of the JVM) identifier string for the network connection to the JVM that is
being used for the <code>ServletRequest</code> from which this <code>ServletConnection</code> was obtained.
<p>
There is no defined format for this string. The format is implementation dependent.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A unique identifier for the network connection</dd>
</dl>
</li>
</ul>
<a name="getProtocol--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProtocol</h4>
<pre>java.lang.String&nbsp;getProtocol()</pre>
<div class="block">Obtain the name of the protocol as presented to the server after the removal, if present, of any TLS or similar
encryption. This may not be the same as the protocol seen by the application. For example, a reverse proxy may
present AJP whereas the application will see HTTP 1.1.
<p>
If the protocol has an entry in the <a href=
"https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids">IANA
registry for ALPN names</a> then the identification sequence, in string form, must be returned. Registered
identification sequences MUST only be used for the associated protocol. Return values for other protocols are
implementation dependent. Unknown protocols should return the string "unknown".</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The name of the protocol presented to the server after decryption of TLS, or similar encryption, if any.</dd>
</dl>
</li>
</ul>
<a name="getProtocolConnectionId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProtocolConnectionId</h4>
<pre>java.lang.String&nbsp;getProtocolConnectionId()</pre>
<div class="block">Obtain the connection identifier for the network connection to the server that is being used for the
<code>ServletRequest</code> from which this <code>ServletConnection</code> was obtained as defined by the protocol in use. Note
that some protocols do not define such an identifier.
<p>
Examples of protocol provided connection identifiers include:
<dl>
<dt>HTTP 1.x</dt>
<dd>None, so the empty string should be returned</dd>
<dt>HTTP 2</dt>
<dd>None, so the empty string should be returned</dd>
<dt>HTTP 3</dt>
<dd>The QUIC connection ID</dd>
<dt>AJP</dt>
<dd>None, so the empty string should be returned</dd>
</dl></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The connection identifier if one is defined, otherwise an empty string</dd>
</dl>
</li>
</ul>
<a name="isSecure--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isSecure</h4>
<pre>boolean&nbsp;isSecure()</pre>
<div class="block">Determine whether or not the incoming network connection to the server used encryption or not. Note that where a
reverse proxy is used, the application may have a different view as to whether encryption is being used due to the
use of headers like <code>X-Forwarded-Proto</code>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if the incoming network connection used encryption, otherwise <code>false</code></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="../../jakarta/servlet/ServletConfig.html" title="interface in jakarta.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/servlet/ServletContainerInitializer.html" title="interface in jakarta.servlet"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/servlet/ServletConnection.html" target="_top">Frames</a></li>
<li><a href="ServletConnection.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>