Examples of SeverityFilter


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

    this.severityFilterDao = severityFilterDao;
  }

  @Override
  public void save(SeverityFilter severityFilter, int orgId, int appId) {
    SeverityFilter toSave = loadFilter(orgId, appId);
   
    if (toSave == null) {
      toSave = severityFilter;
    } else {
      toSave.setEnabled(severityFilter.getEnabled());
      toSave.setFilters(severityFilter);
    }
   
    severityFilterDao.saveOrUpdate(toSave);
  }
View Full Code Here

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

    }
  }
 
  @Override
  public SeverityFilter getParentFilter(int teamId, int appId) {
    SeverityFilter returnFilter = new SeverityFilter();
   
    // if teamId == -1 and appId == -1 then we're finding the parent of global, which is just the default SeverityFilter
    if (teamId != -1 && appId == -1) {
     
      // if we're finding the parent of a team filter, let's use global settings if present
      SeverityFilter globalFilter = loadFilter(-1, -1);
      if (globalFilter != null && globalFilter.getEnabled()) {
        returnFilter = globalFilter;
      }
     
    } else if (teamId != -1) {
      SeverityFilter targetFilter = loadFilter(teamId, -1);
     
      if (targetFilter != null && targetFilter.getEnabled()) {
        // this is an app level filter and there are team settings, so let's use those
        returnFilter = targetFilter;
       
      } else {
       
        // there are no team settings, so let's look at global
        targetFilter = loadFilter(-1, -1);
       
        if (targetFilter == null || !targetFilter.getEnabled()) {
          // this is a team level filter and there are team level settings, so let's use those
          returnFilter = targetFilter;
        }
      }
    }
View Full Code Here

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

    return returnFilter;
  }

  @Override
  public SeverityFilter loadEffectiveFilter(int orgId, int appId) {
    SeverityFilter filter = null;
   
    if (orgId != -1 && appId != -1) {
      filter = loadFilter(orgId, appId);
    }
   
    if ((filter == null || !filter.getEnabled()) && orgId != -1) {
      filter = loadFilter(orgId, -1);
    }
   
    if (filter == null || !filter.getEnabled()) {
      filter = loadFilter(-1, -1);
    }
   
    if (filter == null || !filter.getEnabled()) {
      filter = new SeverityFilter();
    }
   
    return filter;
  }
View Full Code Here

Examples of org.moltools.apps.probemaker.messages.SeverityFilter

   * messages of the probe.*/
  @SuppressWarnings("unchecked")
  public static short calculateAndSetQuality(Candidate c) {
    Collection<Message> allMessages = ProbeMakerPropertyUtils.getAllMessages(c);
    byte worst = ProbeMakerConstants.GOOD_QUALITY;
    Collection<Message> messages = CollectionUtils.select(allMessages,new SeverityFilter(Message.WARNING));
    if (! (messages.isEmpty())) {
      worst = ProbeMakerConstants.OK_QUALITY;
    }
    messages = CollectionUtils.select(allMessages,new SeverityFilter(Message.ERROR));
    if (! (messages.isEmpty())) {
      worst = ProbeMakerConstants.BAD_QUALITY;
      //then go through all messages (unfiltered) and check for fatals
    }
    messages = CollectionUtils.select(allMessages,new SeverityFilter(Message.FATAL));
    if (! (messages.isEmpty())) {
      worst = ProbeMakerConstants.BAD_QUALITY;
      //finally set and return the quality
    }
    ProbeMakerPropertyUtils.setRank(c, worst);
View Full Code Here

Examples of org.moltools.apps.probemaker.messages.SeverityFilter

          //Print debug info
          log.debug("Analysis complete: " + acceptance); //$NON-NLS-1$

          //Print warning or worse messages to log        
          Collection<Message> warnings = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));

          if (!warnings.isEmpty()) {
            designlog.printList(warnings);
            for (Iterator<Message> i = warnings.iterator();i.hasNext();) {
              log.debug(i.next().getMessage());
            }
          }

          //Accept or reject the candidate
          switch (acceptance) {
          case CandidateAcceptor.ABORT:
            //Abort the process, return null
            designlog.printError("Aborted - exiting"); //$NON-NLS-1$
            canceled = true;
            badProbe(p);
            return false;

          case CandidateAcceptor.SKIP:

            //Skip this probe and continue with next, select if any in list
            designlog.printLine("Probe skipped by acceptor"); //$NON-NLS-1$
            done = true;
            badProbe(p);
            break;

          case CandidateAcceptor.REJECT:

            //Remake this probe (dont do anything)
            designlog.printLine("Rejected"); //$NON-NLS-1$
            break;

          case CandidateAcceptor.TEMPORARY:

            //Add a copy of this probe to temporary list, and continue
            designlog.printLine("Temporarily accepted"); //$NON-NLS-1$
            tempCandidates.addSequence(p.getCopy());
            if (true) {
              throw new UnsupportedOperationException(
                  "Acceptor should not return temporary for stage 1"); //$NON-NLS-1$
            }
            break;

          case CandidateAcceptor.ACCEPT:

            /***************************
               STEP 3 - Stage 2 testing
             ***************************/

            //The candidate was accepted, so perform stage 2 analysis
            //Calculate the structure of the candidate and analyze it
            designlog.printLine("Candidate accepted, performing stage 2 analysis"); //$NON-NLS-1$
            setStatus("Performing stage 2 analysis"); //$NON-NLS-1$

            byte accept2 = analyzer.analyzeCandidateStage2(p,this,probes);

            //Print warning or worse messages to log
            Collection<Message> warns = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));
            if (!warns.isEmpty()) {
              designlog.printList(warns);
            }

            //Accept or reject the candidate
