public OperationScheduleComposite(int id, String jobName, String jobGroup, String operationName, long operationNextFireTime) { this.id = id; this.jobId = new JobId(jobName, jobGroup); this.operationName = operationName; this.operationNextFireTime = operationNextFireTime; }
/** * The single job ID which identifies the operation. It can later be parsed via {@link JobId#JobId(String)}. Note * that this job ID only identifies the scheduled operation; it does not identify any specific invocation of that * operation (see {@link HistoryJobId} for that). * * @return job ID */ @XmlElement public JobId getJobId() { return new JobId(this.jobName, this.jobGroup); }
@Override public ResourceOperationSchedule getResourceOperationSchedule(Subject subject, String jobId) throws SchedulerException { JobId jobIdObject = new JobId(jobId); JobDetail jobDetail = scheduler.getJobDetail(jobIdObject.getJobName(), jobIdObject.getJobGroup()); ResourceOperationSchedule resourceOperationSchedule = getResourceOperationSchedule(subject, jobDetail); if (resourceOperationSchedule == null) { throw new SchedulerException("The job with ID [" + jobId + "] is no longer scheduled."); } return resourceOperationSchedule; }
JobId jobId = new JobId(jobName); criteria.addFilterJobId(jobId);
@Override public GroupOperationSchedule getGroupOperationSchedule(Subject subject, String jobId) throws SchedulerException { JobId jobIdObject = new JobId(jobId); JobDetail jobDetail = scheduler.getJobDetail(jobIdObject.getJobName(), jobIdObject.getJobGroup()); GroupOperationSchedule groupOperationSchedule = getGroupOperationSchedule(subject, jobDetail); if (groupOperationSchedule == null) { throw new SchedulerException("The job with ID [" + jobId + "] is no longer scheduled."); } return groupOperationSchedule; }
/** * @return This returns all optional data and should be suitable for modification and subsequent update. */ protected ResourceOperationHistory findOperationHistory(String name, String group, OperationManagerLocal operationManager, ResourceOperationSchedule schedule) { JobId jobId = new JobId(name, group); ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria(); criteria.addFilterJobId(jobId); criteria.fetchOperationDefinition(true); criteria.fetchParameters(true); criteria.fetchResults(true); ResourceOperationHistory history; List<ResourceOperationHistory> list = operationManager.findResourceOperationHistoriesByCriteria( schedule.getSubject(), criteria); if (list == null || list.isEmpty()) { return null; } history = list.get(0); return history; } }
JobId filterJobId; try { filterJobId = new JobId(jobName); } catch (Exception e) {
JobId jobId = new JobId(sched.getJobName(),sched.getJobGroup()); UriBuilder uriBuilder = uriInfo.getBaseUriBuilder(); uriBuilder.path("/operation/history/{id}");
JobId jobId = new JobId(jobName, jobGroup); hist.setJobId(jobId.toString());