Small refactor of the Java agent's TCP client
[deliverable/lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / client / ISessiondCommand.java
index 855ea9da8aeadcf72bac126a2453cde7222f96fb..0b5a164433f075542942427016158b5d8eea77be 100644 (file)
 
 package org.lttng.ust.agent.client;
 
+import org.lttng.ust.agent.AbstractLttngAgent;
+
+/**
+ * Interface to represent all commands sent from the session daemon to the Java
+ * agent. The agent is then expected to execute the command and provide a
+ * response.
+ *
+ * @author Alexandre Montplaisir
+ */
 interface ISessiondCommand {
 
-       enum LttngAgentCommand {
+       enum CommandType {
 
                /** List logger(s). */
                CMD_LIST(1),
@@ -33,20 +42,21 @@ interface ISessiondCommand {
 
                private int code;
 
-               private LttngAgentCommand(int c) {
+               private CommandType(int c) {
                        code = c;
                }
 
-               public int getCommand() {
+               public int getCommandType() {
                        return code;
                }
        }
 
        /**
-        * Populate the class from a byte array
+        * Execute the command handler's action on the specified tracing agent.
         *
-        * @param data
-        *              the byte array containing the streamed command
+        * @param agent
+        *            The agent on which to execute the command
+        * @return If the command completed successfully or not
         */
-       void populate(byte[] data);
+       public ILttngAgentResponse execute(AbstractLttngAgent<?> agent);
 }
\ No newline at end of file
This page took 0.027282 seconds and 5 git commands to generate.