2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2015 EfficiOS Inc.
5 * Copyright (C) 2015 Alexandre Montplaisir <alexmonthy@efficios.com>
8 package org.lttng.ust.agent.client;
10 import java.util.Collection;
12 import org.lttng.ust.agent.session.EventRule;
15 * TCP client listener interface.
17 * This interface contains callbacks that are called when the TCP client
18 * receives commands from the session daemon. These callbacks will define what
19 * do to with each command.
21 * @author Alexandre Montplaisir
23 public interface ILttngTcpClientListener {
26 * Callback for the TCP client to notify the listener agent that a request
27 * for enabling an event rule was sent from the session daemon.
30 * The event rule that was requested to be enabled
31 * @return Since we do not track individual sessions, right now this command
32 * cannot fail. It will always return true.
34 boolean eventEnabled(EventRule eventRule);
37 * Callback for the TCP client to notify the listener agent that a request
38 * for disabling an event was sent from the session daemon.
41 * The name of the event that was requested to be disabled.
42 * @return True if the command completed successfully, false if we should
43 * report an error (event was not enabled, etc.)
45 boolean eventDisabled(String eventName);
48 * Callback for the TCP client to notify the listener agent that a request
49 * for enabling an application-specific context was sent from the session
52 * @param contextRetrieverName
53 * The name of the retriever in which the context is present.
54 * This is used to namespace the contexts.
56 * The name of the context that was requested to be enabled
57 * @return Since we do not track individual sessions, right now this command
58 * cannot fail. It will always return true.
60 boolean appContextEnabled(String contextRetrieverName, String contextName);
63 * Callback for the TCP client to notify the listener agent that a request
64 * for disabling an application-specific context was sent from the session
67 * @param contextRetrieverName
68 * The name of the retriever in which the context is present.
69 * This is used to namespace the contexts.
71 * The name of the context that was requested to be disabled.
72 * @return True if the command completed successfully, false if we should
73 * report an error (context was not previously enabled for example)
75 boolean appContextDisabled(String contextRetrieverName, String contextName);
78 * List the events that are available in the agent's tracing domain.
80 * In Java terms, this means loggers that have at least one LTTng log
81 * handler of their corresponding domain attached.
83 * @return The list of available events
85 Collection<String> listAvailableEvents();