1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.stubs
.service
;
14 import org
.eclipse
.core
.commands
.ExecutionException
;
15 import org
.eclipse
.core
.runtime
.Status
;
16 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.remote
.IRemoteSystemProxy
;
17 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.service
.ICommandShell
;
18 import org
.eclipse
.linuxtools
.lttng
.stubs
.service
.shells
.LTTngToolsFileShell
;
19 import org
.eclipse
.rse
.core
.model
.IRSECallback
;
20 import org
.eclipse
.rse
.core
.subsystems
.ICommunicationsListener
;
21 import org
.eclipse
.rse
.core
.subsystems
.ISubSystem
;
22 import org
.eclipse
.rse
.services
.shells
.IShellService
;
23 import org
.eclipse
.rse
.services
.terminals
.ITerminalService
;
24 import org
.eclipse
.rse
.subsystems
.files
.core
.servicesubsystem
.IFileServiceSubSystem
;
26 public class TestRemoteSystemProxy
implements IRemoteSystemProxy
{
28 private LTTngToolsFileShell fShell
= null;
29 private String fTestFile
= null;
30 private String fScenario
= null;
33 public IShellService
getShellService() {
38 public ITerminalService
getTerminalService() {
43 public ISubSystem
getShellServiceSubSystem() {
48 public ISubSystem
getTerminalServiceSubSystem() {
52 public IFileServiceSubSystem
getFileServiceSubSystem() {
57 public void connect(IRSECallback callback
) throws ExecutionException
{
58 if (callback
!= null) {
59 callback
.done(Status
.OK_STATUS
, null);
64 public void disconnect() throws ExecutionException
{
69 public ICommandShell
createCommandShell() throws ExecutionException
{
71 fShell
= CommandShellFactory
.getInstance().getFileShell();
72 if ((fTestFile
!= null) && (fScenario
!= null)) {
74 fShell
.loadScenarioFile(fTestFile
);
75 } catch (Exception e
) {
76 throw new ExecutionException(e
.toString());
78 fShell
.setScenario(fScenario
);
85 public void addCommunicationListener(ICommunicationsListener listener
) {
89 public void removeCommunicationListener(ICommunicationsListener listener
) {
92 public void setTestFile(String testFile
) {
96 public void setScenario(String scenario
) {
99 fShell
.setScenario(fScenario
);