import org.simantics.scl.runtime.function.FunctionImpl3;
import org.simantics.utils.Development;
import org.simantics.utils.FileUtils;
+import org.slf4j.LoggerFactory;
import gnu.trove.map.hash.TIntIntHashMap;
import gnu.trove.procedure.TIntIntProcedure;
public class DebugSupportImpl implements DebugSupport {
+ private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(DebugSupportImpl.class);
+
final private Map<String, Function2<WriteGraph, String, Object>> getCommands = new HashMap<String, Function2<WriteGraph, String, Object>>();
final private Map<String, Function3<WriteGraph, File, String, String>> listCommands = new HashMap<String, Function3<WriteGraph, File, String, String>>();
final private Map<String, Function2<WriteGraph, String, String>> execCommands = new HashMap<String, Function2<WriteGraph, String, String>>();
});
+ listCommands.put("queryData", new FunctionImpl3<WriteGraph, File, String, String>() {
+
+ @Override
+ public String apply(WriteGraph graph, File file, String args) {
+ try {
+ getSession(graph).queryProvider2.save();
+ return "Saved queries";
+ } catch (IOException e) {
+ LOGGER.error("Error while saving queries", e);
+ return e.getMessage();
+ }
+ }
+
+ });
+
listCommands.put("queryActivity", new FunctionImpl3<WriteGraph, File, String, String>() {
@Override