Package org.moltools.apps.probemaker.messages

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


          //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

          //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

      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

          //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

   * 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

          //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

Related Classes of org.moltools.apps.probemaker.messages.SeverityFilter

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.