コード例 #1
0
 public void buildingBuildInstance(Stage stage) {
   if (!stage.getJobInstances().isEmpty()) {
     JobInstance jobInstance = stage.getJobInstances().get(0);
     jobInstance.setAgentUuid(AGENT_UUID);
     jobInstance.changeState(JobState.Building);
     jobInstanceDao.updateAssignedInfo(jobInstance);
   }
 }
コード例 #2
0
 public Stage saveBuildingStage(Stage stage) {
   for (JobInstance jobInstance : stage.getJobInstances()) {
     JobInstanceMother.setBuildingState(jobInstance);
     jobInstance.setAgentUuid(AGENT_UUID);
     jobInstanceDao.updateAssignedInfo(jobInstance);
   }
   return stage;
 }
コード例 #3
0
 public StageResult completeAllJobs(Stage stage, JobResult jobResult) {
   for (JobInstance job : stage.getJobInstances()) {
     JobInstanceMother.setBuildingState(job);
     job.setAgentUuid(AGENT_UUID);
     job.completing(jobResult);
     job.completed(new DateTime().plusMinutes(5).toDate());
     jobInstanceDao.updateAssignedInfo(job);
   }
   StageResult stageResult;
   switch (jobResult) {
     case Failed:
       stageResult = StageResult.Failed;
       break;
     case Cancelled:
       stageResult = StageResult.Cancelled;
       break;
     default:
       stageResult = StageResult.Passed;
   }
   stage.calculateResult();
   return stageResult;
 }
コード例 #4
0
 public void assignToAgent(JobInstance jobInstance, String agentId) {
   jobInstance.setAgentUuid(agentId);
   jobInstance.changeState(JobState.Assigned);
   jobInstanceDao.updateAssignedInfo(jobInstance);
 }