Package com.denimgroup.threadfix.data.entities

Examples of com.denimgroup.threadfix.data.entities.Defect


        defectViewModel.getSeverity(),
        defectViewModel.getPriority(),
        defectViewModel.getStatus(),
                defectViewModel.getFieldsMap(),
                defectViewModel.getAdditionalScannerInfo());
        Defect newDefect = null;
        if (map.get(DefectService.DEFECT) instanceof Defect)
            newDefect = (Defect)map.get(DefectService.DEFECT);
    if (newDefect != null) {
      return RestResponse.success("The Defect was submitted to the tracker.");
        } else {
View Full Code Here


       
        Integer id = (Integer) currentBugHash.get("id");
       
        if (idDefectMap.containsKey(id.toString()) &&
            idDefectMap.get(id.toString()) != null) {
          Defect defect = idDefectMap.get(id.toString());
         
          if (result instanceof String) {
            defect.setStatus((String) result);
          }
         
          returnList.put(defect, isOpen);
        }
      }
View Full Code Here

                Map<String, Object> currentBugHash = (HashMap<String, Object>) currentBug;
                if (currentBugHash == null) {
                    continue;
                }
                Integer id = (Integer) currentBugHash.get("id");
                Defect defect = new Defect();
                defect.setNativeId(String.valueOf(id));
                returnList.add(defect);
            }
    } else {
      log.error("Expected a HashMap return value, but got something else instead.");
    }
View Full Code Here

            JSONArray returnArray = JsonUtils.getJSONArray(issuesString);

            if (returnArray != null) {
                for (int i = 0; i < returnArray.length(); i++) {
                    Defect defect = new Defect();
                    defect.setNativeId(returnArray.getJSONObject(i).getString("key"));
                    defectList.add(defect);
                }
            }
        } catch (JSONException e) {
            log.warn("JSON parsing failed when trying to get defect list.");
View Full Code Here

        List<String> defectNumberList = getAttributeNumber(getUrlWithRest() +
                "Defect?where=Scope.Name='" + getUrlEncodedProjectName() + "'&sel=Number", null);

        List<Defect> defectList = list();
        Defect defect;
        for (String number: defectNumberList) {
            defect = new Defect();
            defect.setNativeId(number);
            defectList.add(defect);
        }

        return defectList;
    }
View Full Code Here

    public static List<Defect> getDefectList(String... nativeIds) {

        List<Defect> defects = list();

        for (String nativeId : nativeIds) {
            Defect defect = new Defect();
            defect.setNativeId(nativeId);
            defects.add(defect);
        }

        return defects;
    }
View Full Code Here

        new DefectMetadata(editedSummary, editedPreamble,
        component, version, severity, priority, status, fieldsMap));

    if (defectId != null) {
     
      Defect defect = new Defect();
      defect.setNativeId(defectId);
      defect.setVulnerabilities(vulnsWithoutDefects);
      defect.setApplication(application);
            Object sObj = null;
            if (fieldsMap != null && status == null) {
                sObj = fieldsMap.get("status")==null ? fieldsMap.get("Status") : fieldsMap.get("status");
            }
      status = (sObj != null ? String.valueOf(sObj) : status);

            // By default, set status to Open
            if (status == null)
                status = "Open";

            defect.setStatus(status);
      defect.setDefectURL(dt.getBugURL(
          application.getDefectTracker().getUrl(), defectId));
      defectDao.saveOrUpdate(defect);

      for (Vulnerability vulnerability : vulnsWithoutDefects) {
        vulnerability.setDefect(defect);
View Full Code Here

    AbstractDefectTracker dt = DefectTrackerFactory.getTracker(application);
    if (dt == null) {
      log.warn("Unable to load Defect Tracker.");
      return false;
    }
    Defect defect = new Defect();
    defect.setNativeId(id);
    defect.setDefectURL(dt.getBugURL(
        application.getDefectTracker().getUrl(), id));
    defect.setApplication(application);
    List<Defect> defectList = list();
    defectList.add(defect);
        Map<Defect, Boolean> map = dt.getMultipleDefectStatus(defectList);
        if (map.isEmpty())
            return false;
View Full Code Here

            List<String> defectIds = client.getDefectIds(getProjectName());

            List<Defect> defects = new ArrayList<>();

            for (String id : defectIds) {
                Defect defect = new Defect();
                defect.setNativeId(id);
                defects.add(defect);
            }

            return defects;
        } else {
View Full Code Here

            if (responseStr.contains("</Entities>")) {
                Entities entities = parseXml(responseStr, Entities.class);
                if (entities.getEntities() != null) {
                    for (Entity entity: entities.getEntities()) {
                        Defect defect = new Defect();
                        defect.setNativeId(getFieldValue(entity, "id"));
                        defectList.add(defect);
                    }
                }
            } else {
                log.warn("XML response is incorrect");
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.data.entities.Defect

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.