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 | /** |
22 | * Interface to represent all commands sent from the session daemon to the Java | |
23 | * agent. The agent is then expected to execute the command and provide a | |
24 | * response. | |
25 | * | |
26 | * @author Alexandre Montplaisir | |
27 | */ | |
d60dfbe4 AM |
28 | interface ISessiondCommand { |
29 | ||
301a3ddb | 30 | enum CommandType { |
d60dfbe4 AM |
31 | |
32 | /** List logger(s). */ | |
33 | CMD_LIST(1), | |
34 | /** Enable logger by name. */ | |
35 | CMD_ENABLE(2), | |
36 | /** Disable logger by name. */ | |
37 | CMD_DISABLE(3), | |
38 | /** Registration done */ | |
39 | CMD_REG_DONE(4); | |
40 | ||
41 | private int code; | |
42 | ||
301a3ddb | 43 | private CommandType(int c) { |
d60dfbe4 AM |
44 | code = c; |
45 | } | |
46 | ||
301a3ddb | 47 | public int getCommandType() { |
d60dfbe4 AM |
48 | return code; |
49 | } | |
50 | } | |
51 | ||
52 | /** | |
301a3ddb | 53 | * Execute the command handler's action on the specified tracing agent. |
d60dfbe4 | 54 | * |
301a3ddb AM |
55 | * @param agent |
56 | * The agent on which to execute the command | |
57 | * @return If the command completed successfully or not | |
d60dfbe4 | 58 | */ |
3165c2f5 | 59 | public LttngAgentResponse execute(ILttngTcpClientListener agent); |
d60dfbe4 | 60 | } |