tmf: Move timestamps to their own package
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / event / ITmfEvent.java
1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.event;
14
15 import org.eclipse.core.runtime.IAdaptable;
16 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
17 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
18
19 /**
20 * The generic event structure in TMF. In its canonical form, an event has:
21 * <ul>
22 * <li> a parent trace
23 * <li> a rank (order within the trace)
24 * <li> a timestamp
25 * <li> a source (reporting component)
26 * <li> a type
27 * <li> a content (payload)
28 * </ul>
29 * For convenience, a free-form reference field is also provided. It could be
30 * used as e.g. a location marker (filename:lineno) to indicate where the event
31 * was generated.
32 *
33 * @version 1.0
34 * @author Francois Chouinard
35 *
36 * @see ITmfTimestamp
37 * @see ITmfEventType
38 * @see ITmfEventField
39 * @see TmfEvent
40 */
41 public interface ITmfEvent extends IAdaptable {
42
43 // ------------------------------------------------------------------------
44 // Constants
45 // ------------------------------------------------------------------------
46
47 /**
48 * Pre-defined event timestamp attribute (for searching &filtering purposes)
49 */
50 public static final String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$
51
52 /**
53 * Pre-defined event source attribute (for searching &filtering purposes)
54 */
55 public static final String EVENT_FIELD_SOURCE = ":source:"; //$NON-NLS-1$
56
57 /**
58 * Pre-defined event type attribute (for searching &filtering purposes)
59 */
60 public static final String EVENT_FIELD_TYPE = ":type:"; //$NON-NLS-1$
61
62 /**
63 * Pre-defined event content attribute (for searching &filtering purposes)
64 */
65 public static final String EVENT_FIELD_CONTENT = ":content:"; //$NON-NLS-1$
66
67 /**
68 * Pre-defined event reference attribute (for searching &filtering purposes)
69 */
70 public static final String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$
71
72 // ------------------------------------------------------------------------
73 // Getters
74 // ------------------------------------------------------------------------
75
76 /**
77 * @return the trace that 'owns' the event
78 */
79 public ITmfTrace getTrace();
80
81 /**
82 * @return the event rank within the parent trace
83 */
84 public long getRank();
85
86 /**
87 * @return the event timestamp
88 * @since 2.0
89 */
90 public ITmfTimestamp getTimestamp();
91
92 /**
93 * @return the event source
94 */
95 public String getSource();
96
97 /**
98 * @return the event type
99 */
100 public ITmfEventType getType();
101
102 /**
103 * @return the event content
104 */
105 public ITmfEventField getContent();
106
107 /**
108 * @return the event reference
109 */
110 public String getReference();
111
112 }
This page took 0.032809 seconds and 5 git commands to generate.