Package ch.hortis.sonar.service

Examples of ch.hortis.sonar.service.SnapshotGroupService


    LOG.debug("Processing job " + this.getClass().getName());
    if (getProjectService() == null) {
      setProjectService(new MavenProjectService(getEntityManager()));
    }
    if (getSnapshotGroupService() == null) {
      setSnapshotGroupService(new SnapshotGroupService(getEntityManager()));
    }

    long startTime = System.currentTimeMillis();
    LOG.debug("Calling getGroupsToProcess()");
    Collection<SnapshotGroup> groups = getGroupsToProcess();
View Full Code Here


  public void execute() {
    long startTime = System.currentTimeMillis();
    Collection<SnapshotGroup> groups = getGroupsToProcess();
    int processed = 0;
    MavenProjectService projectService = new MavenProjectService(getEntityManager());
    SnapshotGroupService snapshotGroupService = new SnapshotGroupService(getEntityManager());
    for (Iterator<SnapshotGroup> i = groups.iterator(); i.hasNext();) {
      SnapshotGroup group = i.next();
      if (!snapshotGroupService.isReadyToCalculateMeasures(group, projectService)) {
        i.remove();
      }
    }
    // removing all references to snaphsots from the entitymanager VERY important to clean memory
    createNewEntityManager();
View Full Code Here

  public void execute() {
    long startTime = System.currentTimeMillis();
    Collection<SnapshotGroup> groups = getGroupsToProcess();
    int processed = 0;
    MavenProjectService projectService = new MavenProjectService(getEntityManager());
    SnapshotGroupService snapshotGroupService = new SnapshotGroupService(getEntityManager());
    for (Iterator<SnapshotGroup> i = groups.iterator(); i.hasNext();) {
      SnapshotGroup group = i.next();
      if (!snapshotGroupService.isReadyToCalculateMeasures(group, projectService)) {
        i.remove();
      }
    }
    // removing all references to snaphsots from the entitymanager VERY important to clean memory
    createNewEntityManager();
View Full Code Here

          snapshotGroup = manager.find(SnapshotGroup.class, groupId);
          if (snapshotGroup == null) {
            throw new NoResultException();
          }
        } else {
          SnapshotGroupService service = new SnapshotGroupService(manager);
          MavenProject parent = sonarProject.getParent();
          int maxDept = 100;
          while (maxDept > 0) {
            if (parent.getParent() == null) {
              break;
            }
            parent = parent.getParent();
            maxDept--;
          }
          // look for the last snapshot group created within the last 60 mins
          snapshotGroup = service.getLastUnprocessedGroup(parent.getId(), (long) 60 * 60 * 1000, runDate.getTime());
        }
      }

    } catch (NoResultException e) {
      throw new MojoExecutionException("Unable to find the last snapshot group");
View Full Code Here

    manager.getTransaction().commit();
    triggerMeasureCalculation(snapshotGroup);
  }

  private void triggerMeasureCalculation(SnapshotGroup snapshotGroup) throws MojoExecutionException {
    SnapshotGroupService snapshotGroupService = new SnapshotGroupService(manager);
    manager.refresh(snapshotGroup);
    if (snapshotGroupService.isReadyToCalculateMeasures(snapshotGroup, null)) {
      try {
        webInterfaceService.triggerMeasuresCalculations();
      } catch (IOException e) {
        throw new MojoExecutionException("Error occured when triggering measures calculation job on remote server", e);
      }
View Full Code Here

          snapshotGroup = manager.find(SnapshotGroup.class, groupId);
          if (snapshotGroup == null) {
            throw new NoResultException();
          }
        } else {
          SnapshotGroupService service = new SnapshotGroupService(manager);
          MavenProject parent = sonarProject.getParent();
          int maxDept = 100;
          while (maxDept > 0) {
            if (parent.getParent() == null) {
              break;
            }
            parent = parent.getParent();
            maxDept--;
          }
          // look for the last snapshot group created within the last 60 mins
          snapshotGroup = service.getLastUnprocessedGroup(parent.getId(), (long) 60 * 60 * 1000, runDate.getTime());
        }
      }

    } catch (NoResultException e) {
      throw new MojoExecutionException("Unable to find the last snapshot group");
View Full Code Here

          snapshotGroup = manager.find(SnapshotGroup.class, groupId);
          if (snapshotGroup == null) {
            throw new NoResultException();
          }
        } else {
          SnapshotGroupService service = new SnapshotGroupService(manager);
          MavenProject parent = sonarProject.getParent();
          int maxDept = 100;
          while (maxDept > 0) {
            if (parent.getParent() == null) {
              break;
            }
            parent = parent.getParent();
            maxDept--;
          }
          // look for the last snapshot group created within the last 60 mins
          snapshotGroup = service.getLastUnprocessedGroup(parent.getId(), (long) 60 * 60 * 1000, runDate.getTime());
        }
      }

    } catch (NoResultException e) {
      throw new MojoExecutionException("Unable to find the last snapshot group");
View Full Code Here

    manager.getTransaction().commit();
    triggerMeasureCalculation(snapshotGroup);
  }

  private void triggerMeasureCalculation(SnapshotGroup snapshotGroup) throws MojoExecutionException {
    SnapshotGroupService snapshotGroupService = new SnapshotGroupService(manager);
    manager.refresh(snapshotGroup);
    if (snapshotGroupService.isReadyToCalculateMeasures(snapshotGroup, null)) {
      try {
        webInterfaceService.triggerMeasuresCalculations();
      } catch (IOException e) {
        throw new MojoExecutionException("Error occured when triggering measures calculation job on remote server", e);
      }
View Full Code Here

          snapshotGroup = manager.find(SnapshotGroup.class, groupId);
          if (snapshotGroup == null) {
            throw new NoResultException();
          }
        } else {
          SnapshotGroupService service = new SnapshotGroupService(manager);
          MavenProject parent = sonarProject.getParent();
          int maxDept = 100;
          while (maxDept > 0) {
            if (parent.getParent() == null) {
              break;
            }
            parent = parent.getParent();
            maxDept--;
          }
          // look for the last snapshot group created within the last 60 mins
          snapshotGroup = service.getLastUnprocessedGroup(parent.getId(), (long) 60 * 60 * 1000, runDate.getTime());
        }
      }

    } catch (NoResultException e) {
      throw new MojoExecutionException("Unable to find the last snapshot group");
View Full Code Here

    triggerMeasureCalculation(snapshotGroup);
  }

  private void triggerMeasureCalculation(SnapshotGroup snapshotGroup) throws MojoExecutionException {
    SnapshotGroupService snapshotGroupService = new SnapshotGroupService(manager);
    manager.refresh(snapshotGroup);
    if (snapshotGroupService.isReadyToCalculateMeasures(snapshotGroup, null)) {
      try {
        webInterfaceService.triggerMeasuresCalculations();
      } catch (IOException e) {
        throw new MojoExecutionException("Error occured when triggering measures calculation job on remote server", e);
      }
View Full Code Here

TOP

Related Classes of ch.hortis.sonar.service.SnapshotGroupService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.