blob: 988b4aaa3c474b6718ae71482075411d450f7aa2 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.7) on Wed Jul 29 16:44:05 EDT 2020 -->
<title>DoSFilter (Jetty :: Project 9.4.31.v20200723 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-07-29">
<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.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.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="DoSFilter (Jetty :: Project 9.4.31.v20200723 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":42,"i3":10,"i4":42,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = false;
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/DoSFilter.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>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 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.servlets</a></div>
<h2 title="Class DoSFilter" class="title">Class DoSFilter</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.eclipse.jetty.servlets.DoSFilter</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code>javax.servlet.Filter</code></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="CloseableDoSFilter.html" title="class in org.eclipse.jetty.servlets">CloseableDoSFilter</a></code></dd>
</dl>
<hr>
<pre><a href="../util/annotation/ManagedObject.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedObject</a>("limits exposure to abuse from request flooding, whether malicious, or as a result of a misconfigured client")
public class <span class="typeNameLabel">DoSFilter</span>
extends java.lang.Object
implements javax.servlet.Filter</pre>
<div class="block">Denial of Service filter
<p>
This filter is useful for limiting
exposure to abuse from request flooding, whether malicious, or as a result of
a misconfigured client.
<p>
The filter keeps track of the number of requests from a connection per
second. If a limit is exceeded, the request is either rejected, delayed, or
throttled.
<p>
When a request is throttled, it is placed in a priority queue. Priority is
given first to authenticated users and users with an HttpSession, then
connections which can be identified by their IP addresses. Connections with
no way to identify them are given lowest priority.
<p>
The <a href="#extractUserId(javax.servlet.ServletRequest)"><code>extractUserId(ServletRequest request)</code></a> function should be
implemented, in order to uniquely identify authenticated users.
<p>
The following init parameters control the behavior of the filter:
<dl>
<dt>maxRequestsPerSec</dt>
<dd>the maximum number of requests from a connection per
second. Requests in excess of this are first delayed,
then throttled.</dd>
<dt>delayMs</dt>
<dd>is the delay given to all requests over the rate limit,
before they are considered at all. -1 means just reject request,
0 means no delay, otherwise it is the delay.</dd>
<dt>maxWaitMs</dt>
<dd>how long to blocking wait for the throttle semaphore.</dd>
<dt>throttledRequests</dt>
<dd>is the number of requests over the rate limit able to be
considered at once.</dd>
<dt>throttleMs</dt>
<dd>how long to async wait for semaphore.</dd>
<dt>maxRequestMs</dt>
<dd>how long to allow this request to run.</dd>
<dt>maxIdleTrackerMs</dt>
<dd>how long to keep track of request rates for a connection,
before deciding that the user has gone away, and discarding it</dd>
<dt>insertHeaders</dt>
<dd>if true , insert the DoSFilter headers into the response. Defaults to true.</dd>
<dt>trackSessions</dt>
<dd>if true, usage rate is tracked by session if a session exists. Defaults to true.</dd>
<dt>remotePort</dt>
<dd>if true and session tracking is not used, then rate is tracked by IP+port (effectively connection). Defaults to false.</dd>
<dt>ipWhitelist</dt>
<dd>a comma-separated list of IP addresses that will not be rate limited</dd>
<dt>managedAttr</dt>
<dd>if set to true, then this servlet is set as a <code>ServletContext</code> attribute with the
filter name as the attribute name. This allows context external mechanism (eg JMX via <a href="../server/handler/ContextHandler.html#MANAGED_ATTRIBUTES"><code>ContextHandler.MANAGED_ATTRIBUTES</code></a>) to
manage the configuration of the filter.</dd>
<dt>tooManyCode</dt>
<dd>The status code to send if there are too many requests. By default is 429 (too many requests), but 503 (Unavailable) is
another option</dd>
</dl>
<p>
This filter should be configured for <code>DispatcherType.REQUEST</code> and <code>DispatcherType.ASYNC</code> and with
<code>&lt;async-supported&gt;true&lt;/async-supported&gt;</code>.
</p></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">DoSFilter</a></span>()</code></th>
<td class="colLast">&nbsp;</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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated 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>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addWhitelistAddress(java.lang.String)">addWhitelistAddress</a></span>&#8203;(java.lang.String&nbsp;address)</code></th>
<td class="colLast">
<div class="block">Adds the given IP address, either in the form of a dotted decimal notation A.B.C.D
or in the CIDR notation A.B.C.D/M, to the list of whitelisted IP addresses.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#checkWhitelist(java.lang.String)">checkWhitelist</a></span>&#8203;(java.lang.String&nbsp;candidate)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#checkWhitelist(java.util.List,java.lang.String)">checkWhitelist</a></span>&#8203;(java.util.List&lt;java.lang.String&gt;&nbsp;whitelist,
java.lang.String&nbsp;candidate)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span></div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clearWhitelist()">clearWhitelist</a></span>()</code></th>
<td class="colLast">
<div class="block">Clears the list of whitelisted IP addresses</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#closeConnection(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Thread)">closeConnection</a></span>&#8203;(javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response,
java.lang.Thread&nbsp;thread)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">use <a href="#onRequestTimeout(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Thread)"><code>onRequestTimeout(HttpServletRequest, HttpServletResponse, Thread)</code></a> instead</div>
</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="#destroy()">destroy</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doFilter(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.FilterChain)">doFilter</a></span>&#8203;(javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response,
javax.servlet.FilterChain&nbsp;filterChain)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doFilter(javax.servlet.ServletRequest,javax.servlet.ServletResponse,javax.servlet.FilterChain)">doFilter</a></span>&#8203;(javax.servlet.ServletRequest&nbsp;request,
javax.servlet.ServletResponse&nbsp;response,
javax.servlet.FilterChain&nbsp;filterChain)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doFilterChain(javax.servlet.FilterChain,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)">doFilterChain</a></span>&#8203;(javax.servlet.FilterChain&nbsp;chain,
javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>protected java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#extractUserId(javax.servlet.ServletRequest)">extractUserId</a></span>&#8203;(javax.servlet.ServletRequest&nbsp;request)</code></th>
<td class="colLast">
<div class="block">Returns the user id, used to track this connection.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDelayMs()">getDelayMs</a></span>()</code></th>
<td class="colLast">
<div class="block">Get delay (in milliseconds) that is applied to all requests
over the rate limit, before they are considered at all.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxIdleTrackerMs()">getMaxIdleTrackerMs</a></span>()</code></th>
<td class="colLast">
<div class="block">Get maximum amount of time (in milliseconds) to keep track
of request rates for a connection, before deciding that
the user has gone away, and discarding it.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>protected int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxPriority()">getMaxPriority</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxRequestMs()">getMaxRequestMs</a></span>()</code></th>
<td class="colLast">
<div class="block">Get maximum amount of time (in milliseconds) to allow
the request to process.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxRequestsPerSec()">getMaxRequestsPerSec</a></span>()</code></th>
<td class="colLast">
<div class="block">Get maximum number of requests from a connection per
second.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxWaitMs()">getMaxWaitMs</a></span>()</code></th>
<td class="colLast">
<div class="block">Get maximum amount of time (in milliseconds) the filter will
blocking wait for the throttle semaphore.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getName()">getName</a></span>()</code></th>
<td class="colLast">
<div class="block">The unique name of the filter when there is more than
one DosFilter instance.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getThrottledRequests()">getThrottledRequests</a></span>()</code></th>
<td class="colLast">
<div class="block">Get number of requests over the rate limit able to be
considered at once.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getThrottleMs()">getThrottleMs</a></span>()</code></th>
<td class="colLast">
<div class="block">Get amount of time (in milliseconds) to async wait for semaphore.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTooManyCode()">getTooManyCode</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWhitelist()">getWhitelist</a></span>()</code></th>
<td class="colLast">
<div class="block">Get a list of IP addresses that will not be rate limited.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#init(javax.servlet.FilterConfig)">init</a></span>&#8203;(javax.servlet.FilterConfig&nbsp;filterConfig)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEnabled()">isEnabled</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isInsertHeaders()">isInsertHeaders</a></span>()</code></th>
<td class="colLast">
<div class="block">Check flag to insert the DoSFilter headers into the response.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isRemotePort()">isRemotePort</a></span>()</code></th>
<td class="colLast">
<div class="block">Get flag to have usage rate tracked by IP+port (effectively connection)
if session tracking is not used.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isTrackSessions()">isTrackSessions</a></span>()</code></th>
<td class="colLast">
<div class="block">Get flag to have usage rate tracked by session if a session exists.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onRequestTimeout(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Thread)">onRequestTimeout</a></span>&#8203;(javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response,
java.lang.Thread&nbsp;handlingThread)</code></th>
<td class="colLast">
<div class="block">Invoked when the request handling exceeds <a href="#getMaxRequestMs()"><code>getMaxRequestMs()</code></a>.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeFromRateTracker(java.lang.String)">removeFromRateTracker</a></span>&#8203;(java.lang.String&nbsp;id)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeWhitelistAddress(java.lang.String)">removeWhitelistAddress</a></span>&#8203;(java.lang.String&nbsp;address)</code></th>
<td class="colLast">
<div class="block">Removes the given address from the list of whitelisted IP addresses.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDelayMs(long)">setDelayMs</a></span>&#8203;(long&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set delay (in milliseconds) that is applied to all requests
over the rate limit, before they are considered at all.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEnabled(boolean)">setEnabled</a></span>&#8203;(boolean&nbsp;enabled)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setInsertHeaders(boolean)">setInsertHeaders</a></span>&#8203;(boolean&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set flag to insert the DoSFilter headers into the response.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMaxIdleTrackerMs(long)">setMaxIdleTrackerMs</a></span>&#8203;(long&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set maximum amount of time (in milliseconds) to keep track
of request rates for a connection, before deciding that
the user has gone away, and discarding it.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMaxRequestMs(long)">setMaxRequestMs</a></span>&#8203;(long&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set maximum amount of time (in milliseconds) to allow
the request to process.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMaxRequestsPerSec(int)">setMaxRequestsPerSec</a></span>&#8203;(int&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Get maximum number of requests from a connection per
second.</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMaxWaitMs(long)">setMaxWaitMs</a></span>&#8203;(long&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set maximum amount of time (in milliseconds) the filter will
blocking wait for the throttle semaphore.</div>
</td>
</tr>
<tr id="i36" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setName(java.lang.String)">setName</a></span>&#8203;(java.lang.String&nbsp;name)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i37" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setRemotePort(boolean)">setRemotePort</a></span>&#8203;(boolean&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set flag to have usage rate tracked by IP+port (effectively connection)
if session tracking is not used.</div>
</td>
</tr>
<tr id="i38" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setThrottledRequests(int)">setThrottledRequests</a></span>&#8203;(int&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set number of requests over the rate limit able to be
considered at once.</div>
</td>
</tr>
<tr id="i39" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setThrottleMs(long)">setThrottleMs</a></span>&#8203;(long&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set amount of time (in milliseconds) to async wait for semaphore.</div>
</td>
</tr>
<tr id="i40" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setTooManyCode(int)">setTooManyCode</a></span>&#8203;(int&nbsp;tooManyCode)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i41" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setTrackSessions(boolean)">setTrackSessions</a></span>&#8203;(boolean&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Set flag to have usage rate tracked by session if a session exists.</div>
</td>
</tr>
<tr id="i42" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setWhitelist(java.lang.String)">setWhitelist</a></span>&#8203;(java.lang.String&nbsp;commaSeparatedList)</code></th>
<td class="colLast">
<div class="block">Set a list of IP addresses that will not be rate limited.</div>
</td>
</tr>
<tr id="i43" class="rowColor">
<td class="colFirst"><code>protected <a href="../util/thread/Scheduler.html" title="interface in org.eclipse.jetty.util.thread">Scheduler</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#startScheduler()">startScheduler</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i44" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#stopScheduler()">stopScheduler</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i45" class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subnetMatch(java.lang.String,java.lang.String)">subnetMatch</a></span>&#8203;(java.lang.String&nbsp;subnetAddress,
java.lang.String&nbsp;address)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="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>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DoSFilter</h4>
<pre>public&nbsp;DoSFilter()</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="init(javax.servlet.FilterConfig)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;init&#8203;(javax.servlet.FilterConfig&nbsp;filterConfig)
throws javax.servlet.ServletException</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>init</code>&nbsp;in interface&nbsp;<code>javax.servlet.Filter</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>javax.servlet.ServletException</code></dd>
</dl>
</li>
</ul>
<a id="startScheduler()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startScheduler</h4>
<pre class="methodSignature">protected&nbsp;<a href="../util/thread/Scheduler.html" title="interface in org.eclipse.jetty.util.thread">Scheduler</a>&nbsp;startScheduler()
throws javax.servlet.ServletException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>javax.servlet.ServletException</code></dd>
</dl>
</li>
</ul>
<a id="doFilter(javax.servlet.ServletRequest,javax.servlet.ServletResponse,javax.servlet.FilterChain)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doFilter</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;doFilter&#8203;(javax.servlet.ServletRequest&nbsp;request,
javax.servlet.ServletResponse&nbsp;response,
javax.servlet.FilterChain&nbsp;filterChain)
throws java.io.IOException,
javax.servlet.ServletException</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>doFilter</code>&nbsp;in interface&nbsp;<code>javax.servlet.Filter</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd>
<dd><code>javax.servlet.ServletException</code></dd>
</dl>
</li>
</ul>
<a id="doFilter(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.FilterChain)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doFilter</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;doFilter&#8203;(javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response,
javax.servlet.FilterChain&nbsp;filterChain)
throws java.io.IOException,
javax.servlet.ServletException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd>
<dd><code>javax.servlet.ServletException</code></dd>
</dl>
</li>
</ul>
<a id="doFilterChain(javax.servlet.FilterChain,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doFilterChain</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;doFilterChain&#8203;(javax.servlet.FilterChain&nbsp;chain,
javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response)
throws java.io.IOException,
javax.servlet.ServletException</pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd>
<dd><code>javax.servlet.ServletException</code></dd>
</dl>
</li>
</ul>
<a id="onRequestTimeout(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Thread)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onRequestTimeout</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;onRequestTimeout&#8203;(javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response,
java.lang.Thread&nbsp;handlingThread)</pre>
<div class="block">Invoked when the request handling exceeds <a href="#getMaxRequestMs()"><code>getMaxRequestMs()</code></a>.
<p>
By default, an HTTP 503 response is returned and the handling thread is interrupted.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>request</code> - the current request</dd>
<dd><code>response</code> - the current response</dd>
<dd><code>handlingThread</code> - the handling thread</dd>
</dl>
</li>
</ul>
<a id="closeConnection(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Thread)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>closeConnection</h4>
<pre class="methodSignature">@Deprecated
protected&nbsp;void&nbsp;closeConnection&#8203;(javax.servlet.http.HttpServletRequest&nbsp;request,
javax.servlet.http.HttpServletResponse&nbsp;response,
java.lang.Thread&nbsp;thread)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">use <a href="#onRequestTimeout(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Thread)"><code>onRequestTimeout(HttpServletRequest, HttpServletResponse, Thread)</code></a> instead</div>
</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>request</code> - the current request</dd>
<dd><code>response</code> - the current response</dd>
<dd><code>thread</code> - the handling thread</dd>
</dl>
</li>
</ul>
<a id="getMaxPriority()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxPriority</h4>
<pre class="methodSignature">protected&nbsp;int&nbsp;getMaxPriority()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum priority that we can assign to a request</dd>
</dl>
</li>
</ul>
<a id="removeFromRateTracker(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeFromRateTracker</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;removeFromRateTracker&#8203;(java.lang.String&nbsp;id)</pre>
</li>
</ul>
<a id="checkWhitelist(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkWhitelist</h4>
<pre class="methodSignature">protected&nbsp;boolean&nbsp;checkWhitelist&#8203;(java.lang.String&nbsp;candidate)</pre>
</li>
</ul>
<a id="checkWhitelist(java.util.List,java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkWhitelist</h4>
<pre class="methodSignature">@Deprecated
protected&nbsp;boolean&nbsp;checkWhitelist&#8203;(java.util.List&lt;java.lang.String&gt;&nbsp;whitelist,
java.lang.String&nbsp;candidate)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div>
</li>
</ul>
<a id="subnetMatch(java.lang.String,java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>subnetMatch</h4>
<pre class="methodSignature">protected&nbsp;boolean&nbsp;subnetMatch&#8203;(java.lang.String&nbsp;subnetAddress,
java.lang.String&nbsp;address)</pre>
</li>
</ul>
<a id="destroy()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroy</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;destroy()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>destroy</code>&nbsp;in interface&nbsp;<code>javax.servlet.Filter</code></dd>
</dl>
</li>
</ul>
<a id="stopScheduler()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stopScheduler</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;stopScheduler()</pre>
</li>
</ul>
<a id="extractUserId(javax.servlet.ServletRequest)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>extractUserId</h4>
<pre class="methodSignature">protected&nbsp;java.lang.String&nbsp;extractUserId&#8203;(javax.servlet.ServletRequest&nbsp;request)</pre>
<div class="block">Returns the user id, used to track this connection.
This SHOULD be overridden by subclasses.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>request</code> - the current request</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a unique user id, if logged in; otherwise null.</dd>
</dl>
</li>
</ul>
<a id="getMaxRequestsPerSec()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxRequestsPerSec</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("maximum number of requests allowed from a connection per second")
public&nbsp;int&nbsp;getMaxRequestsPerSec()</pre>
<div class="block">Get maximum number of requests from a connection per
second. Requests in excess of this are first delayed,
then throttled.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>maximum number of requests</dd>
</dl>
</li>
</ul>
<a id="setMaxRequestsPerSec(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxRequestsPerSec</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setMaxRequestsPerSec&#8203;(int&nbsp;value)</pre>
<div class="block">Get maximum number of requests from a connection per
second. Requests in excess of this are first delayed,
then throttled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - maximum number of requests</dd>
</dl>
</li>
</ul>
<a id="getDelayMs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDelayMs</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("delay applied to all requests over the rate limit (in ms)")
public&nbsp;long&nbsp;getDelayMs()</pre>
<div class="block">Get delay (in milliseconds) that is applied to all requests
over the rate limit, before they are considered at all.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the delay in milliseconds</dd>
</dl>
</li>
</ul>
<a id="setDelayMs(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDelayMs</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setDelayMs&#8203;(long&nbsp;value)</pre>
<div class="block">Set delay (in milliseconds) that is applied to all requests
over the rate limit, before they are considered at all.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - delay (in milliseconds), 0 - no delay, -1 - reject request</dd>
</dl>
</li>
</ul>
<a id="getMaxWaitMs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxWaitMs</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("maximum time the filter will block waiting throttled connections, (0 for no delay, -1 to reject requests)")
public&nbsp;long&nbsp;getMaxWaitMs()</pre>
<div class="block">Get maximum amount of time (in milliseconds) the filter will
blocking wait for the throttle semaphore.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>maximum wait time</dd>
</dl>
</li>
</ul>
<a id="setMaxWaitMs(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxWaitMs</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setMaxWaitMs&#8203;(long&nbsp;value)</pre>
<div class="block">Set maximum amount of time (in milliseconds) the filter will
blocking wait for the throttle semaphore.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - maximum wait time</dd>
</dl>
</li>
</ul>
<a id="getThrottledRequests()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getThrottledRequests</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("number of requests over rate limit")
public&nbsp;int&nbsp;getThrottledRequests()</pre>
<div class="block">Get number of requests over the rate limit able to be
considered at once.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>number of requests</dd>
</dl>
</li>
</ul>
<a id="setThrottledRequests(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setThrottledRequests</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setThrottledRequests&#8203;(int&nbsp;value)</pre>
<div class="block">Set number of requests over the rate limit able to be
considered at once.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - number of requests</dd>
</dl>
</li>
</ul>
<a id="getThrottleMs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getThrottleMs</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("amount of time to async wait for semaphore")
public&nbsp;long&nbsp;getThrottleMs()</pre>
<div class="block">Get amount of time (in milliseconds) to async wait for semaphore.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>wait time</dd>
</dl>
</li>
</ul>
<a id="setThrottleMs(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setThrottleMs</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setThrottleMs&#8203;(long&nbsp;value)</pre>
<div class="block">Set amount of time (in milliseconds) to async wait for semaphore.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - wait time</dd>
</dl>
</li>
</ul>
<a id="getMaxRequestMs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxRequestMs</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("maximum time to allow requests to process (in ms)")
public&nbsp;long&nbsp;getMaxRequestMs()</pre>
<div class="block">Get maximum amount of time (in milliseconds) to allow
the request to process.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>maximum processing time</dd>
</dl>
</li>
</ul>
<a id="setMaxRequestMs(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxRequestMs</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setMaxRequestMs&#8203;(long&nbsp;value)</pre>
<div class="block">Set maximum amount of time (in milliseconds) to allow
the request to process.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - maximum processing time</dd>
</dl>
</li>
</ul>
<a id="getMaxIdleTrackerMs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxIdleTrackerMs</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("maximum time to track of request rates for connection before discarding")
public&nbsp;long&nbsp;getMaxIdleTrackerMs()</pre>
<div class="block">Get maximum amount of time (in milliseconds) to keep track
of request rates for a connection, before deciding that
the user has gone away, and discarding it.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>maximum tracking time</dd>
</dl>
</li>
</ul>
<a id="setMaxIdleTrackerMs(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxIdleTrackerMs</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setMaxIdleTrackerMs&#8203;(long&nbsp;value)</pre>
<div class="block">Set maximum amount of time (in milliseconds) to keep track
of request rates for a connection, before deciding that
the user has gone away, and discarding it.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - maximum tracking time</dd>
</dl>
</li>
</ul>
<a id="getName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre class="methodSignature">public&nbsp;java.lang.String&nbsp;getName()</pre>
<div class="block">The unique name of the filter when there is more than
one DosFilter instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the name</dd>
</dl>
</li>
</ul>
<a id="setName(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setName</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setName&#8203;(java.lang.String&nbsp;name)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name to set</dd>
</dl>
</li>
</ul>
<a id="isInsertHeaders()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInsertHeaders</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("inser DoSFilter headers in response")
public&nbsp;boolean&nbsp;isInsertHeaders()</pre>
<div class="block">Check flag to insert the DoSFilter headers into the response.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>value of the flag</dd>
</dl>
</li>
</ul>
<a id="setInsertHeaders(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInsertHeaders</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setInsertHeaders&#8203;(boolean&nbsp;value)</pre>
<div class="block">Set flag to insert the DoSFilter headers into the response.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - value of the flag</dd>
</dl>
</li>
</ul>
<a id="isTrackSessions()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isTrackSessions</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("usage rate is tracked by session if one exists")
public&nbsp;boolean&nbsp;isTrackSessions()</pre>
<div class="block">Get flag to have usage rate tracked by session if a session exists.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>value of the flag</dd>
</dl>
</li>
</ul>
<a id="setTrackSessions(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTrackSessions</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setTrackSessions&#8203;(boolean&nbsp;value)</pre>
<div class="block">Set flag to have usage rate tracked by session if a session exists.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - value of the flag</dd>
</dl>
</li>
</ul>
<a id="isRemotePort()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isRemotePort</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("usage rate is tracked by IP+port is session tracking not used")
public&nbsp;boolean&nbsp;isRemotePort()</pre>
<div class="block">Get flag to have usage rate tracked by IP+port (effectively connection)
if session tracking is not used.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>value of the flag</dd>
</dl>
</li>
</ul>
<a id="setRemotePort(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRemotePort</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setRemotePort&#8203;(boolean&nbsp;value)</pre>
<div class="block">Set flag to have usage rate tracked by IP+port (effectively connection)
if session tracking is not used.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - value of the flag</dd>
</dl>
</li>
</ul>
<a id="isEnabled()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEnabled</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("whether this filter is enabled")
public&nbsp;boolean&nbsp;isEnabled()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether this filter is enabled</dd>
</dl>
</li>
</ul>
<a id="setEnabled(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEnabled</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setEnabled&#8203;(boolean&nbsp;enabled)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>enabled</code> - whether this filter is enabled</dd>
</dl>
</li>
</ul>
<a id="getTooManyCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTooManyCode</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getTooManyCode()</pre>
</li>
</ul>
<a id="setTooManyCode(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTooManyCode</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setTooManyCode&#8203;(int&nbsp;tooManyCode)</pre>
</li>
</ul>
<a id="getWhitelist()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWhitelist</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedAttribute.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedAttribute</a>("list of IPs that will not be rate limited")
public&nbsp;java.lang.String&nbsp;getWhitelist()</pre>
<div class="block">Get a list of IP addresses that will not be rate limited.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>comma-separated whitelist</dd>
</dl>
</li>
</ul>
<a id="setWhitelist(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setWhitelist</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setWhitelist&#8203;(java.lang.String&nbsp;commaSeparatedList)</pre>
<div class="block">Set a list of IP addresses that will not be rate limited.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>commaSeparatedList</code> - comma-separated whitelist</dd>
</dl>
</li>
</ul>
<a id="clearWhitelist()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearWhitelist</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedOperation.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedOperation</a>("clears the list of IP addresses that will not be rate limited")
public&nbsp;void&nbsp;clearWhitelist()</pre>
<div class="block">Clears the list of whitelisted IP addresses</div>
</li>
</ul>
<a id="addWhitelistAddress(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addWhitelistAddress</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedOperation.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedOperation</a>("adds an IP address that will not be rate limited")
public&nbsp;boolean&nbsp;addWhitelistAddress&#8203;(<a href="../util/annotation/Name.html" title="annotation in org.eclipse.jetty.util.annotation">@Name</a>("address")
java.lang.String&nbsp;address)</pre>
<div class="block">Adds the given IP address, either in the form of a dotted decimal notation A.B.C.D
or in the CIDR notation A.B.C.D/M, to the list of whitelisted IP addresses.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>address</code> - the address to add</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether the address was added to the list</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#removeWhitelistAddress(java.lang.String)"><code>removeWhitelistAddress(String)</code></a></dd>
</dl>
</li>
</ul>
<a id="removeWhitelistAddress(java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>removeWhitelistAddress</h4>
<pre class="methodSignature"><a href="../util/annotation/ManagedOperation.html" title="annotation in org.eclipse.jetty.util.annotation">@ManagedOperation</a>("removes an IP address that will not be rate limited")
public&nbsp;boolean&nbsp;removeWhitelistAddress&#8203;(<a href="../util/annotation/Name.html" title="annotation in org.eclipse.jetty.util.annotation">@Name</a>("address")
java.lang.String&nbsp;address)</pre>
<div class="block">Removes the given address from the list of whitelisted IP addresses.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>address</code> - the address to remove</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether the address was removed from the list</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#addWhitelistAddress(java.lang.String)"><code>addWhitelistAddress(String)</code></a></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/DoSFilter.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>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 id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 1995&#x2013;2020 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p>
</footer>
</body>
</html>