本文整理汇总了Java中org.jboss.netty.handler.ipfilter.IpFilterRule类的典型用法代码示例。如果您正苦于以下问题:Java IpFilterRule类的具体用法?Java IpFilterRule怎么用?Java IpFilterRule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IpFilterRule类属于org.jboss.netty.handler.ipfilter包,在下文中一共展示了IpFilterRule类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unblockIPAddress
import org.jboss.netty.handler.ipfilter.IpFilterRule; //导入依赖的package包/类
@Override
public synchronized void unblockIPAddress(String addr) throws UnknownHostException {
if(log.isInfoEnabled()) {
log.info("Unblocking " + addr);
}
String cidr = addr;
if(cidr.indexOf('/')==-1) {
cidr += "/32";
}
IpFilterRule rule = new IpSubnetFilterRule(false, cidr);
deny.remove(rule);
}
示例2: disallowIPAddress
import org.jboss.netty.handler.ipfilter.IpFilterRule; //导入依赖的package包/类
@Override
public synchronized void disallowIPAddress(String addr) throws UnknownHostException {
if(log.isInfoEnabled()) {
log.info("Removing allow rule for " + addr);
}
String cidr = addr;
if(cidr.indexOf('/')==-1) {
cidr += "/32";
}
IpFilterRule rule = new IpSubnetFilterRule(true, cidr);
allow.remove(rule);
}
示例3: allowIPAddress
import org.jboss.netty.handler.ipfilter.IpFilterRule; //导入依赖的package包/类
@Override
public synchronized void allowIPAddress(String addr) throws UnknownHostException {
if(log.isInfoEnabled()) {
log.info("Allowing " + addr);
}
String cidr = addr;
if(cidr.indexOf('/')==-1) {
cidr += "/32";
}
IpFilterRule rule = new IpSubnetFilterRule(true, cidr);
allow.add(rule);
}