+ /**
+ * @return The "add-context" commands that were received since instantiation
+ * or the last {@link #clearAllCommands}.
+ */
+ public List<String> getEnabledAppContextCommands() {
+ synchronized (enabledAppContextCommands) {
+ return new ArrayList<>(enabledAppContextCommands);
+ }
+ }
+
+ /**
+ * Return the number of "context disabled" commands received.
+ *
+ * There is no equivalent command in the lttng CLI, but the sessiond will
+ * send such messages through the agent socket when a session is destroyed
+ * and had contexts enabled.
+ *
+ * @return The number of "context disabled" commands received.
+ */
+ public List<String> getDisabledAppContextCommands() {
+ synchronized (disabledAppContextCommands) {
+ return new ArrayList<>(disabledAppContextCommands);
+ }
+ }
+