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 / model / impl / TraceSessionGroup.java
index 87177ef3d589dbad535825ea2918a81ac5aab015..20e315d99ad8e39f611df8255b5bce001e1149e9 100644 (file)
@@ -61,6 +61,14 @@ public class TraceSessionGroup extends TraceControlComponent {
         return (TargetNodeComponent)getParent();
     }
 
+    /**
+     * Returns if node supports networks streaming or not
+     * @return <code>true</code> if node supports filtering else <code>false</code>
+     */
+    public boolean isNetworkStreamingSupported() {
+        return getTargetNode().isNetworkStreamingSupported();
+    }
+
     // ------------------------------------------------------------------------
     // Operations
     // ------------------------------------------------------------------------
@@ -100,12 +108,15 @@ public class TraceSessionGroup extends TraceControlComponent {
      *            - a session name to create
      * @param sessionPath
      *            - a path for storing the traces (use null for default)
+     * @param noConsumer
+     *            - a flag to indicate no consumer
+     * @param disableConsumer
+     *            - a flag to disable consumer
      * @throws ExecutionException
      *             If the command fails
      */
-    public void createSession(String sessionName, String sessionPath)
-            throws ExecutionException {
-        createSession(sessionName, sessionPath, new NullProgressMonitor());
+    public void createSession(String sessionName, String sessionPath, boolean noConsumer, boolean disableConsumer) throws ExecutionException {
+        createSession(sessionName, sessionPath, noConsumer, disableConsumer, new NullProgressMonitor());
     }
 
     /**
@@ -115,15 +126,18 @@ public class TraceSessionGroup extends TraceControlComponent {
      *            - a session name to create
      * @param sessionPath
      *            - a path for storing the traces (use null for default)
+     * @param noConsumer
+     *            - a flag to indicate no consumer
+     * @param disableConsumer
+     *            - a flag to disable consumer
      * @param monitor
      *            - a progress monitor
      * @throws ExecutionException
      *             If the command fails
      */
-    public void createSession(String sessionName, String sessionPath,
-            IProgressMonitor monitor) throws ExecutionException {
-        ISessionInfo sessionInfo = getControlService().createSession(
-                sessionName, sessionPath, monitor);
+    public void createSession(String sessionName, String sessionPath, boolean noConsumer, boolean disableConsumer, IProgressMonitor monitor) throws ExecutionException {
+        ISessionInfo sessionInfo = getControlService().createSession(sessionName, sessionPath, noConsumer, disableConsumer, monitor);
+
         if (sessionInfo != null) {
             TraceSessionComponent session = new TraceSessionComponent(
                     sessionInfo.getName(), TraceSessionGroup.this);
@@ -132,6 +146,60 @@ public class TraceSessionGroup extends TraceControlComponent {
         }
     }
 
+    /**
+     * Creates a session with given session name and location.
+     *
+     * @param sessionName
+     *            - a session name to create
+     * @param networkUrl
+     *            - a network URL for common definition of data and control channel
+     *              or null if separate definition of data and control channel
+     * @param controlUrl
+     *            - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
+     * @param dataUrl
+     *            - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
+     * @param noConsumer
+     *            - a flag to indicate no consumer
+     * @param disableConsumer
+     *            - a flag to disable consumer
+     * @throws ExecutionException
+     *             If the command fails
+     */
+    public void createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, boolean noConsumer, boolean disableConsumer) throws ExecutionException {
+        createSession(sessionName, networkUrl, controlUrl, dataUrl, noConsumer, disableConsumer, new NullProgressMonitor());
+    }
+
+    /**
+     * Creates a session with given session name and location.
+     *
+     * @param sessionName
+     *            - a session name to create
+     * @param networkUrl
+     *            - a network URL for common definition of data and control channel
+     *              or null if separate definition of data and control channel
+     * @param controlUrl
+     *            - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
+     * @param dataUrl
+     *            - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
+     * @param noConsumer
+     *            - a flag to indicate no consumer
+     * @param disableConsumer
+     *            - a flag to disable consumer
+     * @param monitor
+     *            - a progress monitor
+     * @throws ExecutionException
+     *             If the command fails
+     */
+    public void createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, boolean noConsumer, boolean disableConsumer, IProgressMonitor monitor) throws ExecutionException {
+        ISessionInfo sessionInfo = getControlService().createSession(sessionName, networkUrl, controlUrl, dataUrl, noConsumer, disableConsumer, monitor);
+
+        if (sessionInfo != null) {
+            TraceSessionComponent session = new TraceSessionComponent(sessionInfo.getName(), TraceSessionGroup.this);
+            addChild(session);
+            session.getConfigurationFromNode(monitor);
+        }
+    }
+
     /**
      * Destroys a session with given session name.
      *
This page took 0.042358 seconds and 5 git commands to generate.