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