All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.quartz.TriggerKey Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
/**
 * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 * 
 */
package org.quartz;

import org.quartz.utils.Key;

/**
 * Uniquely identifies a {@link Trigger}.
 * 

* Keys are composed of both a name and group, and the name must be unique within the group. If only a group is specified then the default group name will be used. *

*

* Quartz provides a builder-style API for constructing scheduling-related entities via a Domain-Specific Language (DSL). The DSL can best be utilized through the usage of static imports of the methods on the classes TriggerBuilder, * JobBuilder, DateBuilder, JobKey, TriggerKey and the various ScheduleBuilder implementations. *

*

* Client code can then use the DSL to write code such as this: *

* *
 * 
 * 
 * 
 * 
 * JobDetail job = newJob(MyJob.class).withIdentity("myJob").build();
 * 
 * Trigger trigger = newTrigger().withIdentity(triggerKey("myTrigger", "myTriggerGroup")).withSchedule(simpleSchedule().withIntervalInHours(1).repeatForever()).startAt(futureDate(10, MINUTES)).build();
 * 
 * scheduler.scheduleJob(job, trigger);
 * 
 * 
 * 
 * 
 * @see Trigger
 * @see Key#DEFAULT_GROUP
 */
public final class TriggerKey extends Key {

  public TriggerKey(String name) {

    super(name, null);
  }

  public TriggerKey(String name, String group) {

    super(name, group);
  }

  public static TriggerKey triggerKey(String name) {

    return new TriggerKey(name, null);
  }

  public static TriggerKey triggerKey(String name, String group) {

    return new TriggerKey(name, group);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy