class AbstractPersistProcessor extends Processor {

    /** @see RecrawlAttributeConstants#A_WRITE_TAG */
    protected boolean onlyStoreIfWriteTagPresent = true;
    public boolean getOnlyStoreIfWriteTagPresent() {
        return onlyStoreIfWriteTagPresent;
    }
    public void setOnlyStoreIfWriteTagPresent(boolean onlyStoreIfWriteTagPresent) {
        this.onlyStoreIfWriteTagPresent = onlyStoreIfWriteTagPresent;
    }

    /**
     * Whether the current CrawlURI's state should be persisted (to log or
     * direct to database)
     * 
     * @param curi
     *            CrawlURI
     * @return true if state should be stored; false to skip persistence
     */
    protected boolean shouldStore(CrawlURI curi) {<FILL_FUNCTION_BODY>}

    /**
     * @param uri
     * @return true if {@code curi} has WRITE_TAG in the latest fetch history (i.e. this crawl).
     */
    protected boolean hasWriteTag(CrawlURI uri) {
        return uri.getFetchHistory() != null
                && uri.getFetchHistory()[0] != null
                && uri.getFetchHistory()[0].containsKey(A_WRITE_TAG);
    }
    
    /**
     * Whether the current CrawlURI's state should be loaded
     * 
     * @param curi CrawlURI
     * @return true if state should be loaded; false to skip loading
     */
    protected boolean shouldLoad(CrawlURI curi) {
        // TODO: don't load some (prereqs?)
        return true;
    }

}

        // do this first for quick decision on CURLs postponed by prerequisite
        if (!curi.isSuccess()) {
            return false;
        }
        
        // DNS query need not be persisted
        String scheme = curi.getUURI().getScheme();
        if (!(scheme.equals("http") || scheme.equals("https") || scheme.equals("ftp") || scheme.equals("sftp"))) {
            return false;
        }
        
        if (getOnlyStoreIfWriteTagPresent() && !hasWriteTag(curi)) { 
            return false;
        }
        
        return true;
    
<methods>public non-sealed void <init>() ,public void doCheckpoint(org.archive.checkpointing.Checkpoint) throws java.io.IOException,public void finishCheckpoint(org.archive.checkpointing.Checkpoint) ,public static java.lang.String flattenVia(org.archive.modules.CrawlURI) ,public java.lang.String getBeanName() ,public boolean getEnabled() ,public org.archive.spring.KeyedProperties getKeyedProperties() ,public static long getRecordedSize(org.archive.modules.CrawlURI) ,public org.archive.modules.deciderules.DecideRule getShouldProcessRule() ,public long getURICount() ,public static boolean hasHttpAuthenticationCredential(org.archive.modules.CrawlURI) ,public boolean isRunning() ,public static boolean isSuccess(org.archive.modules.CrawlURI) ,public org.archive.modules.ProcessResult process(org.archive.modules.CrawlURI) throws java.lang.InterruptedException,public java.lang.String report() ,public void setBeanName(java.lang.String) ,public void setEnabled(boolean) ,public void setRecoveryCheckpoint(org.archive.checkpointing.Checkpoint) ,public void setShouldProcessRule(org.archive.modules.deciderules.DecideRule) ,public void start() ,public void startCheckpoint(org.archive.checkpointing.Checkpoint) ,public void stop() <variables>protected java.lang.String beanName,protected boolean isRunning,protected org.archive.spring.KeyedProperties kp,protected org.archive.checkpointing.Checkpoint recoveryCheckpoint,protected java.util.concurrent.atomic.AtomicLong uriCount