Package gov.nist.scap.xccdf.document

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


public class XCCDFDocumentFactory {
  private XCCDFDocumentFactory() {}

  // TODO: P4: register document types using SPI to avoid hard-coding reflection
  public static XCCDFDocument getInstance(SourceContext context, SourceContext tailoringContext) throws XmlException, IOException {
    XCCDFDocument result;
   
    XmlObject data = context.getSourceContent().getXmlBeansInstance().getXmlObject();
    if (data instanceof gov.nist.checklists.xccdf.x11.BenchmarkDocument
        || data instanceof gov.nist.checklists.xccdf.x11.BenchmarkDocument.Benchmark) {
      result = new gov.nist.scap.xccdf.document.x1_1.XCCDFDocumentImpl(context);
View Full Code Here


    }
    return retval;
  }

  private void parseCheckingUnits(RuleType data) throws ComplexCheckException {
    XCCDFDocument document = getDocument();

    if (data.isSetComplexCheck()) {
      addCheckingUnit(new ComplexCheckImpl(document, data.getComplexCheck()));
    } else {
      List<CheckType> checks = data.getCheckList();
View Full Code Here

    }
    return retval;
  }

  private void parseCheckingUnits(RuleType data) throws ComplexCheckException {
    XCCDFDocument document = getDocument();

    if (data.isSetComplexCheck()) {
      addCheckingUnit(new ComplexCheckImpl(document, data.getComplexCheck()));
    } else {
      List<CheckType> checks = data.getCheckList();
View Full Code Here

    public XCCDFResults process(SourceContext checklist, ResultContextResolver resultContextResolver, XCCDFOptions options) throws CPEEvaluationException, XCCDFOptionException, ValidationException, XmlException, IOException, CircularReferenceException, ExtensionScopeException, ProfileNotFoundException, ItemNotFoundException, PropertyNotFoundException {
    // Validate options
    validateOptions(options);

    XCCDFDocument document = XCCDFDocumentFactory.getInstance(checklist, options.getTailoringInstance());

        log.debug("validating XCCDF content");
      if (!document.validate()) {
        throw new ValidationException("invalid xccdf document: "+document.getId());
      }

     
      ResultContext resultContext;
      File resultFile = options.getXccdfResultFile();
      if (resultFile != null) {
        resultContext = new FileResultContext(checklist, resultContextResolver, resultFile);
      } else {
        resultContext = resultContextResolver.resolve(checklist, "xccdf-results_", ".xml");
      }

        /*
         * 1 - Load and resolve the Benchmark
         */
        if (document.load() && !options.isSuppressXccdfResolved()) {
          //File resolvedFile = File.createTempFile("xccdf-resolved", ".xml",resultDirectory);
          File resolvedFile = resultContext.getAuxiliaryFile("xccdf-resolved_", ".xml");
 
          log.info("Saving the resolved checklist to: "+resolvedFile.getCanonicalPath());
          document.write(resolvedFile);
        }


        XCCDFProcessor processor = new XCCDFProcessor(document, options, resultContextResolver);

View Full Code Here

TOP

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

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.