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: | |
4ab33d2b | 10 | * Francois Chouinard (fchouinard@gmail.com) - 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> | |
4ab33d2b AO |
18 | * The basic event structure in the TMF. |
19 | * <p> | |
20 | * In its canonical form, an event has: | |
8c8bf09f ASL |
21 | * <ul> |
22 | * <li> a normalized timestamp | |
23 | * <li> a source (reporter) | |
24 | * <li> a type | |
25 | * <li> a content | |
26 | * </ul> | |
27 | * For convenience, a free-form reference field is also provided. It could be | |
28 | * used as e.g. a location marker in the event stream to distinguish between | |
29 | * otherwise identical events. | |
8c8bf09f | 30 | */ |
4ab33d2b | 31 | public class TmfEvent { |
8c8bf09f | 32 | |
4ab33d2b | 33 | // ======================================================================== |
8c8bf09f | 34 | // Attributes |
4ab33d2b | 35 | // ======================================================================== |
8c8bf09f | 36 | |
4ab33d2b AO |
37 | private final TmfTimestamp fTimestamp; |
38 | private final TmfEventSource fSource; | |
39 | private final TmfEventType fType; | |
40 | private final TmfEventContent fContent; | |
41 | private final TmfEventReference fReference; | |
8c8bf09f | 42 | |
4ab33d2b | 43 | // ======================================================================== |
8c8bf09f | 44 | // Constructors |
4ab33d2b | 45 | // ======================================================================== |
8c8bf09f ASL |
46 | |
47 | /** | |
4ab33d2b AO |
48 | * @param timestamp |
49 | * @param source | |
50 | * @param type | |
51 | * @param content | |
52 | * @param reference | |
8c8bf09f | 53 | */ |
4ab33d2b AO |
54 | public TmfEvent(TmfTimestamp timestamp, TmfEventSource source, TmfEventType type, |
55 | TmfEventContent content, TmfEventReference reference) | |
8c8bf09f | 56 | { |
4ab33d2b AO |
57 | fTimestamp = timestamp; |
58 | fSource = source; | |
59 | fType = type; | |
60 | fContent = content; | |
61 | fReference = reference; | |
8c8bf09f ASL |
62 | } |
63 | ||
4ab33d2b | 64 | // ======================================================================== |
8c8bf09f | 65 | // Accessors |
4ab33d2b | 66 | // ======================================================================== |
8c8bf09f ASL |
67 | |
68 | /** | |
4ab33d2b | 69 | * @return |
8c8bf09f ASL |
70 | */ |
71 | public TmfTimestamp getTimestamp() { | |
4ab33d2b | 72 | return fTimestamp; |
8c8bf09f ASL |
73 | } |
74 | ||
75 | /** | |
4ab33d2b | 76 | * @return |
8c8bf09f ASL |
77 | */ |
78 | public TmfEventSource getSource() { | |
79 | return fSource; | |
80 | } | |
81 | ||
82 | /** | |
4ab33d2b | 83 | * @return |
8c8bf09f ASL |
84 | */ |
85 | public TmfEventType getType() { | |
86 | return fType; | |
87 | } | |
88 | ||
89 | /** | |
4ab33d2b | 90 | * @return |
8c8bf09f ASL |
91 | */ |
92 | public TmfEventContent getContent() { | |
93 | return fContent; | |
94 | } | |
95 | ||
96 | /** | |
4ab33d2b | 97 | * @return |
8c8bf09f ASL |
98 | */ |
99 | public TmfEventReference getReference() { | |
100 | return fReference; | |
101 | } | |
8c8bf09f | 102 | } |