01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2007 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id: Holiday.java 6895 2007-04-18 15:31:19Z mpreston $
23: */
24: package com.bostechcorp.cbesb.runtime.scheduler;
25:
26: import java.text.ParseException;
27: import java.text.SimpleDateFormat;
28: import java.util.Date;
29:
30: import org.apache.commons.logging.Log;
31: import org.apache.commons.logging.LogFactory;
32:
33: public class Holiday {
34:
35: private Log log;
36:
37: private Date date;
38: private String description;
39:
40: public Holiday(Date date, String description) {
41: log = LogFactory.getLog(HolidaySchedule.class);
42: this .date = date;
43: this .description = description;
44: }
45:
46: public Holiday(String dateStr, String description) {
47: log = LogFactory.getLog(HolidaySchedule.class);
48: SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
49: try {
50: this .date = dateFormat.parse(dateStr);
51: } catch (ParseException e) {
52: log.error("Exception occurred while parsing date:", e);
53: }
54: this .description = description;
55: }
56:
57: /**
58: * @return the date
59: */
60: public Date getDate() {
61: return date;
62: }
63:
64: /**
65: * @param date the date to set
66: */
67: public void setDate(Date date) {
68: this .date = date;
69: }
70:
71: /**
72: * @return the description
73: */
74: public String getDescription() {
75: return description;
76: }
77:
78: /**
79: * @param description the description to set
80: */
81: public void setDescription(String description) {
82: this.description = description;
83: }
84:
85: }
|