Esempio n. 1
0
 private void updateJsonJob(ApplicationInfo appInfo, CIJob job) throws PhrescoException {
   try {
     deleteJsonJobs(appInfo, Arrays.asList(job));
     writeJsonJobs(appInfo, Arrays.asList(job), CI_APPEND_JOBS);
   } catch (Exception e) {
     throw new PhrescoException(e);
   }
 }
 public static void merge(
     final LayerVisibility v1,
     final LayerVisibility v2,
     final TShortObjectHashMap<short[]> layerByGroups) {
   for (int i = 0; i < v1.size(); ++i) {
     final short[] layers = v1.getQuickValue(i);
     if (Arrays.binarySearch(layers, (short) 0) >= 0) {
       final short layer = v1.getQuickKey(i);
       final TShortHashSet set = new TShortHashSet(layerByGroups.get(layer));
       set.addAll(v2.getVisibleFromOutdoor());
       final short[] added = set.toArray();
       Arrays.sort(added);
       layerByGroups.put(layer, added);
     }
   }
 }
Esempio n. 3
0
 public void createJob(ApplicationInfo appInfo, CIJob job) throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug(
         "Entering Method ProjectAdministratorImpl.createJob(Project project, CIJob job)");
   }
   FileWriter writer = null;
   try {
     CIJobStatus jobStatus = configureJob(job, FrameworkConstants.CI_CREATE_JOB_COMMAND);
     if (jobStatus.getCode() == -1) {
       throw new PhrescoException(jobStatus.getMessage());
     }
     if (debugEnabled) {
       S_LOGGER.debug("ProjectInfo = " + appInfo);
     }
     writeJsonJobs(appInfo, Arrays.asList(job), CI_APPEND_JOBS);
   } catch (ClientHandlerException ex) {
     if (debugEnabled) {
       S_LOGGER.error(ex.getLocalizedMessage());
     }
     throw new PhrescoException(ex);
   } finally {
     if (writer != null) {
       try {
         writer.close();
       } catch (IOException e) {
         S_LOGGER.error(e.getLocalizedMessage());
       }
     }
   }
 }
Esempio n. 4
0
 public CIJobStatus deleteJobs(ApplicationInfo appInfo, List<String> jobNames)
     throws PhrescoException {
   S_LOGGER.debug("Entering Method ProjectAdministratorImpl.deleteCI()");
   try {
     CIJobStatus deleteCI = null;
     for (String jobName : jobNames) {
       S_LOGGER.debug(" Deleteable job name " + jobName);
       CIJob ciJob = getJob(appInfo, jobName);
       // job and build numbers
       deleteCI = deleteCI(ciJob, null);
       S_LOGGER.debug("write back json data after job deletion successfull");
       deleteJsonJobs(appInfo, Arrays.asList(ciJob));
     }
     return deleteCI;
   } catch (ClientHandlerException ex) {
     S_LOGGER.error(
         "Entered into catch block of ProjectAdministratorImpl.deleteCI()"
             + ex.getLocalizedMessage());
     throw new PhrescoException(ex);
   }
 }
Esempio n. 5
0
 private boolean adaptExistingJobs(ApplicationInfo appInfo) {
   try {
     CIJob existJob = getJob(appInfo);
     S_LOGGER.debug("Going to get existing jobs to relocate!!!!!");
     if (existJob != null) {
       S_LOGGER.debug("Existing job found " + existJob.getName());
       boolean deleteExistJob = deleteCIJobFile(appInfo);
       Gson gson = new Gson();
       List<CIJob> existingJobs = new ArrayList<CIJob>();
       existingJobs.addAll(Arrays.asList(existJob));
       FileWriter writer = null;
       File ciJobFile = new File(getCIJobPath(appInfo));
       String jobJson = gson.toJson(existingJobs);
       writer = new FileWriter(ciJobFile);
       writer.write(jobJson);
       writer.flush();
       S_LOGGER.debug("Existing job moved to new type of project!!");
     }
     return true;
   } catch (Exception e) {
     S_LOGGER.debug("It is already adapted !!!!! ");
   }
   return false;
 }