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 | 21 | * <ul> |
a4fa4e36 MK |
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) | |
4c564a2d FC |
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 | */ | |
57a2a5ca | 79 | ITmfTrace getTrace(); |
4c564a2d FC |
80 | |
81 | /** | |
82 | * @return the event rank within the parent trace | |
83 | */ | |
57a2a5ca | 84 | long getRank(); |
5179fc01 FC |
85 | |
86 | /** | |
87 | * @return the event timestamp | |
3bd46eef | 88 | * @since 2.0 |
5179fc01 | 89 | */ |
57a2a5ca | 90 | ITmfTimestamp getTimestamp(); |
5179fc01 | 91 | |
4c564a2d FC |
92 | /** |
93 | * @return the event source | |
94 | */ | |
57a2a5ca | 95 | String getSource(); |
4c564a2d FC |
96 | |
97 | /** | |
98 | * @return the event type | |
99 | */ | |
57a2a5ca | 100 | ITmfEventType getType(); |
4c564a2d FC |
101 | |
102 | /** | |
103 | * @return the event content | |
104 | */ | |
57a2a5ca | 105 | ITmfEventField getContent(); |
4c564a2d FC |
106 | |
107 | /** | |
108 | * @return the event reference | |
109 | */ | |
57a2a5ca | 110 | String getReference(); |
4c564a2d | 111 | |
5179fc01 | 112 | } |