control: Add support for saving session
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / views / service / LTTngControlService.java
index ba3f32317f71de5c249a12731d991598dfc72538..e531a4a21dd4d373ec4497c575bde16f26d25ef8 100644 (file)
@@ -1020,6 +1020,41 @@ public class LTTngControlService implements ILttngControlService {
         executeCommand(command, monitor);
     }
 
+    @Override
+    public void loadSession(String inputPath, boolean isForce, IProgressMonitor monitor)
+            throws ExecutionException {
+        ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_LOAD_SESSION);
+
+        if (inputPath != null) {
+            command.add(LTTngControlServiceConstants.OPTION_INPUT_PATH);
+            command.add(inputPath);
+        }
+
+        if (isForce) {
+            command.add(LTTngControlServiceConstants.OPTION_FORCE);
+        }
+        executeCommand(command, monitor);
+    }
+
+    @Override
+    public void saveSession(String session, String outputPath, boolean isForce, IProgressMonitor monitor) throws ExecutionException {
+        ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_SAVE_SESSION);
+
+        if (outputPath != null) {
+            command.add(LTTngControlServiceConstants.OPTION_OUTPUT_PATH);
+            command.add(outputPath);
+        }
+
+        if (isForce) {
+            command.add(LTTngControlServiceConstants.OPTION_FORCE);
+        }
+
+        if (session != null) {
+            command.add(session);
+        }
+        executeCommand(command, monitor);
+    }
+
     @Override
     public void runCommands(IProgressMonitor monitor, List<String> commandLines) throws ExecutionException {
         for (String commandLine : commandLines) {
@@ -1535,4 +1570,6 @@ public class LTTngControlService implements ILttngControlService {
 
         return result;
     }
+
+
 }
This page took 0.024243 seconds and 5 git commands to generate.