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

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


      return false;
    if (obj == this)
      return true;
    if (!(obj instanceof Status))
      return false;
    Status them = (Status) obj;
    // If not saved, then compare resolved actual objects. Otherwise
    // just compare IDs.
    if (getStatusId().equals(StatusImpl.UNSAVED_ID)
        || them.getStatusId().equals(StatusImpl.UNSAVED_ID)) {
      return getRunName().equals(them.getRunName());
    }
    else {
      return getStatusId().equals(them.getStatusId()) &&
             getHealth().equals(them.getHealth()) &&
             getStartDate().equals(them.getStartDate()) &&
             getCompletionDate().equals(them.getCompletionDate());
    }
  }
View Full Code Here


    foo.setResponderServices(responders);
    r.addListener(foo);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Unknown");
    Status s = new StatusImpl();
    s.setHealth(HealthType.Unknown);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Started");
    s = new StatusImpl();
    s.setHealth(HealthType.Started);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Stopped");
    s = new StatusImpl();
    s.setHealth(HealthType.Stopped);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Failed");
    s = new StatusImpl();
    s.setHealth(HealthType.Failed);
    r.setStatus(s);

    log.info("Attempting to set status from "+r.getStatus().getHealth().getKey()+" to Completed");
    s = new StatusImpl();
    s.setHealth(HealthType.Completed);
    r.setStatus(s);

    log.info("Unregistering listeners");
    r.removeListener(foo);
  }
View Full Code Here

  @Override
  public boolean respondsTo(Event event) {
    if (event instanceof StatusChangedEvent) {
      StatusChangedEvent se = (StatusChangedEvent)event;
      Status s = se.getStatus();
      log.info("Checking responder for status change event for " + se.getEventObject().getClass().getSimpleName());
      if (s != null) {
        if (s.getHealth().equals(HealthType.Failed) || s.getHealth().equals(HealthType.Completed)) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

    if (event instanceof RunEvent) {
      RunEvent re = (RunEvent)event;
      Run r = re.getEventObject();
      log.info("Checking responder for run " + r.getId());
      if (r.getStatus() != null) {
        Status s = r.getStatus();
        if (s.getHealth().equals(HealthType.Failed) || s.getHealth().equals(HealthType.Completed)) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

      if (!sr.getPlatform().getPlatformType().equals(PlatformType.LS454)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with a 454 strategy");
      }
      try {
        SequencerInterrogator context = SequencerInterrogatorFactory.getSequencerInterrogator(sr);
        Status status = context.getRunStatus(runName);
        if (status != null) {
          model.put("referenceName", sr.getName());
          model.put("referenceId", sr.getId());
          model.put("runId", requestManager.getRunByAlias(runName).getId());
          model.put("runName", runName);
View Full Code Here

      if (!sr.getPlatform().getPlatformType().equals(PlatformType.ILLUMINA)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with an Illumina strategy");
      }
     
      try {
        Status status = requestManager.getStatusByRunName(runName);
        if (status != null) {
          model.put("referenceName", sr.getName());
          model.put("referenceId", sr.getId());
          model.put("runId", requestManager.getRunByAlias(runName).getId());
          model.put("runName", runName);
          model.put("runStatus", status);

          InputStream in = StatsController.class.getResourceAsStream("/status/xsl/illumina/statusXml.xsl");
          if (in != null) {
            String xsl = LimsUtils.inputStreamToString(in);
            model.put("statusXml", (SubmissionUtils.xslTransform(status.getXml(), xsl)));
          }
        }
        else {
          model.put("error", MisoWebUtils.generateErrorDivMessage("Cannot consume the xml file for the given run name: " + runName));
        }
View Full Code Here

      if (!sr.getPlatform().getPlatformType().equals(PlatformType.SOLID)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with an SOLiD strategy");
      }

      try {
        Status status = requestManager.getStatusByRunName(runName);
        if (status != null) {
          model.put("referenceName", sr.getName());
          model.put("referenceId", sr.getId());
          model.put("runId", requestManager.getRunByAlias(runName).getId());
          model.put("runName", runName);
          model.put("runStatus", status);

          InputStream in = StatsController.class.getResourceAsStream("/status/xsl/solid/statusXml.xsl");
          if (in != null) {
            String xsl = LimsUtils.inputStreamToString(in);
            model.put("statusXml", (SubmissionUtils.xslTransform(status.getXml(), xsl)));
          }
        }
        else {
          model.put("error", MisoWebUtils.generateErrorDivMessage("Cannot consume the xml file for the given run name: " + runName));
        }
View Full Code Here

      if (!sr.getPlatform().getPlatformType().equals(PlatformType.PACBIO)) {
        throw new IOException("Trying to interrogate a " + sr.getPlatform().getPlatformType().getKey() + " sequencer reference with a PacBio strategy");
      }

//      try {
        Status status = requestManager.getStatusByRunName(runName);
        if (status != null) {
          model.put("referenceName", sr.getName());
          model.put("referenceId", sr.getId());
          model.put("runId", requestManager.getRunByAlias(runName).getId());
          model.put("runName", runName);
View Full Code Here

    catch (SQLException e) {
      e.printStackTrace();
    }

    if (status.getStatusId() == 0L) {
      Status savedStatus = getByRunName(status.getRunName());
      if (savedStatus == null) {
        SimpleJdbcInsert insert = new SimpleJdbcInsert(template)
                .withTableName(TABLE_NAME)
                .usingGeneratedKeyColumns("statusId");

        if (status.getHealth().equals(HealthType.Running) && status.getStartDate() == null) {
          //run freshly started
          params.addValue("startDate", new Date());
        }

        Number newId = insert.executeAndReturnKey(params);
        status.setStatusId(newId.longValue());
      }
      else {
        status.setStatusId(savedStatus.getStatusId());
        params.addValue("statusId", status.getStatusId());
        NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
        namedTemplate.update(STATUS_UPDATE, params);       
      }
    }
View Full Code Here

    return results;
  }

  public Status get(long statusId) throws IOException {
    List eResults = template.query(STATUS_SELECT_BY_ID, new Object[]{statusId}, new StatusMapper());
    Status e = eResults.size() > 0 ? (Status) eResults.get(0) : null;
    return e;
  }
View Full Code Here

TOP

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

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.