Commit | Line | Data |
---|---|---|
eb1bab5b BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2012 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 | **********************************************************************/ | |
9315aeee | 12 | package org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote; |
eb1bab5b BH |
13 | |
14 | import org.eclipse.core.commands.ExecutionException; | |
15 | import org.eclipse.core.runtime.IProgressMonitor; | |
16 | ||
17 | /** | |
eb1bab5b BH |
18 | * <p> |
19 | * Interface for a command shell implementation | |
20 | * </p> | |
cfdb727a | 21 | * |
dbd4432d | 22 | * @author Bernd Hufmann |
eb1bab5b BH |
23 | */ |
24 | public interface ICommandShell { | |
cfdb727a | 25 | |
eb1bab5b BH |
26 | /** |
27 | * Method to connect the command shell. | |
cfdb727a | 28 | * |
eb1bab5b | 29 | * @throws ExecutionException |
cfdb727a | 30 | * If the command fails |
eb1bab5b BH |
31 | */ |
32 | public void connect() throws ExecutionException; | |
cfdb727a | 33 | |
eb1bab5b BH |
34 | /** |
35 | * Method to disconnect the command shell. | |
36 | */ | |
37 | public void disconnect(); | |
cfdb727a | 38 | |
eb1bab5b BH |
39 | /** |
40 | * Method to execute a command on the command shell. | |
cfdb727a AM |
41 | * |
42 | * @param command | |
43 | * - the command to executed | |
44 | * @param monitor | |
45 | * - a progress monitor | |
eb1bab5b BH |
46 | * @return the command result |
47 | * @throws ExecutionException | |
cfdb727a | 48 | * If the command fails |
eb1bab5b | 49 | */ |
cfdb727a AM |
50 | public ICommandResult executeCommand(String command, |
51 | IProgressMonitor monitor) throws ExecutionException; | |
eb1bab5b BH |
52 | |
53 | /** | |
54 | * Method to execute a command on the command shell. | |
cfdb727a AM |
55 | * |
56 | * @param command | |
57 | * - the command to executed | |
58 | * @param monitor | |
59 | * - a progress monitor | |
60 | * @param checkReturnValue | |
61 | * - flag to indicate that the command result should be checked. | |
62 | * If false the command result will be always 0. | |
eb1bab5b BH |
63 | * @return the command result |
64 | * @throws ExecutionException | |
cfdb727a | 65 | * If the command fails |
eb1bab5b | 66 | */ |
cfdb727a AM |
67 | public ICommandResult executeCommand(final String command, |
68 | final IProgressMonitor monitor, final boolean checkReturnValue) | |
69 | throws ExecutionException; | |
eb1bab5b BH |
70 | |
71 | } |