View Full Code Here

Examples of org.moltools.apps.probemaker.messages.SeverityFilter

          //Print debug info
          log.debug("Analysis complete: " + acceptance); //$NON-NLS-1$

          //Print warning or worse messages to log        
          Collection<Message> warnings = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));

          if (!warnings.isEmpty()) {
            htmllog.printList(warnings);
            for (Iterator<Message> i = warnings.iterator();i.hasNext();) {
              log.debug(i.next().getMessage());
            }
          }

          //Accept or reject the candidate
          switch (acceptance) {
          case CandidateAcceptor.ABORT:
            //Abort the process, return null
            htmllog.printError("Aborted - exiting"); //$NON-NLS-1$
            canceled = true;
            badProbe(p);
            return false;

          case CandidateAcceptor.SKIP:

            //Skip this probe and continue with next, select if any in list
            htmllog.printLine("Probe skipped by acceptor"); //$NON-NLS-1$
            done = true;
            badProbe(p);
            break;

          case CandidateAcceptor.REJECT:

            //Remake this probe (dont do anything)
            htmllog.printLine("Rejected"); //$NON-NLS-1$
            break;

          case CandidateAcceptor.TEMPORARY:

            //Add a copy of this probe to temporary list, and continue
            htmllog.printLine("Temporarily accepted"); //$NON-NLS-1$
            tempCandidates.addSequence(p.getCopy());
            if (true) {
              throw new UnsupportedOperationException(
                  "Acceptor should not return temporary for stage 1"); //$NON-NLS-1$
            }
            break;

          case CandidateAcceptor.ACCEPT:

            /***************************
               STEP 3 - Stage 2 testing
             ***************************/

            //The candidate was accepted, so perform stage 2 analysis
            //Calculate the structure of the candidate and analyze it
            htmllog.printLine("Candidate accepted, performing stage 2 analysis"); //$NON-NLS-1$
            setStatus("Performing stage 2 analysis"); //$NON-NLS-1$

            byte accept2 = analyzer.analyzeCandidateStage2(p,this,probes);

            //Print warning or worse messages to log
            Collection<Message> warns = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));
            if (!warns.isEmpty()) {
              htmllog.printList(warns);
            }

            //Accept or reject the candidate
View Full Code Here

Examples of org.moltools.apps.probemaker.messages.SeverityFilter

      return 1;
    }
    else if (brank > arank) {
      return -1;
    }
    else if (CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(a),new SeverityFilter(Message.WARNING)).size()
          <= CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(b),new SeverityFilter(Message.WARNING)).size()) {
        return 1;
    }
    else return -1;
  }
View Full Code Here

