001: /*
002: * Copyright 2005 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
007: * BI Platform. The Initial Developer is Pentaho Corporation.
008: *
009: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
010: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
011: * the license for the specific language governing your rights and limitations.
012: *
013: * @created Oct 17, 2005
014: * @author James Dixon
015: */
016:
017: package com.pentaho.repository.subscribe;
018:
019: import java.util.Date;
020:
021: public class Schedule {
022: protected static final int ClassVersionNumber = 7;
023:
024: private String id;
025:
026: private String title;
027:
028: private String scheduleReference;
029:
030: private String description;
031:
032: private String cronString;
033:
034: private String group;
035:
036: private Date lastTrigger;
037:
038: private int revision = -1; // Hibernate Revision
039:
040: protected Schedule() {
041: // Needed for Hibernate.
042: }
043:
044: public Schedule(String id, String title, String scheduleRef,
045: String description, String cronString, String group) {
046: this .id = id;
047: this .title = title;
048: this .scheduleReference = scheduleRef;
049: this .description = description;
050: this .cronString = cronString;
051: this .group = group;
052: }
053:
054: public boolean equals(Object other) {
055: if (this == other) {
056: return true;
057: }
058: if (!(other instanceof Schedule)) {
059: return false;
060: }
061: final Schedule that = (Schedule) other;
062: return this .getId().equals(that.getId());
063: }
064:
065: public int hashCode() {
066: return getId().hashCode();
067: }
068:
069: /**
070: * @return Returns the revision.
071: */
072: public int getRevision() {
073: return revision;
074: }
075:
076: /**
077: * @param revision
078: * The revision to set. This is set by Hibernate
079: */
080: protected void setRevision(int revision) {
081: this .revision = revision;
082: }
083:
084: public String getId() {
085: return id;
086: }
087:
088: public String getTitle() {
089: return title;
090: }
091:
092: public String getScheduleReference() {
093: return scheduleReference;
094: }
095:
096: public void setId(String id) {
097: this .id = id;
098: }
099:
100: public void setTitle(String title) {
101: this .title = title;
102: }
103:
104: public void setScheduleReference(String scheduleRef) {
105: this .scheduleReference = scheduleRef;
106: }
107:
108: public String getDescription() {
109: return description;
110: }
111:
112: public void setDescription(String description) {
113: this .description = description;
114: }
115:
116: public String getCronString() {
117: return cronString;
118: }
119:
120: public void setCronString(String cronString) {
121: this .cronString = cronString;
122: }
123:
124: public String getGroup() {
125: return ((group == null) ? "" : group); //$NON-NLS-1$
126: }
127:
128: public void setGroup(String group) {
129: this .group = group;
130: }
131:
132: public Date getLastTrigger() {
133: return lastTrigger;
134: }
135:
136: public void setLastTrigger(Date lastTrigger) {
137: this.lastTrigger = lastTrigger;
138: }
139:
140: }
|