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