X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FDebugSupportImpl.java;h=ca5eb0825a3c6462676dcee91124d4b2384b2021;hp=f788a12448bfd9b26254bcf489ebbec42c437f31;hb=e460fd6f0af60314e2ca28391ef7ff2043016d97;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07 diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java index f788a1244..ca5eb0825 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/DebugSupportImpl.java @@ -45,6 +45,7 @@ import org.simantics.scl.runtime.function.FunctionImpl2; 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; @@ -53,6 +54,8 @@ import gnu.trove.set.hash.TIntHashSet; public class DebugSupportImpl implements DebugSupport { + private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(DebugSupportImpl.class); + final private Map> getCommands = new HashMap>(); final private Map> listCommands = new HashMap>(); final private Map> execCommands = new HashMap>(); @@ -69,7 +72,7 @@ public class DebugSupportImpl implements DebugSupport { @Override public Object apply(WriteGraph graph, String args) { try { - return getSession(graph).queryProvider2.getListenerReport(); + return getSession(graph).queryProvider2.listening.getListenerReport(); } catch (IOException e) { Logger.defaultLogError(e); return e.getMessage(); @@ -106,6 +109,21 @@ public class DebugSupportImpl implements DebugSupport { }); + listCommands.put("queryData", new FunctionImpl3() { + + @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() { @Override @@ -125,7 +143,7 @@ public class DebugSupportImpl implements DebugSupport { @Override public String apply(WriteGraph graph, File file, String args) { try { - return getSession(graph).queryProvider2.reportListeners(file); + return getSession(graph).queryProvider2.listening.reportListeners(file); } catch (IOException e) { Logger.defaultLogError(e); return e.getMessage();