19 package org.turro.elephant.servlet.crawler;
21 import java.util.HashSet;
31 return ip !=
null && blackList.contains(ip);
35 return ip !=
null && whiteList.contains(ip);
40 private final Set<String> blackList =
new HashSet<>();
41 private final Set<String> whiteList =
new HashSet<>();
43 private void addBlackListed(String ip) {
47 private void addWhiteListed(String ip) {
53 private AllowedSet() { }
57 crawlerLists.
getBlackList().forEach(action ->
set.addBlackListed(action.getIp()));
58 crawlerLists.
getWhiteList().forEach(action ->
set.addWhiteListed(action.getIp()));
boolean isWhiteListed(String ip)
static AllowedSet from(CrawlerLists crawlerLists)
boolean isBlackListed(String ip)
Set< ActivityAction > getBlackList()
Set< ActivityAction > getWhiteList()