Added some more JUnit tests
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / control / model / impl / TraceDomainComponent.java
index 8d88a69b23b25a42cd3e7abbb5804ef1c8ad640a..28696f7dd8bad2e654d424996ce7eca2cfc94a35 100644 (file)
@@ -20,6 +20,8 @@ import org.eclipse.linuxtools.lttng.ui.views.control.Messages;
 import org.eclipse.linuxtools.lttng.ui.views.control.model.IChannelInfo;
 import org.eclipse.linuxtools.lttng.ui.views.control.model.IDomainInfo;
 import org.eclipse.linuxtools.lttng.ui.views.control.model.ITraceControlComponent;
+import org.eclipse.linuxtools.lttng.ui.views.control.model.LogLevelType;
+import org.eclipse.linuxtools.lttng.ui.views.control.model.TraceLogLevel;
 import org.eclipse.linuxtools.lttng.ui.views.control.property.TraceDomainPropertySource;
 import org.eclipse.ui.views.properties.IPropertySource;
 
@@ -98,6 +100,13 @@ public class TraceDomainComponent extends TraceControlComponent {
         return ((TraceSessionComponent)getParent()).getName();
     }
     
+    /**
+     * @return session from parent
+     */
+    public TraceSessionComponent getSession() {
+       return (TraceSessionComponent)getParent(); 
+    }
+
     /**
      * @return true if domain is kernel, false for UST
      */
@@ -112,6 +121,21 @@ public class TraceDomainComponent extends TraceControlComponent {
     public void setIsKernel(boolean isKernel) {
         fDomainInfo.setIsKernel(isKernel);
     }
+    
+    /**
+     * @return returns all available channels for this domain.
+     */
+    public TraceChannelComponent[] getChannels() {
+        List<ITraceControlComponent> channels = getChildren(TraceChannelComponent.class);
+        return (TraceChannelComponent[])channels.toArray(new TraceChannelComponent[channels.size()]);
+    }
+    
+    /**
+     * @return the parent target node
+     */
+    public TargetNodeComponent getTargetNode() {
+        return ((TraceSessionComponent)getParent()).getTargetNode();
+    }
 
     // ------------------------------------------------------------------------
     // Operations
@@ -153,7 +177,7 @@ public class TraceDomainComponent extends TraceControlComponent {
      * @throws ExecutionException
      */
     public void enableChannels(List<String> channelNames, IChannelInfo info, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().enableChannel(getParent().getName(), channelNames, isKernel(), info, monitor);
+        getControlService().enableChannels(getParent().getName(), channelNames, isKernel(), info, monitor);
     }
     /**
      * Disables channels with given names which are part of this domain. 
@@ -170,6 +194,81 @@ public class TraceDomainComponent extends TraceControlComponent {
      * @throws ExecutionException
      */
     public void disableChannels(List<String> channelNames, IProgressMonitor monitor) throws ExecutionException {
-        getControlService().disableChannel(getParent().getName(), channelNames, isKernel(), monitor);
+        getControlService().disableChannels(getParent().getName(), channelNames, isKernel(), monitor);
+    }
+
+    /**
+     * Enables a list of events with no additional parameters.
+     * @param eventNames - a list of event names to enabled.
+     * @param monitor - a progress monitor
+     * @throws ExecutionException
+     */
+    public void enableEvents(List<String> eventNames, IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableEvents(getSessionName(), null, eventNames, isKernel(), monitor);
+    }
+
+    /**
+     * Enables all syscalls (for kernel domain)
+     * @throws ExecutionException
+     */
+   public void enableSyscalls() throws ExecutionException {
+        enableSyscalls(new NullProgressMonitor());
+    }
+
+   /**
+    * Enables all syscalls (for kernel domain)
+    * @param monitor - a progress monitor
+    * @throws ExecutionException
+    */
+
+    public void enableSyscalls(IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableSyscalls(getSessionName(), null, monitor);
+    }
+
+    /**
+     * Enables a dynamic probe (for kernel domain)
+     * @param eventName - event name for probe
+     * @param isFunction - true for dynamic function entry/return probe else false
+      * @param probe - the actual probe
+     * @throws ExecutionException
+     */
+    public void enableProbe(String eventName, boolean isFunction, String probe) throws ExecutionException {
+        enableProbe(eventName, isFunction, probe, new NullProgressMonitor());
+    }
+    
+    /**
+     * Enables a dynamic probe (for kernel domain)
+     * @param eventName - event name for probe
+     * @param isFunction - true for dynamic function entry/return probe else false
+     * @param probe - the actual probe
+     * @param monitor - a progress monitor
+     * @throws ExecutionException
+     */
+    public void enableProbe(String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableProbe(getSessionName(), null, eventName, isFunction, probe, monitor);
+    }
+
+    /**
+     * Enables events using log level.
+     * @param eventName - a event name
+     * @param logLevelType - a log level type 
+     * @param level - a log level 
+     * @throws ExecutionException
+     */
+    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level) throws ExecutionException {
+        enableLogLevel(eventName, logLevelType, level, new NullProgressMonitor());
     }
+
+    /**
+     * Enables events using log level.
+     * @param eventName - a event name
+     * @param logLevelType - a log level type 
+     * @param level - a log level 
+     * @param monitor - a progress monitor  
+     * @throws ExecutionException
+     */
+    public void enableLogLevel(String eventName, LogLevelType logLevelType, TraceLogLevel level, IProgressMonitor monitor) throws ExecutionException {
+        getControlService().enableLogLevel(getSessionName(), null, eventName, logLevelType, level, monitor);
+    }
+
 }
This page took 0.024681 seconds and 5 git commands to generate.