Package uk.ac.bbsrc.tgac.miso.core.data

Examples of uk.ac.bbsrc.tgac.miso.core.data.Run


  @Override
  public void generateResponse(Event event) {
    if (event instanceof RunEvent) {
      RunEvent re = (RunEvent)event;
      Run r = re.getEventObject();
      RunQC lastAdded = null;

      List<RunQC> lqc = new ArrayList<RunQC>(r.getRunQCs());
      if (!lqc.isEmpty()) {
        try {
          Collections.sort(lqc, new DateComparator(RunQC.class, "getQcDate"));
          lastAdded = lqc.get(lqc.size()-1);
        }
        catch (NoSuchMethodException e) {
          log.error("Cannot sort list of run QCs", e);
          e.printStackTrace();
        }
      }

      for (User user : r.getWatchers()) {
        Alert a = new DefaultAlert(user);

        String qcInfo = "";
        String qcType = "";

        if (lastAdded != null) {
          qcType = lastAdded.getQcType().getName()+" ";
          qcInfo = "QC'ed by "+lastAdded.getQcCreator()+ " on " + lastAdded.getQcDate() + " ("+lastAdded.getInformation()+"). ";
        }

        a.setAlertTitle(qcType + "Run QC Added : " + r.getAlias());
        a.setAlertText("The following Run has been QCed: "+r.getAlias()+" ("+event.getEventMessage()+"). "+qcInfo+"Please view Run " +r.getId()+ " in MISO for more information.");

        for (AlerterService as : alerterServices) {
          try {
            as.raiseAlert(a);
          }
View Full Code Here


  @Override
  public boolean respondsTo(Event event) {
    if (event instanceof RunEvent) {
      RunEvent re = (RunEvent)event;
      Run r = re.getEventObject();
      if (re.getEventType().equals(MisoEventType.RUN_FAILED) && r.getStatus() != null && r.getStatus().getHealth().equals(HealthType.Failed)) {
        log.info("Run "+ r.getAlias() +": " + re.getEventMessage());
        return true;
      }
    }
    return false;
  }
View Full Code Here

  @Override
  public void generateResponse(Event event) {
    if (event instanceof RunEvent) {
      RunEvent re = (RunEvent)event;
      Run r = re.getEventObject();

      for (User user : r.getWatchers()) {
        Alert a = new DefaultAlert(user);
        a.setAlertLevel(AlertLevel.CRITICAL);
        a.setAlertTitle("Run Failed: " + r.getAlias());
        a.setAlertText("The following Run has been set to FAILED: "+r.getAlias()+" ("+event.getEventMessage()+"). Please view Run " +r.getId()+ " in MISO for more information");

        for (AlerterService as : alerterServices) {
          try {
            as.raiseAlert(a);
          }
View Full Code Here

  }

  public void push(Run run) {
    if (enabled) {
      if (run != null) {
        Run clone = cloner.deepClone(run);
        if (clone != null) {
          applyListeners(clone);
          if (runs.containsKey(run.getId())) {
            if (clone.getStatus() != null) {
              log.debug("Not replacing Run " + clone.getId() + ": " + clone.getStatus().getHealth().name());
            }
          }
          else {
            runs.put(run.getId(), clone);
            if (clone.getStatus() != null) {
              log.debug("Queued Run " + clone.getId() + ": " + clone.getStatus().getHealth().name());
            }
          }
        }
      }
    }
View Full Code Here

  }

  public void pop(Run run) {
    if (enabled) {
      if (run != null) {
        Run clone = runs.get(run.getId());
        if (clone != null) {
          removeListeners(clone);
          clone = null;
          runs.remove(run.getId());
          log.debug("Dequeued " + run.getId());
View Full Code Here

    return requestManager.getRunById(runId);
  }

  @RequestMapping(value = "{runAlias}/samplesheet", method = RequestMethod.GET)
  public @ResponseBody String getSampleSheetForRun(@PathVariable String runAlias) throws IOException {
    Run r = requestManager.getRunByAlias(runAlias);
    User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());

    if (r != null) {
      Collection<SequencerPartitionContainer<SequencerPoolPartition>> conts = ((RunImpl)r).getSequencerPartitionContainers();
      if (!conts.isEmpty() && conts.size() == 1) {
View Full Code Here

      sb.append("Processing " + runName);
      log.debug("Processing " + runName);
      Status is = new IlluminaStatus();
      is.setRunName(runName);

      Run r = new IlluminaRun();
      r.setPlatformRunId(0);
      r.setAlias(runName);
      r.setFilePath(runName);
      r.setDescription("Test Run Import");
      r.setPairedEnd(false);
      is.setHealth(ht);
      r.setStatus(is);

      updatedRuns.put(r.getAlias(), r);
      sb.append("...done\n");
    }

    log.info(sb.toString());
    return updatedRuns;
View Full Code Here

TOP

Related Classes of uk.ac.bbsrc.tgac.miso.core.data.Run

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.