Commit | Line | Data |
---|---|---|
5179fc01 FC |
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 | ||
4c564a2d FC |
15 | import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; |
16 | ||
5179fc01 | 17 | /** |
f7703ed6 | 18 | * The generic event structure in TMF. In its canonical form, an event has: |
4c564a2d FC |
19 | * <ul> |
20 | * <li> a parent trace | |
21 | * <li> a rank (order within the trace) | |
22 | * <li> a timestamp | |
23 | * <li> a source (reporting component) | |
24 | * <li> a type | |
25 | * <li> a content (payload) | |
26 | * </ul> | |
27 | * For convenience, a free-form reference field is also provided. It could be | |
28 | * used as e.g. a location marker (filename:lineno) to indicate where the event | |
29 | * was generated. | |
d337369a | 30 | * |
b9e37ffd FC |
31 | * @version 1.0 |
32 | * @author Francois Chouinard | |
33 | * | |
d337369a FC |
34 | * @see ITmfTimestamp |
35 | * @see ITmfEventType | |
f7703ed6 | 36 | * @see ITmfEventField |
d337369a | 37 | * @see TmfEvent |
4c564a2d | 38 | */ |
0316808c | 39 | public interface ITmfEvent { |
4c564a2d | 40 | |
a4115405 FC |
41 | // ------------------------------------------------------------------------ |
42 | // Constants | |
43 | // ------------------------------------------------------------------------ | |
44 | ||
4c564a2d | 45 | /** |
f7703ed6 | 46 | * Pre-defined event timestamp attribute (for searching &filtering purposes) |
4c564a2d | 47 | */ |
a4115405 | 48 | public static final String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$ |
f7703ed6 FC |
49 | |
50 | /** | |
51 | * Pre-defined event source attribute (for searching &filtering purposes) | |
52 | */ | |
53 | public static final String EVENT_FIELD_SOURCE = ":source:"; //$NON-NLS-1$ | |
54 | ||
55 | /** | |
56 | * Pre-defined event type attribute (for searching &filtering purposes) | |
57 | */ | |
58 | public static final String EVENT_FIELD_TYPE = ":type:"; //$NON-NLS-1$ | |
59 | ||
60 | /** | |
61 | * Pre-defined event content attribute (for searching &filtering purposes) | |
62 | */ | |
63 | public static final String EVENT_FIELD_CONTENT = ":content:"; //$NON-NLS-1$ | |
64 | ||
65 | /** | |
66 | * Pre-defined event reference attribute (for searching &filtering purposes) | |
67 | */ | |
a4115405 FC |
68 | public static final String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$ |
69 | ||
70 | // ------------------------------------------------------------------------ | |
71 | // Getters | |
72 | // ------------------------------------------------------------------------ | |
4c564a2d FC |
73 | |
74 | /** | |
75 | * @return the trace that 'owns' the event | |
76 | */ | |
77 | public ITmfTrace<?> getTrace(); | |
78 | ||
79 | /** | |
80 | * @return the event rank within the parent trace | |
81 | */ | |
82 | public long getRank(); | |
5179fc01 FC |
83 | |
84 | /** | |
85 | * @return the event timestamp | |
86 | */ | |
87 | public ITmfTimestamp getTimestamp(); | |
88 | ||
4c564a2d FC |
89 | /** |
90 | * @return the event source | |
91 | */ | |
92 | public String getSource(); | |
93 | ||
94 | /** | |
95 | * @return the event type | |
96 | */ | |
97 | public ITmfEventType getType(); | |
98 | ||
99 | /** | |
100 | * @return the event content | |
101 | */ | |
102 | public ITmfEventField getContent(); | |
103 | ||
104 | /** | |
105 | * @return the event reference | |
106 | */ | |
107 | public String getReference(); | |
108 | ||
109 | /** | |
3ef62bac | 110 | * @return a clone of the event |
4c564a2d FC |
111 | */ |
112 | public ITmfEvent clone(); | |
085d898f | 113 | |
5179fc01 | 114 | } |