import org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferences;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell;
-import org.osgi.framework.Version;
/**
* <p>
/**
* The command shell implementation
*/
- protected ICommandShell fCommandShell = null;
+ private final ICommandShell fCommandShell;
/**
* The version string.
*/
- protected Version fVersion = null;
+ private LttngVersion fVersion = null;
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#getVersion()
- */
+
@Override
public String getVersion() {
if (fVersion == null) {
* @param version - a version to set
*/
public void setVersion(String version) {
- fVersion = new Version(version);
+ fVersion = new LttngVersion(version);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#isVersionSupported(java.lang.String)
- */
@Override
public boolean isVersionSupported(String version) {
- Version tmp = new Version(version);
+ LttngVersion tmp = new LttngVersion(version);
return (fVersion != null && fVersion.compareTo(tmp) >= 0) ? true : false;
}
+ /**
+ * Returns the command shell implementation.
+ *
+ * @return the command shell implementation
+ */
+ protected ICommandShell getCommandShell() {
+ return fCommandShell;
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
- * #getSessionNames(org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST);
return retArray.toArray(new String[retArray.size()]);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
- * #getSession(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName);
return sessionInfo;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
- * #getKernelProvider(org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL);
return events;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
- * #getUstProvider()
- */
@Override
public List<IUstProviderInfo> getUstProvider() throws ExecutionException {
return getUstProvider(new NullProgressMonitor());
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService
- * #getUstProvider(org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST);
return allProviders;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#createSession(java.lang.String, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public ISessionInfo createSession(String sessionName, String sessionPath, IProgressMonitor monitor) throws ExecutionException {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#createSession(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public ISessionInfo createSession(String sessionName, String networkUrl, String controlUrl, String dataUrl, IProgressMonitor monitor) throws ExecutionException {
//Session <sessionName> destroyed
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#startSession(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void startSession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
//Session <sessionName> started
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#stopSession(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void stopSession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
String newSessionName = formatParameter(sessionName);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableChannel(java.lang.String, java.util.List, boolean, org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.IChannelInfo, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void enableChannels(String sessionName, List<String> channelNames, boolean isKernel, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#disableChannel(java.lang.String, java.util.List, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void disableChannels(String sessionName, List<String> channelNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
executeCommand(command.toString(), monitor);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableEvents(java.lang.String, java.lang.String, java.util.List, boolean, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableSyscalls(java.lang.String, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void enableSyscalls(String sessionName, String channelName, IProgressMonitor monitor) throws ExecutionException {
executeCommand(command.toString(), monitor);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableProbe(java.lang.String, java.lang.String, java.lang.String, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void enableProbe(String sessionName, String channelName, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
executeCommand(command.toString(), monitor);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#enableLogLevel(java.lang.String, java.lang.String, java.lang.String, org.eclipse.linuxtools.internal.lttng2.core.control.model.LogLevelType, org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void enableLogLevel(String sessionName, String channelName, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
executeCommand(command.toString(), monitor);
}
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#disableEvent(java.lang.String, java.lang.String, java.util.List, boolean, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void disableEvent(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_EVENT);
executeCommand(command.toString(), monitor);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#getContexts(org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public List<String> getContextList(IProgressMonitor monitor) throws ExecutionException {
return contexts;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#addContexts(java.lang.String, java.lang.String, java.lang.String, boolean, java.util.List, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List<String> contextNames, IProgressMonitor monitor) throws ExecutionException {
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ILttngControlService#calibrate(boolean, org.eclipse.core.runtime.IProgressMonitor)
- */
@Override
public void calibrate(boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
-// String newSessionName = formatParameter(sessionName);
StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CALIBRATE);
-//
-// command.append(OPTION_SESSION);
-// command.append(newSessionName);
if (isKernel) {
command.append(LTTngControlServiceConstants.OPTION_KERNEL);
// ------------------------------------------------------------------------
// Helper methods
// ------------------------------------------------------------------------
+
/**
* Checks if command result is an error result.
*
} else {
index++;
}
-// else if (line.matches(EVENT_NONE_PATTERN)) {
- // do nothing
-// } else
-
}
return index;