public SetJobsRetriesCmd(IList <string> jobIds, int retries) { EnsureUtil.ensureNotEmpty("Job ID's", jobIds); EnsureUtil.ensureGreaterThanOrEqual("Retries count", retries, 0); this.jobIds = jobIds; this.retries = retries; }
protected internal virtual void validateInput() { EnsureUtil.ensureNotNull("workerId", workerId); EnsureUtil.ensureGreaterThanOrEqual("maxResults", maxResults, 0); foreach (TopicFetchInstruction instruction in fetchInstructions.Values) { EnsureUtil.ensureNotNull("topicName", instruction.TopicName); EnsureUtil.ensurePositive("lockTime", instruction.LockDuration); } }
public override Batch execute(CommandContext commandContext) { IList <string> jobIds = collectJobIds(commandContext); ensureNotEmpty(typeof(BadUserRequestException), "jobIds", jobIds); EnsureUtil.ensureGreaterThanOrEqual("Retries count", retries, 0); checkAuthorizations(commandContext, BatchPermissions.CREATE_BATCH_SET_JOB_RETRIES); writeUserOperationLog(commandContext, retries, jobIds.Count, true); BatchEntity batch = createBatch(commandContext, jobIds); batch.createSeedJobDefinition(); batch.createMonitorJobDefinition(); batch.createBatchJobDefinition(); batch.fireHistoricStartEvent(); batch.createSeedJob(); return(batch); }
protected internal override void validateInput() { EnsureUtil.ensureGreaterThanOrEqual(typeof(BadUserRequestException), "The number of retries cannot be negative", "retries", retries, 0); }