public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
@Override public boolean isIn(String ipAddress) { //is cache expired //Uses Double Checked Locking using volatile if (cacheExpiryTimeStamp >= 0 && cacheExpiryTimeStamp < System.currentTimeMillis()) { synchronized(this) { //check if cache expired again if (cacheExpiryTimeStamp < System.currentTimeMillis()) { reset(); } } } return ipList.isIn(ipAddress); } }
public FileBasedIPList(String fileName) { this.fileName = fileName; String[] lines; try { lines = readLines(fileName); } catch (IOException e) { lines = null; } if (lines != null) { addressList = new MachineList(new HashSet<String>(Arrays.asList(lines))); } else { addressList = null; } }
/** * Reloads the ip list */ private void reset() { ipList = ipList.reload(); updateCacheExpiryTime(); }
/** * Reloads the ip list */ private void reset() { ipList = ipList.reload(); updateCacheExpiryTime(); }
public CombinedIPList(String fixedBlackListFile, String variableBlackListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedBlackListFile); if (variableBlackListFile != null) { IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableBlackListFile), cacheExpiryInSeconds); networkLists = new IPList[]{fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[]{fixedNetworkList}; } }
/** * Reloads the ip list */ private void reset() { ipList = ipList.reload(); updateCacheExpiryTime(); }
public FileBasedIPList(String fileName) { this.fileName = fileName; String[] lines; try { lines = readLines(fileName); } catch (IOException e) { lines = null; } if (lines != null) { addressList = new MachineList(new HashSet<String>(Arrays.asList(lines))); } else { addressList = null; } }
@Override public boolean isIn(String ipAddress) { //is cache expired //Uses Double Checked Locking using volatile if (cacheExpiryTimeStamp >= 0 && cacheExpiryTimeStamp < System.currentTimeMillis()) { synchronized(this) { //check if cache expired again if (cacheExpiryTimeStamp < System.currentTimeMillis()) { reset(); } } } return ipList.isIn(ipAddress); } }
public CombinedIPWhiteList(String fixedWhiteListFile, String variableWhiteListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile); if (variableWhiteListFile != null){ IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds); networkLists = new IPList[] {fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[] {fixedNetworkList}; } } @Override
/** * Reloads the ip list */ private void reset() { ipList = ipList.reload(); updateCacheExpiryTime(); }
public FileBasedIPList(String fileName) { this.fileName = fileName; String[] lines; try { lines = readLines(fileName); } catch (IOException e) { lines = null; } if (lines != null) { addressList = new MachineList(new HashSet<String>(Arrays.asList(lines))); } else { addressList = null; } }
@Override public boolean isIn(String ipAddress) { //is cache expired //Uses Double Checked Locking using volatile if (cacheExpiryTimeStamp >= 0 && cacheExpiryTimeStamp < System.currentTimeMillis()) { synchronized(this) { //check if cache expired again if (cacheExpiryTimeStamp < System.currentTimeMillis()) { reset(); } } } return ipList.isIn(ipAddress); } }
public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
/** * Reloads the ip list */ private void reset() { ipList = ipList.reload(); updateCacheExpiryTime(); }
public FileBasedIPList(String fileName) { this.fileName = fileName; String[] lines; try { lines = readLines(fileName); } catch (IOException e) { lines = null; } if (lines != null) { addressList = new MachineList(new HashSet<String>(Arrays.asList(lines))); } else { addressList = null; } }
@Override public boolean isIn(String ipAddress) { //is cache expired //Uses Double Checked Locking using volatile if (cacheExpiryTimeStamp >= 0 && cacheExpiryTimeStamp < System.currentTimeMillis()) { synchronized(this) { //check if cache expired again if (cacheExpiryTimeStamp < System.currentTimeMillis()) { reset(); } } } return ipList.isIn(ipAddress); } }
public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
public FileBasedIPList(String fileName) { this.fileName = fileName; String[] lines; try { lines = readLines(fileName); } catch (IOException e) { lines = null; } if (lines != null) { addressList = new MachineList(new HashSet<String>(Arrays.asList(lines))); } else { addressList = null; } }
@Override public boolean isIn(String ipAddress) { //is cache expired //Uses Double Checked Locking using volatile if (cacheExpiryTimeStamp >= 0 && cacheExpiryTimeStamp < System.currentTimeMillis()) { synchronized(this) { //check if cache expired again if (cacheExpiryTimeStamp < System.currentTimeMillis()) { reset(); } } } return ipList.isIn(ipAddress); } }