Simplify TmfEvent constructors and update javadoc
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / event / ITmfEvent.java
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
15 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
16
17 /**
18 * The generic event structure in TMF. In its canonical form, an event has:
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.
30 *
31 * @since 1.0
32 * @version 1.0
33 * @author Francois Chouinard
34 *
35 * @see ITmfTimestamp
36 * @see ITmfEventType
37 * @see ITmfEventField
38 * @see TmfEvent
39 */
40 public interface ITmfEvent extends Cloneable {
41
42 // ------------------------------------------------------------------------
43 // Constants
44 // ------------------------------------------------------------------------
45
46 /**
47 * Pre-defined event timestamp attribute (for searching &filtering purposes)
48 */
49 public static final String EVENT_FIELD_TIMESTAMP = ":timestamp:"; //$NON-NLS-1$
50
51 /**
52 * Pre-defined event source attribute (for searching &filtering purposes)
53 */
54 public static final String EVENT_FIELD_SOURCE = ":source:"; //$NON-NLS-1$
55
56 /**
57 * Pre-defined event type attribute (for searching &filtering purposes)
58 */
59 public static final String EVENT_FIELD_TYPE = ":type:"; //$NON-NLS-1$
60
61 /**
62 * Pre-defined event content attribute (for searching &filtering purposes)
63 */
64 public static final String EVENT_FIELD_CONTENT = ":content:"; //$NON-NLS-1$
65
66 /**
67 * Pre-defined event reference attribute (for searching &filtering purposes)
68 */
69 public static final String EVENT_FIELD_REFERENCE = ":reference:"; //$NON-NLS-1$
70
71 // ------------------------------------------------------------------------
72 // Getters
73 // ------------------------------------------------------------------------
74
75 /**
76 * @return the trace that 'owns' the event
77 */
78 public ITmfTrace<?> getTrace();
79
80 /**
81 * @return the event rank within the parent trace
82 */
83 public long getRank();
84
85 /**
86 * @return the event timestamp
87 */
88 public ITmfTimestamp getTimestamp();
89
90 /**
91 * @return the event source
92 */
93 public String getSource();
94
95 /**
96 * @return the event type
97 */
98 public ITmfEventType getType();
99
100 /**
101 * @return the event content
102 */
103 public ITmfEventField getContent();
104
105 /**
106 * @return the event reference
107 */
108 public String getReference();
109
110 // ------------------------------------------------------------------------
111 // Cloneable
112 // ------------------------------------------------------------------------
113
114 /**
115 * @return a clone of the event
116 */
117 public ITmfEvent clone();
118
119 }
This page took 0.034696 seconds and 6 git commands to generate.