Package org.apache.mina.filter.firewall

Examples of org.apache.mina.filter.firewall.BlacklistFilter


        this.idleTimeout = idleTimeout;
    }

    private void updateBlacklistFilter() {
        if (acceptor != null) {
            BlacklistFilter filter = (BlacklistFilter) acceptor
                    .getFilterChain().get("ipFilter");

            if (filter != null) {
                if (blockedAddresses != null) {
                    filter.setBlacklist(blockedAddresses);
                } else if (blockedSubnets != null) {
                    filter.setSubnetBlacklist(blockedSubnets);
                } else {
                    // an empty list clears the blocked addresses
                    filter.setSubnetBlacklist(new ArrayList<Subnet>());
                }

            }
        }
    }
View Full Code Here


        MdcInjectionFilter mdcFilter = new MdcInjectionFilter();

        acceptor.getFilterChain().addLast("mdcFilter", mdcFilter);

        // add and update the blacklist filter
        acceptor.getFilterChain().addLast("ipFilter", new BlacklistFilter());
        updateBlacklistFilter();

        acceptor.getFilterChain().addLast("threadPool",
                new ExecutorFilter(filterExecutor));
        acceptor.getFilterChain().addLast("codec",
View Full Code Here

TOP

Related Classes of org.apache.mina.filter.firewall.BlacklistFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.