Subversion Repositories XServices

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
70 brianR 1
/*
2
 *   Copyright 2011 Brian Rosenberger (Brutex Network)
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16
package net.brutex.xservices.types;
17
 
18
import java.util.GregorianCalendar;
19
 
20
import javax.xml.bind.annotation.XmlAccessType;
21
import javax.xml.bind.annotation.XmlAccessorType;
22
import javax.xml.bind.annotation.XmlElement;
23
import javax.xml.bind.annotation.XmlType;
24
 
25
import net.brutex.xservices.util.BrutexNamespaces;
26
 
27
/**
28
 * Scheduled job type
29
 *
30
 * @author Brian Rosenberger
31
 * @since 0.5.0
32
 *
33
 */
34
@XmlType(namespace=BrutexNamespaces.WS_XSERVICES)
35
@XmlAccessorType(XmlAccessType.FIELD)
36
public class ScheduledJob {
37
 
38
	@XmlElement(required=true,name="name")
39
	private String name;
40
 
41
	@XmlElement(required=false, name="description")
42
	private String description;
43
 
44
	@XmlElement(required=true, name="datetime")
45
	private GregorianCalendar date;
46
 
47
	@XmlElement(name="script")
48
	private String script;
49
 
50
	/**
51
	 * Create a new scheduled job.
52
	 *
53
	 * @param name Job name.
54
	 * @param datetime Scheduled date and time.
55
	 * @param script The script to execute.
56
	 */
57
	public ScheduledJob(String name, GregorianCalendar datetime, String script) {
58
		this.name = name;
59
		this.date = datetime;
60
		this.script = script;
61
		this.description = null;
62
	}
63
 
64
	/**
65
	 * Create a new scheduled job.
66
	 *
67
	 * @param name Job name.
68
	 * @param datetime Scheduled date and time.
69
	 * @param script The script to execute.
70
	 * @param description Job description.
71
	 */
72
	public ScheduledJob(String name, GregorianCalendar datetime, String script, String description) {
73
		this.name = name;
74
		this.date = datetime;
75
		this.script = script;
76
		this.description = description;
77
	}
78
 
79
	/**
80
	 * Create a new scheduled job.
81
	 */
82
	public ScheduledJob() {
83
		this.name = null;
84
		this.date=null;
85
		this.script=null;
86
	}
87
 
88
	/**
89
	 * Set name of the job.
90
	 * @param name
91
	 */
92
	public void setName(String name) {
93
		this.name = name;
94
	}
95
 
96
	/**
97
	 * Get name of the job.
98
	 * @return job name
99
	 */
100
	public String getName() {
101
		return name;
102
	}
103
 
104
	/**
105
	 * Set scheduled date.
106
	 * @param date
107
	 */
108
	public void setDate(GregorianCalendar date) {
109
		this.date = date;
110
	}
111
 
112
	/**
113
	 * get scheduled date.
114
	 * @return date
115
	 */
116
	public GregorianCalendar getDate() {
117
		return date;
118
	}
119
 
120
	public void setScript(String script) {
121
		this.script = script;
122
	}
123
 
124
	public String getScript() {
125
		return script;
126
	}
127
 
128
	public void setDescription(String desc) {
129
		this.description = desc;
130
	}
131
 
132
	public String getDescription() {
133
		return description;
134
	}
135
}