/// <summary>
        /// Creates a job execution context.
        /// </summary>
        /// <param name="scheduler">The scheduler that is managing the job</param>
        /// <param name="logger">The logger to use for logging job progress</param>
        /// <param name="jobSpec">The job's specification</param>
        /// <param name="jobData">The job state data, or null if none</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="scheduler"/>,
        /// <paramref name="logger"/> or <paramref name="jobSpec"/> is null</exception>
        public JobExecutionContext(IScheduler scheduler, ILogger logger, JobSpec jobSpec, JobData jobData)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (jobSpec == null)
            {
                throw new ArgumentNullException("jobSpec");
            }

            this.scheduler = scheduler;
            this.logger    = logger;
            this.jobSpec   = jobSpec;
            this.jobData   = jobData;
        }
        /// <inheritdoc />
        public void UpdateJob(string existingJobName, JobSpec updatedJobSpec)
        {
            if (existingJobName == null)
            {
                throw new ArgumentNullException("existingJobName");
            }
            if (existingJobName.Length == 0)
            {
                throw new ArgumentException("existingJobName");
            }
            if (updatedJobSpec == null)
            {
                throw new ArgumentNullException("updatedJobSpec");
            }

            ThrowIfDisposed();
            ThrowIfNotInitialized();

            jobStore.UpdateJob(existingJobName, updatedJobSpec);
        }
예제 #3
0
 /// <summary>
 /// Creates job details for a newly created job.
 /// </summary>
 /// <param name="jobSpec">The job's specification</param>
 /// <param name="creationTime">The time when the job was created</param>
 /// <param name="version">The version number</param>
 /// <exception cref="ArgumentNullException">Thrown when <paramref name="jobSpec"/> is null</exception>
 public VersionedJobDetails(JobSpec jobSpec, DateTime creationTime, int version)
     : base(jobSpec, creationTime)
 {
     this.version = version;
 }