tmf remote: clean up RemoteSystemProxy class
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.ui.tests / stubs / org / eclipse / tracecompass / internal / lttng2 / control / stubs / service / TestRemoteSystemProxy.java
CommitLineData
d132bcc7 1/**********************************************************************
d8a4fd60 2 * Copyright (c) 2012, 2015 Ericsson
cfdb727a 3 *
d132bcc7
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:
d132bcc7 10 * Bernd Hufmann - Initial API and implementation
b732adaa 11 * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
d132bcc7 12 **********************************************************************/
9bc60be7 13package org.eclipse.tracecompass.internal.lttng2.control.stubs.service;
eb1bab5b 14
d8a4fd60
BH
15import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
16
eb1bab5b 17import org.eclipse.core.commands.ExecutionException;
b732adaa 18import org.eclipse.core.runtime.IProgressMonitor;
d8a4fd60 19import org.eclipse.remote.core.IRemoteConnection;
9bc60be7 20import org.eclipse.tracecompass.internal.lttng2.control.stubs.shells.LTTngToolsFileShell;
d8a4fd60 21import org.eclipse.tracecompass.tmf.remote.core.proxy.RemoteSystemProxy;
ec619615 22import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandShell;
eb1bab5b 23
cfdb727a 24@SuppressWarnings("javadoc")
d8a4fd60
BH
25public class TestRemoteSystemProxy extends RemoteSystemProxy {
26
27 public TestRemoteSystemProxy(IRemoteConnection host) {
28 super(checkNotNull(host));
29 }
cfdb727a 30
d132bcc7
BH
31 private LTTngToolsFileShell fShell = null;
32 private String fTestFile = null;
33 private String fScenario = null;
eb1bab5b 34
eb1bab5b 35 @Override
b732adaa 36 public void connect(IProgressMonitor monitor) throws ExecutionException {
bbb3538a 37 }
eb1bab5b
BH
38
39 @Override
d8a4fd60 40 public void disconnect() {
b732adaa 41 fShell = null;
eb1bab5b
BH
42 }
43
44 @Override
b732adaa 45 public void dispose() {
eb1bab5b
BH
46 }
47
48 @Override
13729cbc 49 public ICommandShell createCommandShell() {
d8a4fd60
BH
50 LTTngToolsFileShell shell = fShell;
51 if (shell == null) {
13729cbc 52 shell = new LTTngToolsFileShell();
d132bcc7 53 if ((fTestFile != null) && (fScenario != null)) {
13729cbc 54 shell.loadScenarioFile(fTestFile);
d8a4fd60
BH
55 shell.setScenario(fScenario);
56 fShell = shell;
d132bcc7 57 }
13729cbc 58 fShell = shell;
d132bcc7 59 }
13729cbc 60 return shell;
eb1bab5b
BH
61 }
62
d132bcc7
BH
63 public void setTestFile(String testFile) {
64 fTestFile = testFile;
65 }
cfdb727a 66
d132bcc7
BH
67 public void setScenario(String scenario) {
68 fScenario = scenario;
69 if (fShell != null) {
70 fShell.setScenario(fScenario);
71 }
72 }
00de7b32
BH
73
74 @Override
b732adaa
MS
75 public boolean isConnected() {
76 return true;
a657b111 77 }
eb1bab5b 78}
This page took 0.06682 seconds and 5 git commands to generate.