| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| POMEvent |
|
| 1.0;1 |
| 1 | /* | |
| 2 | Copyright (C) 2007 Grid Systems, S.A. | |
| 3 | ||
| 4 | This library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | This library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with this library; if not, write to the Free Software | |
| 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 17 | */ | |
| 18 | package nextgrid.api.pem; | |
| 19 | ||
| 20 | import nextgrid.api.pom.Process; | |
| 21 | ||
| 22 | /** | |
| 23 | * Encapsulates the information common to all POM events. | |
| 24 | * | |
| 25 | * @author Rodrigo Ruiz | |
| 26 | */ | |
| 27 | public abstract class POMEvent { | |
| 28 | ||
| 29 | /** | |
| 30 | * The process being discovered. | |
| 31 | */ | |
| 32 | private final Process process; | |
| 33 | ||
| 34 | /** | |
| 35 | * Event creation timestamp. | |
| 36 | */ | |
| 37 | private final long timestamp; | |
| 38 | ||
| 39 | /** | |
| 40 | * Creates an instance. | |
| 41 | * | |
| 42 | * @param process The process this event relates to | |
| 43 | */ | |
| 44 | 0 | public POMEvent(Process process) { |
| 45 | 0 | this.process = process; |
| 46 | 0 | this.timestamp = System.currentTimeMillis(); |
| 47 | 0 | } |
| 48 | ||
| 49 | /** | |
| 50 | * Gets the value of process. | |
| 51 | * | |
| 52 | * @return the process | |
| 53 | */ | |
| 54 | public final Process getProcess() { | |
| 55 | 0 | return this.process; |
| 56 | } | |
| 57 | ||
| 58 | /** | |
| 59 | * Gets the value of timestamp. | |
| 60 | * | |
| 61 | * @return the timestamp | |
| 62 | */ | |
| 63 | public final long getTimestamp() { | |
| 64 | 0 | return this.timestamp; |
| 65 | } | |
| 66 | ||
| 67 | } |