blob: 2786518f27586494c5992d413ffea145a10b01eb [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>ServerEndpointConfig.Configurator</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="ServerEndpointConfig.Configurator";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete 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/websocket/server/ServerEndpointConfig.Builder.html" title="class in javax.websocket.server"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/websocket/server/ServerEndpointConfig.Configurator.html" target="_top">Frames</a></li>
<li><a href="ServerEndpointConfig.Configurator.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&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.websocket.server</div>
<h2 title="Class ServerEndpointConfig.Configurator" class="title">Class ServerEndpointConfig.Configurator</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>javax.websocket.server.ServerEndpointConfig.Configurator</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing interface:</dt>
<dd><a href="../../../javax/websocket/server/ServerEndpointConfig.html" title="interface in javax.websocket.server">ServerEndpointConfig</a></dd>
</dl>
<hr>
<br>
<pre>public static class <span class="typeNameLabel">ServerEndpointConfig.Configurator</span>
extends java.lang.Object</pre>
<div class="block">The ServerEndpointConfig.Configurator class may be extended by developers who want to provide custom
configuration algorithms, such as intercepting the opening handshake, or providing arbitrary methods and
algorithms that can be accessed from each endpoint instance configured with this configurator.
The implementation must provide a platform default configurator loading using the service loader.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/websocket/server/ServerEndpointConfig.Configurator.html#Configurator--">Configurator</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== 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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/websocket/server/ServerEndpointConfig.Configurator.html#checkOrigin-java.lang.String-">checkOrigin</a></span>(java.lang.String&nbsp;originHeaderValue)</code>
<div class="block">Check the value of the Origin header (<a href="http://tools.ietf.org/html/rfc6454">See Origin Header</a>) the
client passed during the opening handshake.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/websocket/server/ServerEndpointConfig.Configurator.html#getEndpointInstance-java.lang.Class-">getEndpointInstance</a></span>(java.lang.Class&lt;T&gt;&nbsp;endpointClass)</code>
<div class="block">This method is called by the container each time a new client connects to the logical endpoint this
configurator configures.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.util.List&lt;<a href="../../../javax/websocket/Extension.html" title="interface in javax.websocket">Extension</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/websocket/server/ServerEndpointConfig.Configurator.html#getNegotiatedExtensions-java.util.List-java.util.List-">getNegotiatedExtensions</a></span>(java.util.List&lt;<a href="../../../javax/websocket/Extension.html" title="interface in javax.websocket">Extension</a>&gt;&nbsp;installed,
java.util.List&lt;<a href="../../../javax/websocket/Extension.html" title="interface in javax.websocket">Extension</a>&gt;&nbsp;requested)</code>
<div class="block">Return the ordered list of extensions that t server endpoint will support given the requested extension list
passed in, the empty list if none.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/websocket/server/ServerEndpointConfig.Configurator.html#getNegotiatedSubprotocol-java.util.List-java.util.List-">getNegotiatedSubprotocol</a></span>(java.util.List&lt;java.lang.String&gt;&nbsp;supported,
java.util.List&lt;java.lang.String&gt;&nbsp;requested)</code>
<div class="block">Return the subprotocol the server endpoint has chosen from the requested list supplied by a client who wishes
to connect, or none if there wasn't one this server endpoint liked.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/websocket/server/ServerEndpointConfig.Configurator.html#modifyHandshake-javax.websocket.server.ServerEndpointConfig-javax.websocket.server.HandshakeRequest-javax.websocket.HandshakeResponse-">modifyHandshake</a></span>(<a href="../../../javax/websocket/server/ServerEndpointConfig.html" title="interface in javax.websocket.server">ServerEndpointConfig</a>&nbsp;sec,
<a href="../../../javax/websocket/server/HandshakeRequest.html" title="interface in javax.websocket.server">HandshakeRequest</a>&nbsp;request,
<a href="../../../javax/websocket/HandshakeResponse.html" title="interface in javax.websocket">HandshakeResponse</a>&nbsp;response)</code>
<div class="block">Called by the container after it has formulated a handshake response resulting from a well-formed handshake
request.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Configurator--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Configurator</h4>
<pre>public&nbsp;Configurator()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getNegotiatedSubprotocol-java.util.List-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNegotiatedSubprotocol</h4>
<pre>public&nbsp;java.lang.String&nbsp;getNegotiatedSubprotocol(java.util.List&lt;java.lang.String&gt;&nbsp;supported,
java.util.List&lt;java.lang.String&gt;&nbsp;requested)</pre>
<div class="block">Return the subprotocol the server endpoint has chosen from the requested list supplied by a client who wishes
to connect, or none if there wasn't one this server endpoint liked. See
<a href="http://tools.ietf.org/html/rfc6455#section-4.2.2">Sending the Server's Opening Handshake</a>.
Subclasses may provide custom algorithms based on other factors.
<p>
The default platform implementation of this method returns the first subprotocol in the list sent by the
client that the server supports, or the empty string if there isn't one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>requested</code> - the requested subprotocols from the client endpoint</dd>
<dd><code>supported</code> - the subprotocols supported by the server endpoint</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the negotiated subprotocol or the empty string if there isn't one.</dd>
</dl>
</li>
</ul>
<a name="getNegotiatedExtensions-java.util.List-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNegotiatedExtensions</h4>
<pre>public&nbsp;java.util.List&lt;<a href="../../../javax/websocket/Extension.html" title="interface in javax.websocket">Extension</a>&gt;&nbsp;getNegotiatedExtensions(java.util.List&lt;<a href="../../../javax/websocket/Extension.html" title="interface in javax.websocket">Extension</a>&gt;&nbsp;installed,
java.util.List&lt;<a href="../../../javax/websocket/Extension.html" title="interface in javax.websocket">Extension</a>&gt;&nbsp;requested)</pre>
<div class="block">Return the ordered list of extensions that t server endpoint will support given the requested extension list
passed in, the empty list if none. See <a href="http://tools.ietf.org/html/rfc6455#section-9.1">Negotiating
Extensions</a>
<p>
The default platform implementation of this method returns a list containing all of the requested extensions
passed to this method that it supports, using the order in the requested extensions, the empty list if none.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>installed</code> - the installed extensions on the implementation.</dd>
<dd><code>requested</code> - the requested extensions, in the order they were requested by the client</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the list of extensions negotiated, the empty list if none.</dd>
</dl>
</li>
</ul>
<a name="checkOrigin-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkOrigin</h4>
<pre>public&nbsp;boolean&nbsp;checkOrigin(java.lang.String&nbsp;originHeaderValue)</pre>
<div class="block">Check the value of the Origin header (<a href="http://tools.ietf.org/html/rfc6454">See Origin Header</a>) the
client passed during the opening handshake.
<p>
The platform default implementation of this method makes a check of the validity of the Origin header sent
along with the opening handshake following the recommendation at:
<a href="http://tools.ietf.org/html/rfc6455#section-4.2">Sending the Server's Opening Handshake</a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>originHeaderValue</code> - the value of the origin header passed by the client.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether the check passed or not</dd>
</dl>
</li>
</ul>
<a name="modifyHandshake-javax.websocket.server.ServerEndpointConfig-javax.websocket.server.HandshakeRequest-javax.websocket.HandshakeResponse-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>modifyHandshake</h4>
<pre>public&nbsp;void&nbsp;modifyHandshake(<a href="../../../javax/websocket/server/ServerEndpointConfig.html" title="interface in javax.websocket.server">ServerEndpointConfig</a>&nbsp;sec,
<a href="../../../javax/websocket/server/HandshakeRequest.html" title="interface in javax.websocket.server">HandshakeRequest</a>&nbsp;request,
<a href="../../../javax/websocket/HandshakeResponse.html" title="interface in javax.websocket">HandshakeResponse</a>&nbsp;response)</pre>
<div class="block">Called by the container after it has formulated a handshake response resulting from a well-formed handshake
request. The container has already checked that this configuration has a matching URI, determined the
validity of the origin using the checkOrigin method, and filled out the negotiated subprotocols and
extensions based on this configuration. Custom configurations may override this method in order to inspect
the request parameters and modify the handshake response that the server has formulated. and the URI checking
also.
<p>
If the developer does not override this method, no further modification of the request and response are made
by the implementation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sec</code> - the configuration object involved in the handshake</dd>
<dd><code>request</code> - the opening handshake request.</dd>
<dd><code>response</code> - the proposed opening handshake response</dd>
</dl>
</li>
</ul>
<a name="getEndpointInstance-java.lang.Class-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getEndpointInstance</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;T&nbsp;getEndpointInstance(java.lang.Class&lt;T&gt;&nbsp;endpointClass)
throws java.lang.InstantiationException</pre>
<div class="block">This method is called by the container each time a new client connects to the logical endpoint this
configurator configures. Developers may override this method to control instantiation of endpoint instances
in order to customize the initialization of the endpoint instance, or manage them in some other way. If the
developer overrides this method, services like dependency injection that are otherwise supported, for
example, when the implementation is part of the Java EE platform may not be available. The platform default
implementation of this method returns a new endpoint instance per call, thereby ensuring that there is one
endpoint instance per client, the default deployment cardinality.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the type of the endpoint</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>endpointClass</code> - the class of the endpoint</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an instance of the endpoint that will handle all interactions from a new client.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.InstantiationException</code> - if there was an error producing the endpoint instance.</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/websocket/server/ServerEndpointConfig.Builder.html" title="class in javax.websocket.server"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/websocket/server/ServerEndpointConfig.Configurator.html" target="_top">Frames</a></li>
<li><a href="ServerEndpointConfig.Configurator.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&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>