Commits

Anonymous committed 38393a2

Issue number: QUARTZ-220
Obtained from:
Submitted by:
Reviewed by:
CVS: ----------------------------------------------------------------------
CVS: Issue number:
CVS: If this change addresses one or more issues,
CVS: then enter the issue number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to the project by someone else; i.e.,
CVS: they sent us a patch or a set of diffs, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.

git-svn-id: http://svn.opensymphony.com/svn/quartz/trunk@15969f7d36a-ea1c-0410-88ea-9fd03e4c9665

  • Participants
  • Parent commits 38bd7df

Comments (0)

Files changed (5)

 .settings
 .eclipse*
 .eclipse_build
+NOTES

File src/java/org/quartz/JobDetail.java

      * the default settings of all the other properties.
      * </p>
      * 
+     * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
+     * 
      * @exception IllegalArgumentException
-     *              if name, group or jobClass are null or empty.
+     *              if nameis null or empty, or the group is an empty string.
      */
     public JobDetail(String name, String group, Class jobClass) {
         setName(name);
      * the given settings of all the other properties.
      * </p>
      * 
+     * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
+     * 
      * @exception IllegalArgumentException
-     *              if name or group are null or empty.
+     *              if nameis null or empty, or the group is an empty string.
      */
     public JobDetail(String name, String group, Class jobClass,
             boolean volatility, boolean durability, boolean recover) {
      * Set the group of this <code>Job</code>.
      * </p>
      * 
+     * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
+     * 
      * @exception IllegalArgumentException
-     *              if group is null or empty.
+     *              if the group is an empty string.
      */
     public void setGroup(String group) {
-        if (group == null || group.trim().length() == 0)
+        if (group != null && group.trim().length() == 0)
                 throw new IllegalArgumentException(
                         "Group name cannot be empty.");
 
+        if(group == null)
+            group = Scheduler.DEFAULT_GROUP;
+        
         this.group = group;
     }
 

File src/java/org/quartz/SimpleTrigger.java

  * @see CronTrigger
  * @see TriggerUtils
  * 
- * @author James House, with contributions by Lieven Govaerts of Ebitec Nv,
- *         Belgium.
+ * @author James House
+ * @author contributions by Lieven Govaerts of Ebitec Nv, Belgium.
  */
 public class SimpleTrigger extends Trigger {
 

File src/java/org/quartz/Trigger.java

      * can be placed into a {@link Scheduler}.
      * </p>
      * 
+     * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
+     * 
      * @exception IllegalArgumentException
-     *              if name or group are null or empty.
+     *              if name is null or empty, or the group is an empty string.
      */
     public Trigger(String name, String group) {
         setName(name);
      * Create a <code>Trigger</code> with the given name, and group.
      * </p>
      * 
+     * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
+     * 
      * @exception IllegalArgumentException
-     *              if name or group of the <code>Trigger</code> or <code>{@link org.quartz.JobDetail}</code>
-     *              are null or empty.
+     *              if nameis null or empty, or the group is an empty string.
      */
     public Trigger(String name, String group, String jobName, String jobGroup) {
         setName(name);
 
     /**
      * <p>
-     * Set the name of this <code>Trigger</code>.
+     * Set the name of this <code>Trigger</code>. 
      * </p>
      * 
+     * @param group if <code>null</code>, Scheduler.DEFAULT_GROUP will be used.
+     * 
      * @exception IllegalArgumentException
-     *              if group is null or empty.
+     *              if group is an empty string.
      */
     public void setGroup(String group) {
-        if (group == null || group.trim().length() == 0)
+        if (group != null && group.trim().length() == 0)
                 throw new IllegalArgumentException(
-                        "Group name cannot be null or empty.");
+                        "Group name cannot be an empty string.");
 
+        if(group == null)
+            group = Scheduler.DEFAULT_GROUP;
+        
         this.group = group;
     }
 

File src/java/org/quartz/core/QuartzScheduler.java

             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         return resources.getJobStore().removeJob(ctxt, jobName, groupName);
     }
 
             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         if (resources.getJobStore().removeTrigger(ctxt, triggerName, groupName)) {
             notifySchedulerThread();
             notifySchedulerListenersUnschduled(triggerName, groupName);
             String groupName, Trigger newTrigger) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+
         newTrigger.validate();
 
         Calendar cal = null;
             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         Trigger trig = new org.quartz.SimpleTrigger(newTriggerId(),
                 Scheduler.DEFAULT_MANUAL_TRIGGERS, jobName, groupName,
                 new Date(), null, 0, 0);
             String jobName, String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         Trigger trig = new org.quartz.SimpleTrigger(newTriggerId(),
                 Scheduler.DEFAULT_MANUAL_TRIGGERS, jobName, groupName,
                 new Date(), null, 0, 0);
             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         resources.getJobStore().pauseTrigger(ctxt, triggerName, groupName);
         notifySchedulerThread();
         notifySchedulerListenersPausedTrigger(triggerName, groupName);
             throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         resources.getJobStore().pauseTriggerGroup(ctxt, groupName);
         notifySchedulerThread();
         notifySchedulerListenersPausedTrigger(null, groupName);
             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+
         resources.getJobStore().pauseJob(ctxt, jobName, groupName);
         notifySchedulerThread();
         notifySchedulerListenersPausedJob(jobName, groupName);
             throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         resources.getJobStore().pauseJobGroup(ctxt, groupName);
         notifySchedulerThread();
         notifySchedulerListenersPausedJob(null, groupName);
             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         resources.getJobStore().resumeTrigger(ctxt, triggerName, groupName);
         notifySchedulerThread();
         notifySchedulerListenersResumedTrigger(triggerName, groupName);
             throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         resources.getJobStore().resumeTriggerGroup(ctxt, groupName);
         notifySchedulerThread();
         notifySchedulerListenersResumedTrigger(null, groupName);
             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         resources.getJobStore().resumeJob(ctxt, jobName, groupName);
         notifySchedulerThread();
         notifySchedulerListenersResumedJob(jobName, groupName);
             throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         resources.getJobStore().resumeJobGroup(ctxt, groupName);
         notifySchedulerThread();
         notifySchedulerListenersResumedJob(null, groupName);
             throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         return resources.getJobStore().getJobNames(ctxt, groupName);
     }
 
             String groupName) throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         return resources.getJobStore().getTriggersForJob(ctxt, jobName,
                 groupName);
     }
             throws SchedulerException {
         validateState();
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         return resources.getJobStore().getTriggerNames(ctxt, groupName);
     }
 
             String jobGroup) throws SchedulerException {
         validateState();
 
+        if(jobGroup == null)
+            jobGroup = Scheduler.DEFAULT_GROUP;
+        
         return resources.getJobStore().retrieveJob(ctxt, jobName, jobGroup);
     }
 
             String triggerGroup) throws SchedulerException {
         validateState();
 
+        if(triggerGroup == null)
+            triggerGroup = Scheduler.DEFAULT_GROUP;
+        
         return resources.getJobStore().retrieveTrigger(ctxt, triggerName,
                 triggerGroup);
     }
             String triggerGroup) throws SchedulerException {
         validateState();
 
+        if(triggerGroup == null)
+            triggerGroup = Scheduler.DEFAULT_GROUP;
+        
         return resources.getJobStore().getTriggerState(ctxt, triggerName,
                 triggerGroup);
     }
      */
     public boolean interrupt(SchedulingContext ctxt, String jobName, String groupName) throws UnableToInterruptJobException {
 
+        if(groupName == null)
+            groupName = Scheduler.DEFAULT_GROUP;
+        
         List jobs = getCurrentlyExecutingJobs();
         java.util.Iterator it = jobs.iterator();