Commit | Line | Data |
---|---|---|
d60dfbe4 AM |
1 | /* |
2 | * Copyright (C) 2015 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com> | |
3 | * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com> | |
4 | * | |
5 | * This library is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License, version 2.1 only, | |
7 | * as published by the Free Software Foundation. | |
8 | * | |
9 | * This library is distributed in the hope that it will be useful, but WITHOUT | |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | |
12 | * for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU Lesser General Public License | |
15 | * along with this library; if not, write to the Free Software Foundation, | |
16 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | */ | |
18 | ||
19 | package org.lttng.ust.agent.client; | |
20 | ||
301a3ddb AM |
21 | import org.lttng.ust.agent.AbstractLttngAgent; |
22 | ||
23 | /** | |
24 | * Interface to represent all commands sent from the session daemon to the Java | |
25 | * agent. The agent is then expected to execute the command and provide a | |
26 | * response. | |
27 | * | |
28 | * @author Alexandre Montplaisir | |
29 | */ | |
d60dfbe4 AM |
30 | interface ISessiondCommand { |
31 | ||
301a3ddb | 32 | enum CommandType { |
d60dfbe4 AM |
33 | |
34 | /** List logger(s). */ | |
35 | CMD_LIST(1), | |
36 | /** Enable logger by name. */ | |
37 | CMD_ENABLE(2), | |
38 | /** Disable logger by name. */ | |
39 | CMD_DISABLE(3), | |
40 | /** Registration done */ | |
41 | CMD_REG_DONE(4); | |
42 | ||
43 | private int code; | |
44 | ||
301a3ddb | 45 | private CommandType(int c) { |
d60dfbe4 AM |
46 | code = c; |
47 | } | |
48 | ||
301a3ddb | 49 | public int getCommandType() { |
d60dfbe4 AM |
50 | return code; |
51 | } | |
52 | } | |
53 | ||
54 | /** | |
301a3ddb | 55 | * Execute the command handler's action on the specified tracing agent. |
d60dfbe4 | 56 | * |
301a3ddb AM |
57 | * @param agent |
58 | * The agent on which to execute the command | |
59 | * @return If the command completed successfully or not | |
d60dfbe4 | 60 | */ |
93253569 | 61 | public LttngAgentResponse execute(AbstractLttngAgent<?> agent); |
d60dfbe4 | 62 | } |