[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 ec087bea23f05da4a3bf74fef847924f563fe7ee..131317549ff43b1a376b897967693c5a18e50d68 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2011, 2012 Ericsson
+ * Copyright (c) 2009, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
 
 package org.eclipse.linuxtools.tmf.core.trace;
 
+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.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
+import org.eclipse.linuxtools.tmf.core.statistics.ITmfStatistics;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
 
 /**
  * The event stream structure in TMF. In its basic form, a trace has:
@@ -144,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
      */
@@ -171,6 +192,38 @@ public interface ITmfTrace extends ITmfDataProvider {
      */
     public int getCacheSize();
 
+    /**
+     * @return The statistics provider for this trace
+     * @since 2.0
+     */
+    public ITmfStatistics getStatistics();
+
+    /**
+     * Return the map of state systems associated with this trace.
+     *
+     * This view should be read-only (implementations should use
+     * {@link Collections#unmodifiableMap}).
+     *
+     * @return The map of state systems
+     * @since 2.0
+     */
+    public Map<String, ITmfStateSystem> getStateSystems();
+
+    /**
+     * If a state system is not build by the trace itself, it's possible to
+     * register it if it comes from another source. It will then be accessible
+     * with {@link #getStateSystems} normally.
+     *
+     * @param id
+     *            The unique ID to assign to this state system. In case of
+     *            conflicting ID's, the new one will overwrite the previous one
+     *            (default Map behavior).
+     * @param ss
+     *            The already-built state system
+     * @since 2.0
+     */
+    public void registerStateSystem(String id, ITmfStateSystem ss);
+
     // ------------------------------------------------------------------------
     // Trace characteristics getters
     // ------------------------------------------------------------------------
@@ -182,16 +235,19 @@ public interface ITmfTrace extends ITmfDataProvider {
 
     /**
      * @return the trace time range
+     * @since 2.0
      */
     public TmfTimeRange getTimeRange();
 
     /**
      * @return the timestamp of the first trace event
+     * @since 2.0
      */
     public ITmfTimestamp getStartTime();
 
     /**
      * @return the timestamp of the last trace event
+     * @since 2.0
      */
     public ITmfTimestamp getEndTime();
 
@@ -262,6 +318,7 @@ public interface ITmfTrace extends ITmfDataProvider {
      *
      * @param timestamp the timestamp of desired event
      * @return a context which can later be used to read the corresponding event
+     * @since 2.0
      */
     public ITmfContext seekEvent(ITmfTimestamp timestamp);
 
@@ -278,4 +335,27 @@ public interface ITmfTrace extends ITmfDataProvider {
      */
     public ITmfContext seekEvent(double ratio);
 
+    /**
+     * Returns the initial range offset
+     *
+     * @return the initial range offset
+     * @since 2.0
+     */
+    public ITmfTimestamp getInitialRangeOffset();
+
+    /**
+     * Return the current selected time.
+     *
+     * @return the current time stamp
+     * @since 2.0
+     */
+    public ITmfTimestamp getCurrentTime();
+
+    /**
+     * Return the current selected range.
+     *
+     * @return the current time range
+     * @since 2.0
+     */
+    public TmfTimeRange getCurrentRange();
 }
This page took 0.025945 seconds and 5 git commands to generate.