本文整理匯總了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);
}