package apoc.cypher;

import apoc.ApocConfiguration;
import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.kernel.AvailabilityGuard;
import org.neo4j.kernel.internal.GraphDatabaseAPI;
import org.neo4j.logging.Log;

import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

public class CypherInitializer implements AvailabilityGuard.AvailabilityListener {
    private final GraphDatabaseAPI db;
    private final Log userLog;

    public CypherInitializer(GraphDatabaseAPI db, Log userLog) {
        this.db = db;
        this.userLog = userLog;
    }

    @Override
    public void available() {
        SortedMap<String, Object> initializers = new TreeMap<>(ApocConfiguration.get("initializer.cypher"));
        for (Object initializer: initializers.values()) {
            try {
                String query = initializer.toString();
                db.execute(query);
                userLog.info("successfully initialized: " + query);
            } catch (Exception e) {
                userLog.warn("error upon initialization, running: "+query, e);
            }
        }
    }

    @Override
    public void unavailable() {
        // intentionally empty
    }
}

@@ -788,30 +788,8 @@
 ) %7B%0A
-            try %7B%0A    
     
@@ -835,16 +835,34 @@
 ring();%0A
+            try %7B%0A
         

fix compile error