You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by bu...@apache.org on 2019/04/09 12:55:16 UTC

svn commit: r1043396 - in /websites/staging/mina/trunk/content: ./ mina-project/userguide/ch5-filters/ch5.1-blacklist-filter.html

Author: buildbot
Date: Tue Apr  9 12:55:15 2019
New Revision: 1043396

Log:
Staging update by buildbot for mina

Modified:
    websites/staging/mina/trunk/content/   (props changed)
    websites/staging/mina/trunk/content/mina-project/userguide/ch5-filters/ch5.1-blacklist-filter.html

Propchange: websites/staging/mina/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Apr  9 12:55:15 2019
@@ -1 +1 @@
-1857192
+1857193

Modified: websites/staging/mina/trunk/content/mina-project/userguide/ch5-filters/ch5.1-blacklist-filter.html
==============================================================================
--- websites/staging/mina/trunk/content/mina-project/userguide/ch5-filters/ch5.1-blacklist-filter.html (original)
+++ websites/staging/mina/trunk/content/mina-project/userguide/ch5-filters/ch5.1-blacklist-filter.html Tue Apr  9 12:55:15 2019
@@ -186,36 +186,40 @@ h2:hover > .headerlink, h3:hover > .head
 }
 h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
 <h1 id="51-blacklist-filter">5.1 - Blacklist Filter<a class="headerlink" href="#51-blacklist-filter" title="Permanent link">&para;</a></h1>
-<p>This filter blocks connnections from blacklisted remote addresses. Onee can block addresses or Subnets. In any case, when an event happens on a blocked session, the session will simply be closed. Here are the events this filter handles :</p>
+<p>This filter blocks connnections from blacklisted remote addresses. Onee can block <em>Addresses</em> or <em>Subnets</em>. In any case, when an event happens on a blocked session, the session will simply be closed. Here are the events this filter handles :</p>
 <ul>
-<li>event (MINA 2.1)</li>
-<li>messageReceived</li>
-<li>messageSent</li>
-<li>sessionCreated</li>
-<li>sessionIdle</li>
-<li>sessionOpened</li>
+<li><em>event</em> (MINA 2.1)</li>
+<li><em>messageReceived</em></li>
+<li><em>messageSent</em></li>
+<li><em>sessionCreated</em></li>
+<li><em>sessionIdle</em></li>
+<li><em>sessionOpened</em></li>
 </ul>
 <p>There is no need to handle any other event.</p>
 <h2 id="blocking-an-address">Blocking an address<a class="headerlink" href="#blocking-an-address" title="Permanent link">&para;</a></h2>
 <p>Any address or subnet can be blocked live, ie it does not matter if a session is already active or not, this dynamicaly activated. 
 It's enough to add the filter in the chain, and to set (or unset) the addresses to block:</p>
-<p>:::java
-  ...
-  BlacklistFilter blackList = new BlacklistFilter();
-  blackList.block(InetAddress.getByName("1.2.3.4"));
-  acceptor.getFilterChain().addLast("blacklist", new BlacklistFilter());
-  ...</p>
+<div class="codehilite"><pre><span class="o">...</span>
+<span class="n">BlacklistFilter</span> <span class="n">blackList</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BlacklistFilter</span><span class="o">();</span>
+<span class="n">blackList</span><span class="o">.</span><span class="na">block</span><span class="o">(</span><span class="n">InetAddress</span><span class="o">.</span><span class="na">getByName</span><span class="o">(</span><span class="s">&quot;1.2.3.4&quot;</span><span class="o">));</span>
+<span class="n">acceptor</span><span class="o">.</span><span class="na">getFilterChain</span><span class="o">().</span><span class="na">addLast</span><span class="o">(</span><span class="s">&quot;blacklist&quot;</span><span class="o">,</span> <span class="k">new</span> <span class="n">BlacklistFilter</span><span class="o">());</span>
+<span class="o">...</span>
+</pre></div>
+
+
 <p>Here, the "1.2.3.4" address will be blocked. </p>
 <h2 id="unblocking-an-address">Unblocking an address<a class="headerlink" href="#unblocking-an-address" title="Permanent link">&para;</a></h2>
 <p>It's possible to unblock an address, it's just a matter of fetching the filter and remove a previously blocked addres:</p>
-<p>:::java
-  ...
-  BlacklistFilter blackList = (BlacklistFilter)session.getFilterChain().get(BlacklistFilter.class);
-  blackList.unblock(InetAddress.getByName("1.2.3.4"));
-  ...</p>
+<div class="codehilite"><pre><span class="o">...</span>
+<span class="n">BlacklistFilter</span> <span class="n">blackList</span> <span class="o">=</span> <span class="o">(</span><span class="n">BlacklistFilter</span><span class="o">)</span><span class="n">session</span><span class="o">.</span><span class="na">getFilterChain</span><span class="o">().</span><span class="na">get</span><span class="o">(</span><span class="n">BlacklistFilter</span><span class="o">.</span><span class="na">class</span><span class="o">);</span>
+<span class="n">blackList</span><span class="o">.</span><span class="na">unblock</span><span class="o">(</span><span class="n">InetAddress</span><span class="o">.</span><span class="na">getByName</span><span class="o">(</span><span class="s">&quot;1.2.3.4&quot;</span><span class="o">));</span>
+<span class="o">...</span>
+</pre></div>
+
+
 <p>Here, the "1.2.3.4" address will be unblocked. </p>
 <h2 id="performances">Performances<a class="headerlink" href="#performances" title="Permanent link">&para;</a></h2>
-<p>Currently, the implementation is not really optimal... We use a List to store the blocked addresses/subnet, so the more of them you have in the list the longer it will take to process any event.</p>
+<p>Currently, the implementation is not really optimal... We use a <em>List</em> to store the blocked addresses/subnet, so the more of them you have in the list the longer it will take to process any event.</p>
 
 
     <div class="nav">