1   /**
2    * Copyright (c) 2000-2008 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_UNREGISTER = "UNREGISTER";
53  
54      public SchedulerRequest() {
55      }
56  
57      public SchedulerRequest(String command) {
58          _command = command;
59      }
60  
61      public SchedulerRequest(
62          String command, String jobName, String groupName) {
63  
64          _command = command;
65          _jobName = jobName;
66          _groupName = groupName;
67      }
68  
69      public SchedulerRequest(
70          String command, String jobName, String groupName, String cronText,
71          Date startDate, Date endDate, String description, String destination,
72          String messageBody) {
73  
74          _command = command;
75          _jobName = jobName;
76          _groupName = groupName;
77          _cronText = cronText;
78          _startDate = startDate;
79          _endDate = endDate;
80          _description = description;
81          _destination = destination;
82          _messageBody = messageBody;
83      }
84  
85      public String getCommand() {
86          return _command;
87      }
88  
89      public void setCommand(String command) {
90          _command = command;
91      }
92  
93      public String getJobName() {
94          return _jobName;
95      }
96  
97      public void setJobName(String jobName) {
98          _jobName = jobName;
99      }
100 
101     public String getGroupName() {
102         return _groupName;
103     }
104 
105     public void setGroupName(String groupName) {
106         _groupName = groupName;
107     }
108 
109     public String getCronText() {
110         return _cronText;
111     }
112 
113     public void setCronText(String cronText) {
114         _cronText = cronText;
115     }
116 
117     public Date getStartDate() {
118         return _startDate;
119     }
120 
121     public void setStartDate(Date startDate) {
122         _startDate = startDate;
123     }
124 
125     public Date getEndDate() {
126         return _endDate;
127     }
128 
129     public void setEndDate(Date endDate) {
130         _endDate = endDate;
131     }
132 
133     public String getDescription() {
134         return _description;
135     }
136 
137     public void setDescription(String description) {
138         _description = description;
139     }
140 
141     public String getDestination() {
142         return _destination;
143     }
144 
145     public void setDestination(String destination) {
146         _destination = destination;
147     }
148 
149     public String getMessageBody() {
150         return _messageBody;
151     }
152 
153     public void setMessageBody(String messageBody) {
154         _messageBody = messageBody;
155     }
156 
157     private String _command;
158     private String _jobName;
159     private String _groupName;
160     private String _cronText;
161     private Date _startDate;
162     private Date _endDate;
163     private String _description;
164     private String _destination;
165     private String _messageBody;
166 
167 }