Package scap.check

Examples of scap.check.CheckResult


  private void handleCheckResults(CheckResults results,
      CPEDictionary dictionary) {
    for (CPE cpe : dictionary.getCPEs()) {
      CPEName cpeName = cpe.getCpeName();
      for (Check check : cpe.getChecks()) {
        CheckResult checkResult = results.getCheckResult(check);

        Status status;
        if (checkResult == null) {
          status = Status.UNKNOWN;
        } else {
          switch (checkResult.getCheckResult()) {
          case CHECKED:
            status = getCheckStatus(checkResult
                .getResultInstances());
            break;
          case ERROR:
            status = Status.ERROR;
            break;
View Full Code Here


   * @throws CPELanguageEvaluationException
   */
  public Result evaluate(CheckFactReference ref) throws CPELanguageEvaluationException {
    Check check = ref.getCheck();

    CheckResult checkResult = checkResults.getCheckResult(check);
    CheckedItem.Result checkingResult = checkResult.getResult();
    return normalizeResults(checkingResult);
  }
View Full Code Here

public abstract class AbstractCheckingUnitResultVisitor implements
    CheckingUnitResultVisitor {

  public void visit(CheckResultAdapter adapter) {
    CheckResult checkResult = adapter.getDelegate();
    for (CheckResultInstance checkResultInstance : checkResult.getResultInstances()) {
      processCheckResultInstance(checkResultInstance);
    }
  }
View Full Code Here

   * If @multi-check = true, return each CheckResultInstance
   * If @multi-check = false, return this instance</li>
   */
  // TODO: P5: figure out how to avoid using the adapters
  public Collection<? extends CheckingUnitResult> evaluate(CheckResults checkResults) {
    CheckResult checkResult = checkResults.getCheckResult(this);

    Collection<? extends CheckingUnitResult> retval;
    if (checkResult == null) {
      // The check was not evaluated by the check interpreter
      // TODO: P3: Should this be UNKNOWN?  Perhaps the XCCDF spec is in error?
      checkResult = new UncheckedCheckResult(this);
    }

    if (isMultiCheck()) {
      retval = newCheckResultInstanceAdapterCollection(checkResult.getResultInstances());
    } else {
      retval = Collections.<CheckingUnitResult>singleton(new CheckResultAdapter(checkResult));
    }
    return retval;
  }
View Full Code Here

TOP

Related Classes of scap.check.CheckResult

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.