gdbtrace: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.control.ui.tests / stubs / org / eclipse / linuxtools / internal / lttng2 / control / stubs / dialogs / CreateSessionDialogStub.java
CommitLineData
a26d90be 1/**********************************************************************
81d5dc3a 2 * Copyright (c) 2012, 2014 Ericsson
cfdb727a 3 *
a26d90be
BH
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
cfdb727a
AM
8 *
9 * Contributors:
a26d90be 10 * Bernd Hufmann - Initial API and implementation
ba3a9bd2 11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
81d5dc3a 12 * Marc-Andre Laperle - Support for creating a live session
a26d90be 13 **********************************************************************/
8e8c0226 14package org.eclipse.linuxtools.internal.lttng2.control.stubs.dialogs;
a26d90be 15
8e8c0226
AM
16import org.eclipse.linuxtools.internal.lttng2.control.core.model.ISessionInfo;
17import org.eclipse.linuxtools.internal.lttng2.control.core.model.impl.SessionInfo;
18import org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.ICreateSessionDialog;
19import org.eclipse.linuxtools.internal.lttng2.control.ui.views.model.impl.TraceSessionGroup;
a26d90be
BH
20
21/**
cfdb727a 22 * Create session dialog stub implementation.
a26d90be 23 */
cfdb727a 24@SuppressWarnings("javadoc")
a26d90be 25public class CreateSessionDialogStub implements ICreateSessionDialog {
cfdb727a 26
4e0b52e0 27 public String fName = "mysession";
a26d90be 28 public String fPath = null;
f3b33d40
BH
29 private boolean fIsStreamedTrace = false;
30 private String fNetworkUrl = null;
31 private String fControlUrl = null;
32 private String fDataUrl = null;
589d0d33 33 private boolean fIsSnapshot;
81d5dc3a
MAL
34 private boolean fIsLive = false;
35 private int fLiveDelay = 0;
cfdb727a 36
a26d90be 37 @Override
f3b33d40 38 public void initialize(TraceSessionGroup group) {
a26d90be
BH
39 }
40
41 @Override
42 public int open() {
43 return 0;
44 }
cfdb727a 45
a26d90be
BH
46 public void setSessionPath(String path) {
47 fPath = path;
48 }
cfdb727a 49
a26d90be
BH
50 public void setSessionName(String name) {
51 fName = name;
52 }
f3b33d40 53
f3b33d40
BH
54 public void setStreamedTrace(boolean isStreamedTrace) {
55 fIsStreamedTrace = isStreamedTrace;
56 }
57
f3b33d40
BH
58 public void setNetworkUrl(String fNetworkUrl) {
59 this.fNetworkUrl = fNetworkUrl;
60 }
61
f3b33d40
BH
62 public void setControlUrl(String fControlUrl) {
63 this.fControlUrl = fControlUrl;
64 }
65
f3b33d40
BH
66 public void setDataUrl(String fDataUrl) {
67 this.fDataUrl = fDataUrl;
68 }
69
589d0d33
BH
70 public void setSnapshot(boolean isSnapshot) {
71 fIsSnapshot = isSnapshot;
72 }
f7d4d450 73
81d5dc3a
MAL
74 public void setLive(boolean isLive) {
75 fIsLive = isLive;
76 }
77
78 public void setLiveDelay(int liveDelay) {
79 fLiveDelay = liveDelay;
80 }
81
f7d4d450
MAL
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
81d5dc3a
MAL
95 sessionInfo.setLive(fIsLive);
96 sessionInfo.setLiveDelay(fLiveDelay);
f7d4d450
MAL
97 sessionInfo.setSnapshot(fIsSnapshot);
98
99 return sessionInfo;
100 }
a26d90be 101}
This page took 0.053796 seconds and 5 git commands to generate.