Add support for streaming feature of LTTng Tools 2.1 (part 1)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / handlers / CreateSessionHandler.java
index 9098c7bd86c86369198d474f68d97ed31ed158a0..3e379cb5cab13de948f83b94dceb2c92d905f9e2 100644 (file)
@@ -60,21 +60,25 @@ public class CreateSessionHandler extends BaseControlViewHandler {
             final TraceSessionGroup sessionGroup = fSessionGroup;
 
             // Open dialog box for the node name and address
-            ICreateSessionDialog dialog = TraceControlDialogFactory.getInstance().getCreateSessionDialog();
-            dialog.setTraceSessionGroup(sessionGroup);
+            final ICreateSessionDialog dialog = TraceControlDialogFactory.getInstance().getCreateSessionDialog();
+            dialog.initialize(sessionGroup);
 
             if (dialog.open() != Window.OK) {
                 return null;
             }
 
-            final String sessionName = dialog.getSessionName();
-            final String sessionPath = dialog.isDefaultSessionPath() ? null : dialog.getSessionPath();
-
             Job job = new Job(Messages.TraceControl_CreateSessionJob) {
                 @Override
                 protected IStatus run(IProgressMonitor monitor) {
                     try {
-                        sessionGroup.createSession(sessionName, sessionPath, monitor);
+                        if (dialog.isStreamedTrace()) {
+                            sessionGroup.createSession(dialog.getSessionName(), dialog.getNetworkUrl(), dialog.getControlUrl(),
+                                    dialog.getDataUrl(), dialog.isNoConsumer(), dialog.isDisableConsumer(), monitor);
+                        } else {
+                            String sessionPath = dialog.isDefaultSessionPath() ? null : dialog.getSessionPath();
+                            sessionGroup.createSession(dialog.getSessionName(), sessionPath, dialog.isNoConsumer(),
+                                    dialog.isDisableConsumer(), monitor);
+                        }
                     } catch (ExecutionException e) {
                         return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_CreateSessionFailure, e);
                     }
This page took 0.026015 seconds and 5 git commands to generate.