| CronTrigger.java |
1 /**
2 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
7 * any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 */
14
15 package com.liferay.portal.kernel.scheduler;
16
17 import com.liferay.portal.kernel.util.StringBundler;
18
19 import java.util.Date;
20
21 /**
22 * <a href="CronTrigger.java.html"><b><i>View Source</i></b></a>
23 *
24 * @author Shuyang Zhou
25 */
26 public class CronTrigger extends BaseTrigger {
27
28 public CronTrigger(String jobName, String groupName, String cronText) {
29 this(jobName, groupName, new Date(), null, cronText);
30 }
31
32 public CronTrigger(
33 String jobName, String groupName, Date startDate, String cronText) {
34
35 this(jobName, groupName, startDate, null, cronText);
36 }
37
38 public CronTrigger(
39 String jobName, String groupName, Date startDate, Date endDate,
40 String cronText) {
41
42 super(jobName, groupName, TriggerType.CRON, startDate, endDate);
43
44 _cronText = cronText;
45 }
46
47 public String getTriggerContent() {
48 return _cronText;
49 }
50
51 public String toString() {
52 StringBundler sb = new StringBundler(5);
53
54 sb.append("{cronText=");
55 sb.append(_cronText);
56 sb.append(", ");
57 sb.append(super.toString());
58 sb.append("}");
59
60 return sb.toString();
61 }
62
63 private String _cronText;
64
65 }