ctf: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.ui.tests / stubs / org / eclipse / tracecompass / internal / lttng2 / control / stubs / dialogs / CreateSessionDialogStub.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
12 * Marc-Andre Laperle - Support for creating a live session
13 **********************************************************************/
14 package org.eclipse.tracecompass.internal.lttng2.control.stubs.dialogs;
15
16 import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
17 import org.eclipse.tracecompass.internal.lttng2.control.core.model.impl.SessionInfo;
18 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.dialogs.ICreateSessionDialog;
19 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup;
20
21 /**
22 * Create session dialog stub implementation.
23 */
24 @SuppressWarnings("javadoc")
25 public class CreateSessionDialogStub implements ICreateSessionDialog {
26
27 public String fName = "mysession";
28 public String fPath = null;
29 private boolean fIsStreamedTrace = false;
30 private String fNetworkUrl = null;
31 private String fControlUrl = null;
32 private String fDataUrl = null;
33 private boolean fIsSnapshot;
34 private boolean fIsLive = false;
35 private long fLiveDelay = 0;
36
37 @Override
38 public void initialize(TraceSessionGroup group) {
39 }
40
41 @Override
42 public int open() {
43 return 0;
44 }
45
46 public void setSessionPath(String path) {
47 fPath = path;
48 }
49
50 public void setSessionName(String name) {
51 fName = name;
52 }
53
54 public void setStreamedTrace(boolean isStreamedTrace) {
55 fIsStreamedTrace = isStreamedTrace;
56 }
57
58 public void setNetworkUrl(String fNetworkUrl) {
59 this.fNetworkUrl = fNetworkUrl;
60 }
61
62 public void setControlUrl(String fControlUrl) {
63 this.fControlUrl = fControlUrl;
64 }
65
66 public void setDataUrl(String fDataUrl) {
67 this.fDataUrl = fDataUrl;
68 }
69
70 public void setSnapshot(boolean isSnapshot) {
71 fIsSnapshot = isSnapshot;
72 }
73
74 public void setLive(boolean isLive) {
75 fIsLive = isLive;
76 }
77
78 public void setLiveDelay(int liveDelay) {
79 fLiveDelay = liveDelay;
80 }
81
82 @Override
83 public ISessionInfo getParameters() {
84 ISessionInfo sessionInfo = new SessionInfo(fName);
85
86 if (fIsStreamedTrace) {
87 sessionInfo.setNetworkUrl(fNetworkUrl);
88 sessionInfo.setControlUrl(fControlUrl);
89 sessionInfo.setDataUrl(fDataUrl);
90 sessionInfo.setStreamedTrace(true);
91 } else if (fPath != null) {
92 sessionInfo.setSessionPath(fPath);
93 }
94
95 sessionInfo.setLive(fIsLive);
96 sessionInfo.setLiveDelay(fLiveDelay);
97 sessionInfo.setSnapshot(fIsSnapshot);
98
99 return sessionInfo;
100 }
101 }
This page took 0.0429 seconds and 5 git commands to generate.