Commit | Line | Data |
---|---|---|
5179fc01 | 1 | /******************************************************************************* |
61759503 | 2 | * Copyright (c) 2012, 2013 Ericsson |
6256d8ad | 3 | * |
5179fc01 FC |
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 | |
6256d8ad | 8 | * |
5179fc01 FC |
9 | * Contributors: |
10 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.core.event; | |
14 | ||
bd54d363 | 15 | import org.eclipse.core.runtime.IAdaptable; |
3bd46eef | 16 | import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; |
4c564a2d FC |
17 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; |
18 | ||
5179fc01 | 19 | /** |
f7703ed6 | 20 | * The generic event structure in TMF. In its canonical form, an event has: |
4c564a2d FC |
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. | |
6256d8ad | 32 | * |
b9e37ffd FC |
33 | * @version 1.0 |
34 | * @author Francois Chouinard | |
35 | * | |
d337369a FC |
36 | * @see ITmfTimestamp |
37 | * @see ITmfEventType | |
f7703ed6 | 38 | * @see ITmfEventField |
d337369a | 39 | * @see TmfEvent |
4c564a2d | 40 | */ |
bd54d363 | 41 | public interface ITmfEvent extends IAdaptable { |
4c564a2d | 42 | |
a4115405 FC |
43 | // ------------------------------------------------------------------------ |
44 | // Constants | |
45 | // ------------------------------------------------------------------------ | |
46 | ||
4c564a2d | 47 | /** |
f7703ed6 | 48 | * Pre-defined event timestamp attribute (for searching &filtering purposes) |
4c564a2d | 49 | */ |
a4115405 | 50 | public static final String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$ |
f7703ed6 FC |
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 | */ | |
a4115405 FC |
70 | public static final String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$ |
71 | ||
72 | // ------------------------------------------------------------------------ | |
73 | // Getters | |
74 | // ------------------------------------------------------------------------ | |
4c564a2d FC |
75 | |
76 | /** | |
77 | * @return the trace that 'owns' the event | |
78 | */ | |
6256d8ad | 79 | public ITmfTrace getTrace(); |
4c564a2d FC |
80 | |
81 | /** | |
82 | * @return the event rank within the parent trace | |
83 | */ | |
84 | public long getRank(); | |
5179fc01 FC |
85 | |
86 | /** | |
87 | * @return the event timestamp | |
3bd46eef | 88 | * @since 2.0 |
5179fc01 FC |
89 | */ |
90 | public ITmfTimestamp getTimestamp(); | |
91 | ||
4c564a2d FC |
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 | ||
5179fc01 | 112 | } |