Commit | Line | Data |
---|---|---|
eb1bab5b | 1 | /********************************************************************** |
00de7b32 | 2 | * Copyright (c) 2012, 2013 Ericsson |
cfdb727a | 3 | * |
eb1bab5b 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: | |
eb1bab5b BH |
10 | * Bernd Hufmann - Initial API and implementation |
11 | **********************************************************************/ | |
115b4a01 | 12 | package org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote; |
eb1bab5b BH |
13 | |
14 | import org.eclipse.core.commands.ExecutionException; | |
eb1bab5b BH |
15 | import org.eclipse.rse.core.model.IRSECallback; |
16 | import org.eclipse.rse.core.subsystems.ICommunicationsListener; | |
17 | import org.eclipse.rse.core.subsystems.ISubSystem; | |
18 | import org.eclipse.rse.services.shells.IShellService; | |
19 | import org.eclipse.rse.services.terminals.ITerminalService; | |
bbb3538a | 20 | import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; |
eb1bab5b BH |
21 | |
22 | /** | |
eb1bab5b BH |
23 | * <p> |
24 | * Remote System Proxy interface. | |
25 | * </p> | |
cfdb727a | 26 | * |
dbd4432d | 27 | * @author Bernd Hufmann |
eb1bab5b BH |
28 | */ |
29 | public interface IRemoteSystemProxy { | |
30 | ||
00de7b32 BH |
31 | // ------------------------------------------------------------------------ |
32 | // Constants | |
33 | // ------------------------------------------------------------------------ | |
34 | /** | |
35 | * Invalid port number for IP based connections. | |
36 | */ | |
37 | public final static int INVALID_PORT_NUMBER = -1; | |
38 | ||
eb1bab5b BH |
39 | // ------------------------------------------------------------------------ |
40 | // Operations | |
41 | // ------------------------------------------------------------------------ | |
42 | /** | |
bbb3538a | 43 | * Find the first shell service. |
cfdb727a | 44 | * |
eb1bab5b BH |
45 | * @return shell service object, or <code>null</code> if not found. |
46 | */ | |
47 | public IShellService getShellService(); | |
48 | ||
49 | /** | |
bbb3538a | 50 | * Find the first terminal service. |
cfdb727a | 51 | * |
eb1bab5b BH |
52 | * @return shell service object, or <code>null</code> if not found. |
53 | */ | |
54 | public ITerminalService getTerminalService(); | |
55 | ||
56 | /** | |
bbb3538a | 57 | * Find the first IShellServiceSubSystem service. |
cfdb727a | 58 | * |
eb1bab5b BH |
59 | * @return shell service subsystem, or <code>null</code> if not found. |
60 | */ | |
61 | public ISubSystem getShellServiceSubSystem(); | |
62 | ||
63 | /** | |
bbb3538a | 64 | * Find the first ITerminalServiceSubSystem service. |
cfdb727a | 65 | * |
eb1bab5b BH |
66 | * @return shell service subsystem, or <code>null</code> if not found. |
67 | */ | |
68 | public ISubSystem getTerminalServiceSubSystem(); | |
cfdb727a | 69 | |
bbb3538a BH |
70 | /** |
71 | * Finds the File Service Subsystem. | |
cfdb727a AM |
72 | * |
73 | * @return file service subsystem, or <code>null</code> if not found. | |
bbb3538a BH |
74 | */ |
75 | public IFileServiceSubSystem getFileServiceSubSystem(); | |
cfdb727a | 76 | |
00de7b32 BH |
77 | /** |
78 | * @return port of IP connection to be used | |
79 | */ | |
80 | public int getPort(); | |
81 | ||
82 | /** | |
83 | * Sets the port of the IP connection. | |
84 | * @param port - the IP port to set | |
85 | */ | |
86 | public void setPort(int port); | |
87 | ||
eb1bab5b | 88 | /** |
cfdb727a AM |
89 | * Connects the shell service sub system. |
90 | * | |
91 | * @param callback | |
92 | * - call-back method being called when connection was finished | |
93 | * @throws ExecutionException | |
94 | * If the connection fails | |
eb1bab5b BH |
95 | */ |
96 | public void connect(IRSECallback callback) throws ExecutionException; | |
97 | ||
98 | /** | |
cfdb727a AM |
99 | * Disconnects from the shell service sub system. |
100 | * | |
101 | * @throws ExecutionException | |
102 | * If the disconnect command fails | |
eb1bab5b BH |
103 | */ |
104 | public void disconnect() throws ExecutionException; | |
105 | ||
106 | /** | |
cfdb727a AM |
107 | * Creates a command shell. |
108 | * | |
eb1bab5b | 109 | * @return the command shell implementation |
cfdb727a AM |
110 | * @throws ExecutionException |
111 | * If the command fails | |
eb1bab5b BH |
112 | */ |
113 | public ICommandShell createCommandShell() throws ExecutionException; | |
114 | ||
115 | /** | |
cfdb727a AM |
116 | * Method to add a communication listener to the connector service defined |
117 | * for the given connection. | |
118 | * | |
119 | * @param listener | |
120 | * - listener to add | |
eb1bab5b BH |
121 | */ |
122 | public void addCommunicationListener(ICommunicationsListener listener); | |
123 | ||
124 | /** | |
cfdb727a AM |
125 | * Method to remove a communication listener from the connector service |
126 | * defined for the given connection. | |
127 | * | |
128 | * @param listener | |
129 | * - listener to remove | |
eb1bab5b BH |
130 | */ |
131 | public void removeCommunicationListener(ICommunicationsListener listener); | |
132 | ||
133 | } |