/*
+ * Copyright (C) 2015-2016 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
* Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
*
* This library is free software; you can redistribute it and/or modify it
private static final String ROOT_PORT_FILE = "/var/run/lttng/agent.port";
private static final String USER_PORT_FILE = "/.lttng/agent.port";
- private static int protocolMajorVersion = 1;
- private static int protocolMinorVersion = 0;
+ private static final int PROTOCOL_MAJOR_VERSION = 2;
+ private static final int PROTOCOL_MINOR_VERSION = 0;
/** Command header from the session deamon. */
private final CountDownLatch registrationLatch = new CountDownLatch(1);
buf.putInt(domainValue);
buf.putInt(Integer.parseInt(pid));
- buf.putInt(protocolMajorVersion);
- buf.putInt(protocolMinorVersion);
+ buf.putInt(PROTOCOL_MAJOR_VERSION);
+ buf.putInt(PROTOCOL_MINOR_VERSION);
this.outToSessiond.write(data, 0, data.length);
this.outToSessiond.flush();
}
}
case CMD_LIST:
{
- ISessiondCommand listLoggerCmd = new SessiondListLoggersCommand();
+ SessiondCommand listLoggerCmd = new SessiondListLoggersCommand();
LttngAgentResponse response = listLoggerCmd.execute(logAgent);
responseData = response.getBytes();
break;
}
- case CMD_ENABLE:
+ case CMD_EVENT_ENABLE:
{
if (inputData == null) {
/* Invalid command */
responseData = LttngAgentResponse.FAILURE_RESPONSE.getBytes();
break;
}
- ISessiondCommand enableCmd = new SessiondEnableEventCommand(inputData);
- LttngAgentResponse response = enableCmd.execute(logAgent);
+ SessiondCommand enableEventCmd = new SessiondEnableEventCommand(inputData);
+ LttngAgentResponse response = enableEventCmd.execute(logAgent);
responseData = response.getBytes();
break;
}
- case CMD_DISABLE:
+ case CMD_EVENT_DISABLE:
{
if (inputData == null) {
/* Invalid command */
responseData = LttngAgentResponse.FAILURE_RESPONSE.getBytes();
break;
}
- ISessiondCommand disableCmd = new SessiondDisableEventCommand(inputData);
- LttngAgentResponse response = disableCmd.execute(logAgent);
+ SessiondCommand disableEventCmd = new SessiondDisableEventCommand(inputData);
+ LttngAgentResponse response = disableEventCmd.execute(logAgent);
+ responseData = response.getBytes();
+ break;
+ }
+ case CMD_APP_CTX_ENABLE:
+ {
+ if (inputData == null) {
+ /* This commands expects a payload, invalid command */
+ responseData = LttngAgentResponse.FAILURE_RESPONSE.getBytes();
+ break;
+ }
+ SessiondCommand enableAppCtxCmd = new SessiondEnableAppContextCommand(inputData);
+ LttngAgentResponse response = enableAppCtxCmd.execute(logAgent);
+ responseData = response.getBytes();
+ break;
+ }
+ case CMD_APP_CTX_DISABLE:
+ {
+ if (inputData == null) {
+ /* This commands expects a payload, invalid command */
+ responseData = LttngAgentResponse.FAILURE_RESPONSE.getBytes();
+ break;
+ }
+ SessiondCommand disableAppCtxCmd = new SessiondDisableAppContextCommand(inputData);
+ LttngAgentResponse response = disableAppCtxCmd.execute(logAgent);
responseData = response.getBytes();
break;
}