lttng: Add a diagram showing the dependencies between plugins
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui.tests / stubs / org / eclipse / linuxtools / internal / lttng2 / stubs / dialogs / CreateSessionDialogStub.java
index 5a79cc5b812977168e456074e5385e0494a1e18b..15950c870d74ce62d9a1f96d3fe95b4f4feb2394 100644 (file)
@@ -1,58 +1,88 @@
 /**********************************************************************
- * Copyright (c) 2012 Ericsson
- * 
+ * Copyright (c) 2012, 2013 Ericsson
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
+ *
+ * Contributors:
  *   Bernd Hufmann - Initial API and implementation
+ *   Bernd Hufmann - Updated for support of LTTng Tools 2.1
  **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs;
 
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.SessionInfo;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.ICreateSessionDialog;
 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceSessionGroup;
 
 /**
- * Create session dialog stub implementation. 
+ * Create session dialog stub implementation.
  */
+@SuppressWarnings("javadoc")
 public class CreateSessionDialogStub implements ICreateSessionDialog {
-    
-    public String fName = "mysession"; //$NON-NLS-1$
-    public String fPath = null;
-    
-    
-    @Override
-    public String getSessionName() {
-        return fName;
-    }
 
-    @Override
-    public String getSessionPath() {
-        return fPath;
-    }
-
-    @Override
-    public boolean isDefaultSessionPath() {
-        return fPath == null;
-    }
+    public String fName = "mysession";
+    public String fPath = null;
+    private boolean fIsStreamedTrace = false;
+    private String fNetworkUrl = null;
+    private String fControlUrl = null;
+    private String fDataUrl = null;
+    private boolean fIsSnapshot;
 
     @Override
-    public void setTraceSessionGroup(TraceSessionGroup group) {
-
+    public void initialize(TraceSessionGroup group) {
     }
 
     @Override
     public int open() {
         return 0;
     }
-    
+
     public void setSessionPath(String path) {
         fPath = path;
     }
-    
+
     public void setSessionName(String name) {
         fName = name;
     }
+
+    public void setStreamedTrace(boolean isStreamedTrace) {
+        fIsStreamedTrace = isStreamedTrace;
+    }
+
+    public void setNetworkUrl(String fNetworkUrl) {
+        this.fNetworkUrl = fNetworkUrl;
+    }
+
+    public void setControlUrl(String fControlUrl) {
+        this.fControlUrl = fControlUrl;
+    }
+
+    public void setDataUrl(String fDataUrl) {
+        this.fDataUrl = fDataUrl;
+    }
+
+    public void setSnapshot(boolean isSnapshot) {
+        fIsSnapshot = isSnapshot;
+    }
+
+    @Override
+    public ISessionInfo getParameters() {
+        ISessionInfo sessionInfo = new SessionInfo(fName);
+
+        if (fIsStreamedTrace) {
+            sessionInfo.setNetworkUrl(fNetworkUrl);
+            sessionInfo.setControlUrl(fControlUrl);
+            sessionInfo.setDataUrl(fDataUrl);
+            sessionInfo.setStreamedTrace(true);
+        } else if (fPath != null) {
+            sessionInfo.setSessionPath(fPath);
+        }
+
+        sessionInfo.setSnapshot(fIsSnapshot);
+
+        return sessionInfo;
+    }
 }
This page took 0.037194 seconds and 5 git commands to generate.