[Tmf][Ctf] Add descriptive fail to import messages.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / ITmfTrace.java
index 784932887032c405e5fb38eee58b9eb36efc7eb3..131317549ff43b1a376b897967693c5a18e50d68 100644 (file)
 
 package org.eclipse.linuxtools.tmf.core.trace;
 
-import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
@@ -148,13 +150,28 @@ public interface ITmfTrace extends ITmfDataProvider {
      * @param path the trace path
      *
      * @return true if trace is valid
+     * @since 2.0
      */
-    public boolean validate(IProject project, String path);
+    public IStatus validate(IProject project, String path);
 
     // ------------------------------------------------------------------------
     // Basic getters
     // ------------------------------------------------------------------------
 
+    /**
+     * If this trace is used as a container for sub-traces, this can be used to
+     * get the sub-traces themselves. If the trace is stand-alone, this should
+     * return an array with only "this" inside. For this reason, be careful if
+     * calling this recursively.
+     *
+     * This offers a standard way of iterating through compound traces (like
+     * experiments).
+     *
+     * @return The array of sub-traces.
+     * @since 2.0
+     */
+    public ITmfTrace[] getTraces();
+
     /**
      * @return the trace event type
      */
@@ -182,24 +199,15 @@ public interface ITmfTrace extends ITmfDataProvider {
     public ITmfStatistics getStatistics();
 
     /**
-     * Retrieve a state system that belongs to this trace
+     * Return the map of state systems associated with this trace.
      *
-     * @param id
-     *            The ID of the state system to retrieve.
-     * @return The state system that is associated with this trace and ID, or
-     *         'null' if such a match doesn't exist.
-     * @since 2.0
-     */
-    public ITmfStateSystem getStateSystem(String id);
-
-    /**
-     * Return the list of existing state systems registered with this trace.
+     * This view should be read-only (implementations should use
+     * {@link Collections#unmodifiableMap}).
      *
-     * @return A Collection view of the available state systems. The collection
-     *         could be empty, but should not be null.
+     * @return The map of state systems
      * @since 2.0
      */
-    public Collection<String> listStateSystems();
+    public Map<String, ITmfStateSystem> getStateSystems();
 
     /**
      * If a state system is not build by the trace itself, it's possible to
This page took 0.025025 seconds and 5 git commands to generate.