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 FC |
17 | /** |
18 | * <b><u>ITmfEvent</u></b> | |
19 | * <p> | |
3118edf1 | 20 | * The basic event structure in TMF. In its canonical form, a data item 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. | |
32 | */ | |
33 | public interface ITmfEvent extends Cloneable { | |
34 | ||
a4115405 FC |
35 | // ------------------------------------------------------------------------ |
36 | // Constants | |
37 | // ------------------------------------------------------------------------ | |
38 | ||
4c564a2d | 39 | /** |
085d898f | 40 | * Pre-defined event attributes |
4c564a2d | 41 | */ |
a4115405 FC |
42 | public static final String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$ |
43 | public static final String EVENT_FIELD_SOURCE = ":source:"; //$NON-NLS-1$ | |
44 | public static final String EVENT_FIELD_TYPE = ":type:"; //$NON-NLS-1$ | |
45 | public static final String EVENT_FIELD_CONTENT = ":content:"; //$NON-NLS-1$ | |
46 | public static final String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$ | |
47 | ||
48 | // ------------------------------------------------------------------------ | |
49 | // Getters | |
50 | // ------------------------------------------------------------------------ | |
4c564a2d FC |
51 | |
52 | /** | |
53 | * @return the trace that 'owns' the event | |
54 | */ | |
55 | public ITmfTrace<?> getTrace(); | |
56 | ||
57 | /** | |
58 | * @return the event rank within the parent trace | |
59 | */ | |
60 | public long getRank(); | |
5179fc01 FC |
61 | |
62 | /** | |
63 | * @return the event timestamp | |
64 | */ | |
65 | public ITmfTimestamp getTimestamp(); | |
66 | ||
4c564a2d FC |
67 | /** |
68 | * @return the event source | |
69 | */ | |
70 | public String getSource(); | |
71 | ||
72 | /** | |
73 | * @return the event type | |
74 | */ | |
75 | public ITmfEventType getType(); | |
76 | ||
77 | /** | |
78 | * @return the event content | |
79 | */ | |
80 | public ITmfEventField getContent(); | |
81 | ||
82 | /** | |
83 | * @return the event reference | |
84 | */ | |
85 | public String getReference(); | |
86 | ||
a4115405 FC |
87 | // ------------------------------------------------------------------------ |
88 | // Cloneable | |
89 | // ------------------------------------------------------------------------ | |
90 | ||
4c564a2d | 91 | /** |
3ef62bac | 92 | * @return a clone of the event |
4c564a2d FC |
93 | */ |
94 | public ITmfEvent clone(); | |
085d898f | 95 | |
5179fc01 | 96 | } |