1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.kernel.scheduler.messaging;
21  
22  import java.io.Serializable;
23  
24  import java.util.Date;
25  
26  /**
27   * <a href="SchedulerRequest.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * A request to schedule a job for the scheduling engine. You may specify the
31   * timing of the job via the cron syntax. See
32   * http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html for a
33   * description of the syntax.
34   * </p>
35   *
36   * @author Michael C. Han
37   * @author Bruno Farache
38   * @author Brian Wing Shun Chan
39   *
40   */
41  public class SchedulerRequest implements Serializable {
42  
43      public static final String COMMAND_REGISTER = "REGISTER";
44  
45      public static final String COMMAND_RETRIEVE = "RETRIEVE";
46  
47      public static final String COMMAND_SHUTDOWN = "SHUTDOWN";
48  
49      public static final String COMMAND_STARTUP = "STARTUP";
50  
51      public static final String COMMAND_UNREGISTER = "UNREGISTER";
52  
53      public SchedulerRequest() {
54      }
55  
56      public SchedulerRequest(String command) {
57          _command = command;
58      }
59  
60      public SchedulerRequest(
61          String command, String jobName, String groupName) {
62  
63          _command = command;
64          _jobName = jobName;
65          _groupName = groupName;
66      }
67  
68      public SchedulerRequest(
69          String command, String jobName, String groupName, String cronText,
70          Date startDate, Date endDate, String description, String destination,
71          String messageBody) {
72  
73          _command = command;
74          _jobName = jobName;
75          _groupName = groupName;
76          _cronText = cronText;
77          _startDate = startDate;
78          _endDate = endDate;
79          _description = description;
80          _destination = destination;
81          _messageBody = messageBody;
82      }
83  
84      public String getCommand() {
85          return _command;
86      }
87  
88      public void setCommand(String command) {
89          _command = command;
90      }
91  
92      public String getJobName() {
93          return _jobName;
94      }
95  
96      public void setJobName(String jobName) {
97          _jobName = jobName;
98      }
99  
100     public String getGroupName() {
101         return _groupName;
102     }
103 
104     public void setGroupName(String groupName) {
105         _groupName = groupName;
106     }
107 
108     public String getCronText() {
109         return _cronText;
110     }
111 
112     public void setCronText(String cronText) {
113         _cronText = cronText;
114     }
115 
116     public Date getStartDate() {
117         return _startDate;
118     }
119 
120     public void setStartDate(Date startDate) {
121         _startDate = startDate;
122     }
123 
124     public Date getEndDate() {
125         return _endDate;
126     }
127 
128     public void setEndDate(Date endDate) {
129         _endDate = endDate;
130     }
131 
132     public String getDescription() {
133         return _description;
134     }
135 
136     public void setDescription(String description) {
137         _description = description;
138     }
139 
140     public String getDestination() {
141         return _destination;
142     }
143 
144     public void setDestination(String destination) {
145         _destination = destination;
146     }
147 
148     public String getMessageBody() {
149         return _messageBody;
150     }
151 
152     public void setMessageBody(String messageBody) {
153         _messageBody = messageBody;
154     }
155 
156     private String _command;
157     private String _jobName;
158     private String _groupName;
159     private String _cronText;
160     private Date _startDate;
161     private Date _endDate;
162     private String _description;
163     private String _destination;
164     private String _messageBody;
165 
166 }