lttng: Fix more Sonar warnings in LTTng Tracer Control
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / service / ILttngControlService.java
CommitLineData
eb1bab5b 1/**********************************************************************
ba3a9bd2 2 * Copyright (c) 2012, 2013 Ericsson
cfdb727a 3 *
eb1bab5b
BH
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
cfdb727a
AM
8 *
9 * Contributors:
eb1bab5b 10 * Bernd Hufmann - Initial API and implementation
ba3a9bd2 11 * Bernd Hufmann - Updated for support of LTTng Tools 2.1
eb1bab5b 12 **********************************************************************/
115b4a01 13package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;
eb1bab5b
BH
14
15import java.util.List;
16
17import org.eclipse.core.commands.ExecutionException;
18import org.eclipse.core.runtime.IProgressMonitor;
9315aeee
BH
19import org.eclipse.linuxtools.internal.lttng2.core.control.model.IBaseEventInfo;
20import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
21import org.eclipse.linuxtools.internal.lttng2.core.control.model.ISessionInfo;
22import org.eclipse.linuxtools.internal.lttng2.core.control.model.IUstProviderInfo;
23import org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType;
24import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
eb1bab5b
BH
25
26
dbd4432d 27/**
eb1bab5b 28* <p>
cfdb727a 29* Interface for LTTng trace control command service.
eb1bab5b 30* </p>
cfdb727a 31*
dbd4432d 32* @author Bernd Hufmann
eb1bab5b
BH
33*/
34public interface ILttngControlService {
276c17e7
BH
35
36 /**
37 * @return the version string.
38 */
046b6849 39 String getVersion();
276c17e7 40
d4514365
BH
41 /**
42 * Checks if given version is supported by this ILTTngControlService implementation.
43 *
44 * @param version The version to check
45 * @return <code>true</code> if version is supported else <code>false</code>
46 */
046b6849 47 boolean isVersionSupported(String version);
d4514365 48
eb1bab5b
BH
49 /**
50 * Retrieves the existing sessions names from the node.
cfdb727a
AM
51 *
52 * @param monitor
53 * - a progress monitor
eb1bab5b
BH
54 * @return an array with session names.
55 * @throws ExecutionException
cfdb727a 56 * If the command fails
eb1bab5b 57 */
046b6849 58 String[] getSessionNames(IProgressMonitor monitor)
cfdb727a
AM
59 throws ExecutionException;
60
eb1bab5b
BH
61 /**
62 * Retrieves the session information with the given name the node.
cfdb727a
AM
63 *
64 * @param sessionName
65 * - the session name
66 * @param monitor
67 * - a progress monitor
eb1bab5b
BH
68 * @return session information
69 * @throws ExecutionException
cfdb727a
AM
70 * If the command fails
71 */
046b6849 72 ISessionInfo getSession(String sessionName, IProgressMonitor monitor)
cfdb727a
AM
73 throws ExecutionException;
74
eb1bab5b
BH
75 /**
76 * Retrieves the kernel provider information (i.e. the kernel events)
cfdb727a
AM
77 *
78 * @param monitor
79 * - a progress monitor
eb1bab5b
BH
80 * @return the list of existing kernel events.
81 * @throws ExecutionException
cfdb727a 82 * If the command fails
eb1bab5b 83 */
046b6849 84 List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor)
cfdb727a
AM
85 throws ExecutionException;
86
eb1bab5b
BH
87 /**
88 * Retrieves the UST provider information from the node.
cfdb727a 89 *
eb1bab5b
BH
90 * @return - the UST provider information.
91 * @throws ExecutionException
cfdb727a 92 * If the command fails
eb1bab5b
BH
93 */
94 public List<IUstProviderInfo> getUstProvider() throws ExecutionException;
cfdb727a 95
eb1bab5b
BH
96 /**
97 * Retrieves the UST provider information from the node.
cfdb727a
AM
98 *
99 * @param monitor
100 * - a progress monitor
bbb3538a 101 * @return the UST provider information.
eb1bab5b 102 * @throws ExecutionException
cfdb727a 103 * If the command fails
eb1bab5b 104 */
046b6849 105 List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor)
cfdb727a
AM
106 throws ExecutionException;
107
bbb3538a
BH
108 /**
109 * Creates a session with given session name and location.
cfdb727a
AM
110 *
111 * @param sessionName
112 * - a session name to create
113 * @param sessionPath
114 * - a path for storing the traces (use null for default)
115 * @param monitor
116 * - a progress monitor
bbb3538a
BH
117 * @return the session information
118 * @throws ExecutionException
cfdb727a 119 * If the command fails
bbb3538a 120 */
046b6849 121 ISessionInfo createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException;
f3b33d40
BH
122
123 /**
124 * Creates a session with given session name and location.
125 *
126 * @param sessionName
127 * - a session name to create
128 * @param networkUrl
129 * - a network URL for common definition of data and control channel
130 * or null if separate definition of data and control channel
131 * @param controlUrl
132 * - a URL for control channel (networkUrl has to be null, dataUrl has to be set)
133 * @param dataUrl
134 * - a URL for data channel (networkUrl has to be null, controlUrl has to be set)
f3b33d40
BH
135 * @param monitor
136 * - a progress monitor
137 * @return the session information
138 * @throws ExecutionException
139 * If the command fails
140 */
046b6849 141 ISessionInfo createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, IProgressMonitor monitor) throws ExecutionException;
f3b33d40 142
bbb3538a 143 /**
cfdb727a
AM
144 * Destroys a session with given session name.
145 *
146 * @param sessionName
147 * - a session name to destroy
148 * @param monitor
149 * - a progress monitor
bbb3538a 150 * @throws ExecutionException
cfdb727a 151 * If the command fails
bbb3538a 152 */
046b6849 153 void destroySession(String sessionName, IProgressMonitor monitor)
cfdb727a 154 throws ExecutionException;
bbb3538a
BH
155
156 /**
cfdb727a
AM
157 * Starts a session with given session name.
158 *
159 * @param sessionName
160 * - a session name to start
161 * @param monitor
162 * - a progress monitor
bbb3538a 163 * @throws ExecutionException
cfdb727a
AM
164 * If the command fails
165 */
046b6849 166 void startSession(String sessionName, IProgressMonitor monitor)
cfdb727a 167 throws ExecutionException;
bbb3538a 168
cfdb727a
AM
169 /**
170 * Stops a session with given session name.
171 *
172 * @param sessionName
173 * - a session name to stop
174 * @param monitor
175 * - a progress monitor
176 * @throws ExecutionException
177 * If the command fails
178 */
046b6849 179 void stopSession(String sessionName, IProgressMonitor monitor)
cfdb727a 180 throws ExecutionException;
bbb3538a 181
cfdb727a
AM
182 /**
183 * Enables a list of channels for given session and given channel
184 * information (configuration).
185 *
186 * @param sessionName
187 * - a session name to create
188 * @param channelNames
189 * - a list of channel names to be enabled
190 * @param isKernel
191 * - a flag to indicate Kernel or UST (true for Kernel, false for
192 * UST)
193 * @param info
194 * - channel information used for creation of a channel (or null
195 * for default)
196 * @param monitor
197 * - a progress monitor
198 * @throws ExecutionException
199 * If the command fails
200 */
046b6849 201 void enableChannels(String sessionName, List<String> channelNames,
cfdb727a
AM
202 boolean isKernel, IChannelInfo info, IProgressMonitor monitor)
203 throws ExecutionException;
bbb3538a 204
cfdb727a
AM
205 /**
206 * Disables a list of channels for given session and given channel
207 * information (configuration).
208 *
209 * @param sessionName
210 * - a session name to create
211 * @param channelNames
212 * - a list of channel names to be enabled
213 * @param isKernel
214 * - a flag to indicate Kernel or UST (true for Kernel, false for
215 * UST)
216 * @param monitor
217 * - a progress monitor
218 * @throws ExecutionException
219 * If the command fails
220 */
046b6849 221 void disableChannels(String sessionName, List<String> channelNames,
cfdb727a
AM
222 boolean isKernel, IProgressMonitor monitor)
223 throws ExecutionException;
6503ae0f
BH
224
225 /**
226 * Enables a list of events with no additional parameters.
cfdb727a
AM
227 *
228 * @param sessionName
229 * - a session name
230 * @param channelName
231 * - a channel name or null for default channel
232 * @param eventNames
233 * - a list of event names to be enabled, or null (list of size =
234 * 0)for all events .
235 * @param isKernel
236 * - a flag for indicating kernel or UST.
d4514365
BH
237 * @param filterExpression
238 * - a filter expression
cfdb727a
AM
239 * @param monitor
240 * - a progress monitor
6503ae0f 241 * @throws ExecutionException
cfdb727a 242 * If the command fails
6503ae0f 243 */
046b6849 244 void enableEvents(String sessionName, String channelName,
d4514365
BH
245 List<String> eventNames, boolean isKernel, String filterExpression,
246 IProgressMonitor monitor)
cfdb727a 247 throws ExecutionException;
498704b3 248
d4514365 249
498704b3
BH
250 /**
251 * Enables all syscall events.
cfdb727a
AM
252 *
253 * @param sessionName
254 * - a session name
255 * @param channelName
256 * - a channel name or null for default channel
257 * @param monitor
258 * - a progress monitor
498704b3 259 * @throws ExecutionException
cfdb727a 260 * If the command fails
498704b3 261 */
046b6849 262 void enableSyscalls(String sessionName, String channelName,
cfdb727a 263 IProgressMonitor monitor) throws ExecutionException;
498704b3
BH
264
265 /**
d132bcc7 266 * Enables a dynamic probe or dynamic function entry/return probe.
cfdb727a
AM
267 *
268 * @param sessionName
269 * - a session name
270 * @param channelName
271 * - a channel name or null for default channel
272 * @param eventName
273 * - a event name
274 * @param isFunction
275 * - true for dynamic function entry/return probe else false
276 * @param probe
277 * - a dynamic probe information
278 * @param monitor
279 * - a progress monitor
498704b3 280 * @throws ExecutionException
cfdb727a 281 * If the command fails
498704b3 282 */
046b6849 283 void enableProbe(String sessionName, String channelName,
cfdb727a
AM
284 String eventName, boolean isFunction, String probe,
285 IProgressMonitor monitor) throws ExecutionException;
498704b3 286
ccc66d01
BH
287 /**
288 * Enables events using log level
cfdb727a
AM
289 *
290 * @param sessionName
291 * - a session name
292 * @param channelName
293 * - a channel name (null for default channel)
294 * @param eventName
295 * - a event name
296 * @param logLevelType
297 * - a log level type
298 * @param level
299 * - a log level
d4514365
BH
300 * @param filterExpression
301 * - a filter expression
cfdb727a
AM
302 * @param monitor
303 * - a progress monitor
ccc66d01 304 * @throws ExecutionException
cfdb727a 305 * If the command fails
ccc66d01 306 */
046b6849 307 void enableLogLevel(String sessionName, String channelName,
cfdb727a 308 String eventName, LogLevelType logLevelType, TraceLogLevel level,
d4514365 309 String filterExpression,
cfdb727a
AM
310 IProgressMonitor monitor) throws ExecutionException;
311
6503ae0f
BH
312 /**
313 * Disables a list of events with no additional parameters.
cfdb727a
AM
314 *
315 * @param sessionName
316 * - a session name
317 * @param channelName
318 * - a channel name (null for default channel)
319 * @param eventNames
320 * - a list of event names to enabled.
321 * @param isKernel
322 * - a flag for indicating kernel or UST.
323 * @param monitor
324 * - a progress monitor
6503ae0f 325 * @throws ExecutionException
cfdb727a 326 * If the command fails
6503ae0f 327 */
046b6849 328 void disableEvent(String sessionName, String channelName,
cfdb727a
AM
329 List<String> eventNames, boolean isKernel, IProgressMonitor monitor)
330 throws ExecutionException;
331
b793fbe1
BH
332 /**
333 * Gets all available context names to be added to channels/events.
cfdb727a 334 *
b793fbe1 335 * @param monitor
cfdb727a 336 * The progress monitor
b793fbe1 337 * @return the list of available contexts
cfdb727a
AM
338 * @throws ExecutionException
339 * If the command fails
b793fbe1 340 */
046b6849 341 List<String> getContextList(IProgressMonitor monitor)
cfdb727a
AM
342 throws ExecutionException;
343
b793fbe1
BH
344 /**
345 * Add contexts to given channels and or events
cfdb727a
AM
346 *
347 * @param sessionName
348 * - a session name
349 * @param channelName
350 * - a channel name (null for all channels)
351 * @param eventName
352 * - a event name (null for all events)
353 * @param isKernel
354 * - a flag for indicating kernel or UST.
355 * @param contexts
356 * - a list of name of contexts to add
357 * @param monitor
358 * - a progress monitor
b793fbe1 359 * @throws ExecutionException
cfdb727a 360 * If the command fails
b793fbe1 361 */
046b6849 362 void addContexts(String sessionName, String channelName,
cfdb727a
AM
363 String eventName, boolean isKernel, List<String> contexts,
364 IProgressMonitor monitor) throws ExecutionException;
365
b720ac44
BH
366 /**
367 * Executes calibrate command to quantify LTTng overhead.
cfdb727a
AM
368 *
369 * @param isKernel
370 * - a flag for indicating kernel or UST.
371 * @param monitor
372 * - a progress monitor
b720ac44 373 * @throws ExecutionException
cfdb727a 374 * If the command fails
b720ac44 375 */
046b6849 376 void calibrate(boolean isKernel, IProgressMonitor monitor)
cfdb727a 377 throws ExecutionException;
eb1bab5b 378}
This page took 0.066002 seconds and 5 git commands to generate.