| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.8) on Fri Oct 02 09:24:24 CDT 2020 --> |
| <title>DoSFilter (Jetty :: Project 9.4.32.v20200930 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2020-10-02"> |
| <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.32.v20200930 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,"i46":10,"i47":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 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: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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"> </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> <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><async-supported>true</async-supported></code>. |
| </p></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Class</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DoSFilter.Action.html" title="enum in org.eclipse.jetty.servlets">DoSFilter.Action</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DoSFilter.Listener.html" title="class in org.eclipse.jetty.servlets">DoSFilter.Listener</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Listener for actions taken against specific requests.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DoSFilter.OverLimit.html" title="interface in org.eclipse.jetty.servlets">DoSFilter.OverLimit</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DoSFilter.RateType.html" title="enum in org.eclipse.jetty.servlets">DoSFilter.RateType</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== 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"> </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"> </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"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </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>​(java.lang.String 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>​(java.lang.String candidate)</code></th> |
| <td class="colLast"> </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>​(java.util.List<java.lang.String> whitelist, |
| java.lang.String 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>​(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| java.lang.Thread 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"> </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>​(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| javax.servlet.FilterChain filterChain)</code></th> |
| <td class="colLast"> </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>​(javax.servlet.ServletRequest request, |
| javax.servlet.ServletResponse response, |
| javax.servlet.FilterChain filterChain)</code></th> |
| <td class="colLast"> </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>​(javax.servlet.FilterChain chain, |
| javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</code></th> |
| <td class="colLast"> </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>​(javax.servlet.ServletRequest 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><a href="DoSFilter.Listener.html" title="class in org.eclipse.jetty.servlets">DoSFilter.Listener</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getListener()">getListener</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <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="i13" class="rowColor"> |
| <td class="colFirst"><code>protected <a href="DoSFilter.RateType.html" title="enum in org.eclipse.jetty.servlets">DoSFilter.RateType</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxPriority()">getMaxPriority</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <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="i15" class="rowColor"> |
| <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="i16" class="altColor"> |
| <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="i17" class="rowColor"> |
| <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="i18" class="altColor"> |
| <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="i19" class="rowColor"> |
| <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="i20" class="altColor"> |
| <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"> |
| <div class="block">Status code for Rejected for too many requests.</div> |
| </td> |
| </tr> |
| <tr id="i21" class="rowColor"> |
| <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="i22" class="altColor"> |
| <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>​(javax.servlet.FilterConfig filterConfig)</code></th> |
| <td class="colLast"> </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="#isEnabled()">isEnabled</a></span>()</code></th> |
| <td class="colLast"> </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="#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="i25" class="rowColor"> |
| <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="i26" class="altColor"> |
| <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="i27" class="rowColor"> |
| <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>​(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| java.lang.Thread 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="i28" class="altColor"> |
| <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>​(java.lang.String id)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i29" class="rowColor"> |
| <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>​(java.lang.String 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="i30" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDelayMs(long)">setDelayMs</a></span>​(long 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="i31" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEnabled(boolean)">setEnabled</a></span>​(boolean enabled)</code></th> |
| <td class="colLast"> </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="#setInsertHeaders(boolean)">setInsertHeaders</a></span>​(boolean value)</code></th> |
| <td class="colLast"> |
| <div class="block">Set flag to insert the DoSFilter headers into the response.</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="#setListener(org.eclipse.jetty.servlets.DoSFilter.Listener)">setListener</a></span>​(<a href="DoSFilter.Listener.html" title="class in org.eclipse.jetty.servlets">DoSFilter.Listener</a> listener)</code></th> |
| <td class="colLast"> </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="#setMaxIdleTrackerMs(long)">setMaxIdleTrackerMs</a></span>​(long 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="i35" 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>​(long 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="i36" 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>​(int value)</code></th> |
| <td class="colLast"> |
| <div class="block">Get maximum number of requests from a connection per |
| second.</div> |
| </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="#setMaxWaitMs(long)">setMaxWaitMs</a></span>​(long 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="i38" 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>​(java.lang.String name)</code></th> |
| <td class="colLast"> </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="#setRemotePort(boolean)">setRemotePort</a></span>​(boolean 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="i40" 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>​(int 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="i41" 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>​(long 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="i42" 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>​(int tooManyCode)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i43" 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>​(boolean 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="i44" 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>​(java.lang.String 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="i45" 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"> </td> |
| </tr> |
| <tr id="i46" 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"> </td> |
| </tr> |
| <tr id="i47" 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>​(java.lang.String subnetAddress, |
| java.lang.String address)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class 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="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>DoSFilter</h4> |
| <pre>public 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 void init​(javax.servlet.FilterConfig filterConfig) |
| throws javax.servlet.ServletException</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code>init</code> in interface <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 <a href="../util/thread/Scheduler.html" title="interface in org.eclipse.jetty.util.thread">Scheduler</a> 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 void doFilter​(javax.servlet.ServletRequest request, |
| javax.servlet.ServletResponse response, |
| javax.servlet.FilterChain filterChain) |
| throws java.io.IOException, |
| javax.servlet.ServletException</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code>doFilter</code> in interface <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 void doFilter​(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| javax.servlet.FilterChain 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 void doFilterChain​(javax.servlet.FilterChain chain, |
| javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse 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 void onRequestTimeout​(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| java.lang.Thread 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 void closeConnection​(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| java.lang.Thread 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 <a href="DoSFilter.RateType.html" title="enum in org.eclipse.jetty.servlets">DoSFilter.RateType</a> 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="setListener(org.eclipse.jetty.servlets.DoSFilter.Listener)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setListener</h4> |
| <pre class="methodSignature">public void setListener​(<a href="DoSFilter.Listener.html" title="class in org.eclipse.jetty.servlets">DoSFilter.Listener</a> listener)</pre> |
| </li> |
| </ul> |
| <a id="getListener()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getListener</h4> |
| <pre class="methodSignature">public <a href="DoSFilter.Listener.html" title="class in org.eclipse.jetty.servlets">DoSFilter.Listener</a> getListener()</pre> |
| </li> |
| </ul> |
| <a id="removeFromRateTracker(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeFromRateTracker</h4> |
| <pre class="methodSignature">public void removeFromRateTracker​(java.lang.String id)</pre> |
| </li> |
| </ul> |
| <a id="checkWhitelist(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkWhitelist</h4> |
| <pre class="methodSignature">protected boolean checkWhitelist​(java.lang.String 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 boolean checkWhitelist​(java.util.List<java.lang.String> whitelist, |
| java.lang.String 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 boolean subnetMatch​(java.lang.String subnetAddress, |
| java.lang.String address)</pre> |
| </li> |
| </ul> |
| <a id="destroy()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>destroy</h4> |
| <pre class="methodSignature">public void destroy()</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code>destroy</code> in interface <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 void stopScheduler()</pre> |
| </li> |
| </ul> |
| <a id="extractUserId(javax.servlet.ServletRequest)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>extractUserId</h4> |
| <pre class="methodSignature">protected java.lang.String extractUserId​(javax.servlet.ServletRequest 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 int 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 void setMaxRequestsPerSec​(int 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 long 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 void setDelayMs​(long 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 long 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 void setMaxWaitMs​(long 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 int 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 void setThrottledRequests​(int 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 long 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 void setThrottleMs​(long 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 long 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 void setMaxRequestMs​(long 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 long 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 void setMaxIdleTrackerMs​(long 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 java.lang.String 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 void setName​(java.lang.String 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 boolean 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 void setInsertHeaders​(boolean 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 boolean 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 void setTrackSessions​(boolean 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 boolean 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 void setRemotePort​(boolean 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 boolean 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 void setEnabled​(boolean 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 int getTooManyCode()</pre> |
| <div class="block">Status code for Rejected for too many requests.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the configured status code (default: 429 - Too Many Requests)</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setTooManyCode(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setTooManyCode</h4> |
| <pre class="methodSignature">public void setTooManyCode​(int 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 java.lang.String 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 void setWhitelist​(java.lang.String 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 void 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 boolean addWhitelistAddress​(<a href="../util/annotation/Name.html" title="annotation in org.eclipse.jetty.util.annotation">@Name</a>("address") |
| java.lang.String 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 boolean removeWhitelistAddress​(<a href="../util/annotation/Name.html" title="annotation in org.eclipse.jetty.util.annotation">@Name</a>("address") |
| java.lang.String 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 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: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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 © 1995–2020 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |