org.opencastproject.job.api.Job.getParentJobId()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.opencastproject.job.api.Job.getParentJobId()方法的一些代码示例,展示了Job.getParentJobId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.getParentJobId()方法的具体详情如下:
包路径:org.opencastproject.job.api.Job
类名称:Job
方法名:getParentJobId

Job.getParentJobId介绍

[英]Gets the parent job identifier, or null if there is no parent.
[中]获取父作业标识符,如果没有父作业标识符,则为null。

代码示例

代码示例来源:origin: opencast/opencast

@Override
public void removeParentlessJobs(int lifetime) throws ServiceRegistryException {
 synchronized (jobs) {
  for (String serializedJob : jobs.values()) {
   Job job = null;
   try {
    job = JobParser.parseJob(serializedJob);
   } catch (IOException e) {
    throw new IllegalStateException("Error unmarshaling job", e);
   }
   Long parentJobId = job.getParentJobId();
   if (parentJobId == null | parentJobId < 1)
    jobs.remove(job.getId());
  }
 }
}

代码示例来源:origin: opencast/opencast

throw new IllegalStateException("Error unmarshaling job", e);
if (job.getParentJobId() == null)
 continue;
if (job.getParentJobId().equals(id) || job.getRootJobId().equals(id))
 result.add(job);
Long parentJobId = job.getParentJobId();
while (parentJobId != null && parentJobId > 0) {
 try {
  Job parentJob = getJob(job.getParentJobId());
  if (parentJob.getParentJobId().equals(id)) {
   result.add(job);
   break;
  parentJobId = parentJob.getParentJobId();
 } catch (NotFoundException e) {
  throw new ServiceRegistryException("Job from parent job id was not found!", e);

代码示例来源:origin: opencast/opencast

private List<IncidentTree> getChildIncidents(long jobId) throws NotFoundException, ServiceRegistryException,
    IncidentServiceException {
 List<Job> childJobs = getServiceRegistry().getChildJobs(jobId);
 List<IncidentTree> incidentResults = new ArrayList<IncidentTree>();
 for (Job childJob : childJobs) {
  if (childJob.getParentJobId() != jobId)
   continue;
  List<Incident> incidentsForJob = getIncidentsOfJob(childJob.getId());
  IncidentTree incidentTree = new IncidentTreeImpl(incidentsForJob, getChildIncidents(childJob.getId()));
  if (hasIncidents(Collections.list(incidentTree)))
   incidentResults.add(incidentTree);
 }
 return incidentResults;
}

代码示例来源:origin: opencast/opencast

public JaxbJob(Job job) {
 this();
 this.id = job.getId();
 this.dateCompleted = job.getDateCompleted();
 this.dateCreated = job.getDateCreated();
 this.dateStarted = job.getDateStarted();
 this.queueTime = job.getQueueTime();
 this.runTime = job.getRunTime();
 this.version = job.getVersion();
 this.payload = job.getPayload();
 this.processingHost = job.getProcessingHost();
 this.createdHost = job.getCreatedHost();
 this.id = job.getId();
 this.jobType = job.getJobType();
 this.operation = job.getOperation();
 if (job.getArguments() != null)
  this.arguments = unmodifiableList(job.getArguments());
 this.status = job.getStatus();
 this.parentJobId = job.getParentJobId();
 this.rootJobId = job.getRootJobId();
 this.dispatchable = job.isDispatchable();
 this.uri = job.getUri();
 this.creator = job.getCreator();
 this.organization = job.getOrganization();
 this.jobLoad = job.getJobLoad();
 if (job.getBlockedJobIds() != null)
  this.blockedJobIds = unmodifiableList(job.getBlockedJobIds());
 this.blockingJobId = job.getBlockingJobId();
}

代码示例来源:origin: opencast/opencast

public static JpaJob from(Job job) {
 JpaJob newJob = new JpaJob();
 newJob.id = job.getId();
 newJob.dateCompleted = job.getDateCompleted();
 newJob.dateCreated = job.getDateCreated();
 newJob.dateStarted = job.getDateStarted();
 newJob.queueTime = job.getQueueTime();
 newJob.runTime = job.getRunTime();
 newJob.version = job.getVersion();
 newJob.payload = job.getPayload();
 newJob.jobType = job.getJobType();
 newJob.operation = job.getOperation();
 newJob.arguments = job.getArguments();
 newJob.status = job.getStatus().ordinal();
 newJob.parentJobId = job.getParentJobId();
 newJob.rootJobId = job.getRootJobId();
 newJob.dispatchable = job.isDispatchable();
 newJob.uri = job.getUri();
 newJob.creator = job.getCreator();
 newJob.organization = job.getOrganization();
 newJob.jobLoad = job.getJobLoad();
 newJob.blockedJobIds = job.getBlockedJobIds();
 newJob.blockingJobId = job.getBlockingJobId();
 return newJob;
}

相关文章