Package gov.nist.scap.xccdf.document

Examples of gov.nist.scap.xccdf.document.ResultBuilder


  }

  protected abstract ResultBuilder newResultBuilder();

  public ResultContent generateResults() throws IOException {
        ResultBuilder resultBuilder = newResultBuilder();
    resultBuilder.setStartTime(startTime);

    if (options.getTailoringInstance() != null) {
      resultBuilder.appendTailoring(options.getTailoringInstance());
    }

    if (options.getProfileId() != null) {
      resultBuilder.setProfileId(options.getProfileId());
    }

    resultBuilder.setTitle(getTitle(document.getId(), options.getProfileId(),
        startTime), "en-US");

    resultBuilder.setTestSystem(applicationProperties.getApplicationName()
        + " " + applicationProperties.getBuildVersion());

    // TODO: P5: find a way to populate the privileged and authenticated values correctly
    resultBuilder.appendIdentity(System.getProperty("user.name"), false, true);

    appendTargetAndFacts(resultBuilder);

    // TODO: P2: investigate if included values should be limited to evaluated rules or all rules
    // Currently using evaluated rules
    for (RuleResult ruleResult : ruleResultMap.values()) {
      resultBuilder.appendRuleResult(ruleResult, xccdfResult);
      for (Map.Entry<Value, LiteralValue> entry : ruleResult.getValuesUsed().entrySet()) {
        // TODO: P3: eliminate duplicate values
        resultBuilder.appendSetValue(entry.getKey(), entry.getValue());
      }
    }

    for (Score score : scores) {
      resultBuilder.appendScore(score);
    }

    resultBuilder.setEndTime(endTime);
    return resultBuilder.getResultContent();
  }
View Full Code Here


  }

  @Override
  public ResultBuilder newResultBuilder() {
    XCCDFDocumentImpl document = getDocument();
    ResultBuilder result;
    if (getXCCDFOptions().isStandaloneResults()) {
      // TODO: pass URL
      BenchmarkDocument.Benchmark benchmark = document.getData();
      result = new ResultBuilderImpl(benchmark.getId(), benchmark.getVersion().getStringValue(), document.getSourceContext().getUri().normalize());
    } else {
View Full Code Here

  }

  @Override
  public ResultBuilder newResultBuilder() {
    XCCDFDocumentImpl document = getDocument();
    ResultBuilder result;
    if (getXCCDFOptions().isStandaloneResults()) {
      // TODO: pass URL
      BenchmarkDocument.Benchmark benchmark = document.getData();
      result = new ResultBuilderImpl(benchmark.getId(), benchmark.getVersion().getStringValue(), document.getSourceContext().getUri().normalize());
    } else {
View Full Code Here

TOP

Related Classes of gov.nist.scap.xccdf.document.ResultBuilder

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.