Commit | Line | Data |
---|---|---|
8c8bf09f ASL |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009 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: | |
1f506a43 | 10 | * Francois Chouinard - Initial API and implementation |
8c8bf09f ASL |
11 | *******************************************************************************/ |
12 | ||
13 | package org.eclipse.linuxtools.tmf.event; | |
14 | ||
15 | /** | |
16 | * <b><u>TmfEvent</u></b> | |
17 | * <p> | |
1f506a43 | 18 | * The basic event structure in the TMF. In its canonical form, an event has: |
8c8bf09f ASL |
19 | * <ul> |
20 | * <li> a normalized timestamp | |
21 | * <li> a source (reporter) | |
22 | * <li> a type | |
23 | * <li> a content | |
24 | * </ul> | |
25 | * For convenience, a free-form reference field is also provided. It could be | |
26 | * used as e.g. a location marker in the event stream to distinguish between | |
27 | * otherwise identical events. | |
8c8bf09f | 28 | */ |
4ab33d2b | 29 | public class TmfEvent { |
8c8bf09f | 30 | |
4ab33d2b | 31 | // ======================================================================== |
8c8bf09f | 32 | // Attributes |
4ab33d2b | 33 | // ======================================================================== |
8c8bf09f | 34 | |
1f506a43 FC |
35 | private final TmfTimestamp fEffectiveTimestamp; |
36 | private final TmfTimestamp fOriginalTimestamp; | |
4ab33d2b AO |
37 | private final TmfEventSource fSource; |
38 | private final TmfEventType fType; | |
39 | private final TmfEventContent fContent; | |
40 | private final TmfEventReference fReference; | |
8c8bf09f | 41 | |
4ab33d2b | 42 | // ======================================================================== |
8c8bf09f | 43 | // Constructors |
4ab33d2b | 44 | // ======================================================================== |
8c8bf09f ASL |
45 | |
46 | /** | |
4ab33d2b AO |
47 | * @param timestamp |
48 | * @param source | |
49 | * @param type | |
50 | * @param content | |
51 | * @param reference | |
8c8bf09f | 52 | */ |
1f506a43 FC |
53 | public TmfEvent(TmfTimestamp originalTS, TmfTimestamp effectiveTS, TmfEventSource source, |
54 | TmfEventType type, TmfEventContent content, TmfEventReference reference) | |
8c8bf09f | 55 | { |
1f506a43 FC |
56 | fOriginalTimestamp = originalTS; |
57 | fEffectiveTimestamp = effectiveTS; | |
58 | fSource = source; | |
59 | fType = type; | |
60 | fContent = content; | |
61 | fReference = reference; | |
62 | } | |
63 | ||
64 | /** | |
65 | * @param timestamp | |
66 | * @param source | |
67 | * @param type | |
68 | * @param content | |
69 | * @param reference | |
70 | */ | |
71 | public TmfEvent(TmfTimestamp timestamp, TmfEventSource source, | |
72 | TmfEventType type, TmfEventContent content, TmfEventReference reference) | |
73 | { | |
74 | fOriginalTimestamp = fEffectiveTimestamp = timestamp; | |
4ab33d2b AO |
75 | fSource = source; |
76 | fType = type; | |
77 | fContent = content; | |
78 | fReference = reference; | |
8c8bf09f ASL |
79 | } |
80 | ||
4ab33d2b | 81 | // ======================================================================== |
8c8bf09f | 82 | // Accessors |
4ab33d2b | 83 | // ======================================================================== |
8c8bf09f ASL |
84 | |
85 | /** | |
4ab33d2b | 86 | * @return |
8c8bf09f ASL |
87 | */ |
88 | public TmfTimestamp getTimestamp() { | |
1f506a43 FC |
89 | return fEffectiveTimestamp; |
90 | } | |
91 | ||
92 | /** | |
93 | * @return | |
94 | */ | |
95 | public TmfTimestamp getOriginalTimestamp() { | |
96 | return fOriginalTimestamp; | |
8c8bf09f ASL |
97 | } |
98 | ||
99 | /** | |
4ab33d2b | 100 | * @return |
8c8bf09f ASL |
101 | */ |
102 | public TmfEventSource getSource() { | |
103 | return fSource; | |
104 | } | |
105 | ||
106 | /** | |
4ab33d2b | 107 | * @return |
8c8bf09f ASL |
108 | */ |
109 | public TmfEventType getType() { | |
110 | return fType; | |
111 | } | |
112 | ||
113 | /** | |
4ab33d2b | 114 | * @return |
8c8bf09f ASL |
115 | */ |
116 | public TmfEventContent getContent() { | |
117 | return fContent; | |
118 | } | |
119 | ||
120 | /** | |
4ab33d2b | 121 | * @return |
8c8bf09f ASL |
122 | */ |
123 | public TmfEventReference getReference() { | |
124 | return fReference; | |
125 | } | |
1f506a43 | 126 | |
8c8bf09f | 127 | } |