class IpAddressSetDecideRule extends PredicatedDecideRule {

    private static final Logger logger = Logger.getLogger(IpAddressSetDecideRule.class.getName());

    private static final long serialVersionUID = -3670434739183271441L;
    private Set<String> ipAddresses;
    
    /**
     * @return the addresses being matched
     */
    public Set<String> getIpAddresses() {
        return Collections.unmodifiableSet(ipAddresses);
    }

    /**
     * @param ipAddresses the addresses to match
     */
    public void setIpAddresses(Set<String> ipAddresses) {
        this.ipAddresses = ipAddresses;
    }

    @Override
    protected boolean evaluate(CrawlURI curi) {
        String hostAddress = getHostAddress(curi);
        return hostAddress != null &&
                ipAddresses.contains(hostAddress.intern());
    }

    transient protected ServerCache serverCache;
    public ServerCache getServerCache() {
        return this.serverCache;
    }
    @Autowired
    public void setServerCache(ServerCache serverCache) {
        this.serverCache = serverCache;
    }
    
    /**
     * from WriterPoolProcessor
     * 
     * @param curi CrawlURI
     * @return String of IP address or null if unable to determine IP address
     */
    protected String getHostAddress(CrawlURI curi) {<FILL_FUNCTION_BODY>}
}

        // if possible use the exact IP the fetcher stashed in curi
        if (curi.getServerIP() != null) {
            return curi.getServerIP();
        }
        // otherwise, consult the cache
        String addr = null;
        try {
	        CrawlHost crlh = getServerCache().getHostFor(curi.getUURI());
	        if (crlh == null) {
	            return null;
	        }
	        InetAddress inetadd = crlh.getIP();
	        if (inetadd == null) {
	            return null;
	        }
	        addr = inetadd.getHostAddress();
        } catch (Exception e) {
        	// Log error and continue (return null)
        	logger.log(Level.WARNING, "Error looking up IP for URI "+curi.getURI(), e);
        }
        return addr;
    
<methods>public void <init>() ,public org.archive.modules.deciderules.DecideResult getDecision() ,public org.archive.modules.deciderules.DecideResult onlyDecision(org.archive.modules.CrawlURI) ,public void setDecision(org.archive.modules.deciderules.DecideResult) <variables>private static final long serialVersionUID