Examples of org.moltools.apps.probemaker.messages.SeverityFilter

          //Print debug info
          log.debug("Analysis complete: " + acceptance); //$NON-NLS-1$

          //Print warning or worse messages to log        
          Collection<Message> warnings = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));

          if (!warnings.isEmpty()) {
            designlog.printList(warnings);
            for (Iterator<Message> i = warnings.iterator();i.hasNext();) {
              log.debug(i.next().getMessage());
            }
          }

          //Accept or reject the candidate
          switch (acceptance) {
          case CandidateAcceptor.ABORT:
            //Abort the process, return null
            designlog.printError("Aborted - exiting"); //$NON-NLS-1$
            canceled = true;
            badProbe(p);
            return false;

          case CandidateAcceptor.SKIP:

            //Skip this probe and continue with next, select if any in list
            designlog.printLine("Probe skipped by acceptor"); //$NON-NLS-1$
            done = true;
            badProbe(p);
            break;

          case CandidateAcceptor.REJECT:

            //Remake this probe (dont do anything)
            designlog.printLine("Rejected"); //$NON-NLS-1$
            break;

          case CandidateAcceptor.TEMPORARY:

            //Add a copy of this probe to temporary list, and continue
            designlog.printLine("Temporarily accepted"); //$NON-NLS-1$
            tempCandidates.addSequence(p.getCopy());
            if (true) {
              throw new UnsupportedOperationException(
                  "Acceptor should not return temporary for stage 1"); //$NON-NLS-1$
            }
            break;

          case CandidateAcceptor.ACCEPT:

            /***************************
               STEP 3 - Stage 2 testing
             ***************************/

            //The candidate was accepted, so perform stage 2 analysis
            //Calculate the structure of the candidate and analyze it
            designlog.printLine("Candidate accepted, performing stage 2 analysis"); //$NON-NLS-1$
            setStatus("Performing stage 2 analysis"); //$NON-NLS-1$

            byte accept2 = analyzer.analyzeCandidateStage2(p,this,probes);

            //Print warning or worse messages to log
            Collection<Message> warns = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));
            if (!warns.isEmpty()) {
              designlog.printList(warns);
            }

            //Accept or reject the candidate
View Full Code Here

Examples of org.moltools.apps.probemaker.messages.SeverityFilter

   * messages of the probe.*/
  @SuppressWarnings("unchecked")
  public static short calculateAndSetQuality(Candidate c) {
    Collection<Message> allMessages = ProbeMakerPropertyUtils.getAllMessages(c);
    byte worst = ProbeMakerConstants.GOOD_QUALITY;
    Collection<Message> messages = CollectionUtils.select(allMessages,new SeverityFilter(Message.WARNING));
    if (! (messages.isEmpty())) {
      worst = ProbeMakerConstants.OK_QUALITY;
    }
    messages = CollectionUtils.select(allMessages,new SeverityFilter(Message.ERROR));
    if (! (messages.isEmpty())) {
      worst = ProbeMakerConstants.BAD_QUALITY;
      //then go through all messages (unfiltered) and check for fatals
    }
    messages = CollectionUtils.select(allMessages,new SeverityFilter(Message.FATAL));
    if (! (messages.isEmpty())) {
      worst = ProbeMakerConstants.BAD_QUALITY;
      //finally set and return the quality
    }
    ProbeMakerPropertyUtils.setRank(c, worst);
View Full Code Here

Examples of org.moltools.apps.probemaker.messages.SeverityFilter

          //Print debug info
          log.debug("Analysis complete: " + acceptance); //$NON-NLS-1$

          //Print warning or worse messages to log        
          Collection<Message> warnings = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));

          if (!warnings.isEmpty()) {
            htmllog.printList(warnings);
            for (Iterator<Message> i = warnings.iterator();i.hasNext();) {
              log.debug(i.next().getMessage());
            }
          }

          //Accept or reject the candidate
          switch (acceptance) {
            case CandidateAcceptor.ABORT:
              //Abort the process, return null
              htmllog.printError("Aborted - exiting"); //$NON-NLS-1$
              canceled = true;
              badProbe(p);
              return false;

            case CandidateAcceptor.SKIP:

              //Skip this probe and continue with next, select if any in list
              htmllog.printLine("Probe skipped by acceptor"); //$NON-NLS-1$
              done = true;
              badProbe(p);
              break;

            case CandidateAcceptor.REJECT:

              //Remake this probe (dont do anything)
              htmllog.printLine("Rejected"); //$NON-NLS-1$
              break;

            case CandidateAcceptor.TEMPORARY:

              //Add a copy of this probe to temporary list, and continue
              htmllog.printLine("Temporarily accepted"); //$NON-NLS-1$
              tempCandidates.addSequence(p.getCopy());
              if (true) {
                throw new UnsupportedOperationException(
                    "Acceptor should not return temporary for stage 1"); //$NON-NLS-1$
              }
              break;

            case CandidateAcceptor.ACCEPT:

              /***************************
               STEP 3 - Stage 2 testing
               ***************************/

              //The candidate was accepted, so perform stage 2 analysis
              //Calculate the structure of the candidate and analyze it
              htmllog.printLine("Candidate accepted, performing stage 2 analysis"); //$NON-NLS-1$
              setStatus("Performing stage 2 analysis"); //$NON-NLS-1$

              byte accept2 = analyzer.analyzeCandidateStage2(p,this,probes);

              //Print warning or worse messages to log
              Collection<Message> warns = CollectionUtils.select(ProbeMakerPropertyUtils.getAllMessages(p),new SeverityFilter(Message.WARNING));
              if (!warns.isEmpty()) {
                htmllog.printList(warns);
              }

              //Accept or reject the candidate
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.