コード例 #1
0
  /**
   * Get NOS Details
   *
   * @param objectKey
   * @return
   */
  @Deprecated /*deprecated - changed to get nos detail by build request key and device*/
  @RequestMapping(value = "/rest/getnosinfo", method = RequestMethod.GET)
  public NOSInfo getNOSDetails(
      @RequestParam("series") String seriesName,
      @RequestParam("nos") String nosName,
      @RequestParam("dev") String deviceName) {
    try {
      NOSSeries series = seriesDAO.getByName(seriesName);
      if (series == null) return null;
      Artifact a = artDao.getByNameAndSeries(nosName, series.getId());
      if (a == null) return null;
      Device device = deviceDAO.getByName(deviceName);
      if (device == null) return null;
      ArtifactInfo artifactInfo =
          artifactInfoDAO.getByDeviceIdArtifactId(device.getId(), a.getId());
      if (artifactInfo == null) return null;
      SysVerInfo sysVerInfo = new SysVerInfo();
      sysVerInfo.setSys(artifactInfo.getSysInfo());
      sysVerInfo.setVer(artifactInfo.getVerInfo());
      BuildRequest history = historyDAO.getById(a.getBuildRequestId());
      NOSInfo n = new NOSInfo();
      n.setId(a.getId());
      n.setBmt(a.getBmtNumber());
      n.setBuildno(a.getBuildNumber());
      n.setCategory(series.getCategory());
      n.setDump(a.getAttachedDumpFile());
      n.setFilesize(a.getFileSize());
      n.setHash(a.getFileHash());
      n.setLocation(a.getFileLocation());
      n.setMajor(a.getVersionMajor());
      n.setMinor(a.getVersionMinor());
      n.setName(a.getFileName());
      n.setOsInfo(Utils.toJson(sysVerInfo));
      n.setResized(a.getIsResized());
      n.setType(a.getType());
      if (history != null) {
        n.setSrcRev(history.getSourceRev());
        n.setSrcUrl(history.getSourceUrl());
        if (requestMap.contains(history.getRequestKey()))
          requestMap.remove(history.getRequestKey());
      }

      return n;
    } catch (Exception e) {
      logger.error("Error in NosRepoRestController.getNOSDetails(): ", e);
    }
    return null;
  }
コード例 #2
0
ファイル: ArtifactInfoDAOImpl.java プロジェクト: tungns90/RM
 @Override
 public boolean update(ArtifactInfo model) {
   return getJdbcTemplate()
           .update(
               SQL_UPDATE,
               model.getArtifactId(),
               model.getDeviceId(),
               model.getUserId(),
               model.getCliFullFileName(),
               model.getUploadTime(),
               model.getSysInfo(),
               model.getVerInfo(),
               model.getAVerInfo(),
               model.getId())
       > 0;
 }