示例#1
0
 /**
  * Get NOS Name List by series
  *
  * @param objectKey
  * @return
  */
 @RequestMapping(value = "/rest/getnoslist", method = RequestMethod.GET)
 public List<NOSName> getNOSListBySeries(
     @RequestParam("series") String seriesName, @RequestParam("dev") String deviceName) {
   try {
     List<NOSName> artInfoList = artifactInfoDAO.getBySeriesNameDeviceName(seriesName, deviceName);
     return artInfoList;
   } catch (Exception ex) {
     logger.error("Error in NosRepoRestController.getNOSListBySeries(): ", ex);
     return new ArrayList<NOSName>();
   }
 }
示例#2
0
 @RequestMapping(value = "/rest/getnosinfobykey", method = RequestMethod.GET)
 public NOSInfo getNOSDetailByKey(
     @RequestParam("key") String key, @RequestParam("dev") String deviceName) {
   try {
     NOSInfo n = artifactInfoDAO.getByRequestKeyAndDevice(key, deviceName);
     if (requestMap.contains(key)) requestMap.remove(key);
     return n;
   } catch (Exception e) {
     logger.error("Error in NosRepoRestController.getNOSDetails(): ", e);
   }
   return null;
 }
示例#3
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;
  }