View Javadoc

1   /*
2    * Copyright (C) 2008 ETH Zurich
3    *
4    * This file is part of Fosstrak (www.fosstrak.org).
5    *
6    * Fosstrak is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License version 2.1, as published by the Free Software Foundation.
9    *
10   * Fosstrak is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13   * Lesser General Public License for more details.
14   *
15   * You should have received a copy of the GNU Lesser General Public
16   * License along with Fosstrak; if not, write to the Free
17   * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18   * Boston, MA  02110-1301  USA
19   */
20  
21  package org.fosstrak.epcis.repository.model;
22  
23  import java.sql.Timestamp;
24  import java.util.Calendar;
25  
26  /**
27   * An EPCISEvent as defined in section 7.2.8 of the spec.
28   * 
29   * @author Marco Steybe
30   */
31  public abstract class EPCISEvent {
32  
33      private Timestamp eventTime;
34      private long eventTimeMs;
35      private Timestamp recordTime;
36      private long recordTimeMs;
37      private String eventTimeZoneOffset;
38  
39      public void setEventTime(Calendar eventTime) {
40          this.eventTime = new Timestamp(eventTime.getTimeInMillis());
41          this.eventTimeMs = eventTime.getTimeInMillis();
42      }
43  
44      public void setRecordTime(Calendar recordTime) {
45          this.recordTime = new Timestamp(recordTime.getTimeInMillis());
46          this.recordTimeMs = recordTime.getTimeInMillis();
47      }
48  
49      public Timestamp getEventTime() {
50          return eventTime;
51      }
52  
53      public void setEventTime(Timestamp eventTime) {
54          this.eventTime = eventTime;
55      }
56  
57      public long getEventTimeMs() {
58          return eventTimeMs;
59      }
60  
61      public void setEventTimeMs(long eventTimeMs) {
62          this.eventTimeMs = eventTimeMs;
63      }
64  
65      public Timestamp getRecordTime() {
66          return recordTime;
67      }
68  
69      public void setRecordTime(Timestamp recordTime) {
70          this.recordTime = recordTime;
71      }
72  
73      public long getRecordTimeMs() {
74          return recordTimeMs;
75      }
76  
77      public void setRecordTimeMs(long recordTimeMs) {
78          this.recordTimeMs = recordTimeMs;
79      }
80  
81      public String getEventTimeZoneOffset() {
82          return eventTimeZoneOffset;
83      }
84  
85      public void setEventTimeZoneOffset(String eventTimeZoneOffset) {
86          this.eventTimeZoneOffset = eventTimeZoneOffset;
87      }
88  }