package org.atlasapi.system.bootstrap;

import java.util.concurrent.ThreadPoolExecutor;

import org.atlasapi.content.Content;
import org.atlasapi.content.ContentWriter;

public class ContentWritingBootstrapListener extends AbstractMultiThreadedBootstrapListener<Content> {

    private final ContentWriter writer;

    public ContentWritingBootstrapListener(int concurrencyLevel, ContentWriter writer) {
        super(concurrencyLevel);
        this.writer = writer;
    }

    public ContentWritingBootstrapListener(ThreadPoolExecutor executor, ContentWriter contentStore) {
        super(executor);
        this.writer = contentStore;
    }

    @Override
    protected void onChange(Content content) throws Exception {
        content.setReadHash(null);
        writer.writeContent(content);
    }
}

@@ -143,28 +143,57 @@
 api.
-content.ContentWrite
+system.bootstrap.workers.BootstrapContentPersisto
 r;%0A%0A
@@ -314,28 +314,40 @@
 e final 
-ContentWrite
+BootstrapContentPersisto
 r writer
@@ -414,28 +414,40 @@
 yLevel, 
-ContentWrite
+BootstrapContentPersisto
 r writer
@@ -596,20 +596,32 @@
 or, 
-ContentWrite
+BootstrapContentPersisto
 r co
@@ -830,17 +830,21 @@
  writer.
-w
+fullW
 riteCont

write full content on full bootsrap