JobKey Class

Quartz.NET 3.0 API Documentation
Uniquely identifies a IJobDetail.
Inheritance Hierarchy

SystemObject
  Quartz.UtilKeyJobKey
    QuartzJobKey

Namespace:  Quartz
Assembly:  Quartz (in Quartz.dll) Version: 3.0.0
Syntax

C#
[SerializableAttribute]
public sealed class JobKey : Key<JobKey>

The JobKey type exposes the following members.

Constructors

  NameDescription
Public methodJobKey(String)
Initializes a new instance of the JobKey class
Public methodJobKey(String, String)
Initializes a new instance of the JobKey class
Top
Properties

  NameDescription
Public propertyGroup

Get the group portion of the key.

(Inherited from KeyT.)
Public propertyName
Get the name portion of the key.
(Inherited from KeyT.)
Top
Methods

  NameDescription
Public methodCompareTo (Inherited from KeyT.)
Public methodStatic memberCreate(String)
Public methodStatic memberCreate(String, String)
Public methodEquals (Inherited from KeyT.)
Public methodGetHashCode (Inherited from KeyT.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString

Return the string representation of the key. The format will be: <group>.<name>.

(Inherited from KeyT.)
Top
Remarks

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 IScheduleBuilder implementations.

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

IJobDetail job = JobBuilder.Create<MyJob>()
    .WithIdentity("myJob")
    .Build();
ITrigger trigger = TriggerBuilder.Create()
    .WithIdentity("myTrigger", "myTriggerGroup")
    .WithSimpleSchedule(x => x
        .WithIntervalInHours(1)
        .RepeatForever())
    .StartAt(DateBuilder.FutureDate(10, IntervalUnit.Minute))
    .Build();
scheduler.scheduleJob(job, trigger);
See Also

Reference