}
- @Override
- public void loadSession(String sessionPath, IProgressMonitor monitor) throws ExecutionException {
-
- ICommandInput command = createCommand(LTTngControlServiceConstants.COMMAND_LOAD_SESSION, "-i", sessionPath); //$NON-NLS-1$
-
- executeCommand(command, monitor);
-
- // Session <sessionName> loaded
- }
-
@Override
public void enableChannels(String sessionName, List<String> channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
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) {