KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cowsultants > itracker > ejb > beans > entity > ScheduledTaskBean


1 /*
2  * This software was designed and created by Jason Carroll.
3  * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4  * The author can be reached at jcarroll@cowsultants.com
5  * ITracker website: http://www.cowsultants.com
6  * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it only under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */

18
19 package cowsultants.itracker.ejb.beans.entity;
20
21 import java.util.*;
22 import java.sql.Timestamp JavaDoc;
23
24 import cowsultants.itracker.ejb.client.models.ScheduledTaskModel;
25
26 public abstract class ScheduledTaskBean extends GenericBean {
27
28     public abstract String JavaDoc getHours();
29     public abstract void setHours(String JavaDoc value);
30
31     public abstract String JavaDoc getMinutes();
32     public abstract void setMinutes(String JavaDoc value);
33
34     public abstract String JavaDoc getDaysOfMonth();
35     public abstract void setDaysOfMonth(String JavaDoc value);
36
37     public abstract String JavaDoc getMonths();
38     public abstract void setMonths(String JavaDoc value);
39
40     public abstract String JavaDoc getWeekdays();
41     public abstract void setWeekdays(String JavaDoc value);
42
43     public abstract String JavaDoc getClassName();
44     public abstract void setClassName(String JavaDoc value);
45
46     public abstract String JavaDoc getArgs();
47     public abstract void setArgs(String JavaDoc value);
48
49     public ScheduledTaskModel getModel() {
50         ScheduledTaskModel model = new ScheduledTaskModel();
51         model.setId(this.getId());
52         model.setHours(this.getHours());
53         model.setMinutes(this.getMinutes());
54         model.setDaysOfMonth(this.getDaysOfMonth());
55         model.setMonths(this.getMonths());
56         model.setWeekdays(this.getWeekdays());
57
58         model.setClassName(this.getClassName());
59         model.setArgs(this.getArgs());
60
61         model.setLastModifiedDate(this.getLastModifiedDate());
62         model.setCreateDate(this.getCreateDate());
63
64         return model;
65     }
66
67     public void setModel(ScheduledTaskModel model) {
68         this.setHours(model.joinString(model.getHours()));
69         this.setMinutes(model.joinString(model.getMinutes()));
70         this.setDaysOfMonth(model.joinString(model.getDaysOfMonth()));
71         this.setMonths(model.joinString(model.getMonths()));
72         this.setWeekdays(model.joinString(model.getWeekdays()));
73
74         this.setClassName(model.getClassName());
75         this.setArgs(model.getArgsAsString());
76
77         this.setLastModifiedDate(new Timestamp JavaDoc(new Date().getTime()));
78     }
79
80 }
Popular Tags