Package gov.nist.checklists.xccdf.x11

Examples of gov.nist.checklists.xccdf.x11.BenchmarkDocument


    retval.append(DateFormatUtils.format(new Date(), "dd-MM-yyyy'T'HH:mm:ss.SZ"));
    return retval.toString();
  }

  public ResultBuilderImpl(BenchmarkDocument.Benchmark benchmark) {
    BenchmarkDocument doc = BenchmarkDocument.Factory.newInstance();
    doc.setBenchmark(benchmark);

    instance = doc;
    data = doc.getBenchmark().addNewTestResult();
  }
View Full Code Here


  public void handleCheckResult(CheckType data, CheckResultInstance instance) throws IOException {
    data.setSystem(instance.getCheck().getSystem());

    AssessmentResultItem item = instance.getAssessmentResultItem();
   
    CheckContentRefType checkContentRef = data.addNewCheckContentRef();
    checkContentRef.setName(item.getId());

    ResultContext resultContext = item.getAssessmentResult().getResultContext();
    checkContentRef.setHref(resultContext.resolveRelative(getXccdfResultContext()));
  }
View Full Code Here

        }

        do {
            XmlObject xmlObject = cursor.getObject();
            if (xmlObject instanceof CheckType) {
              CheckType checkType = (CheckType)xmlObject;

            if (checkType.isSetCheckContent()) {
              throw new ComplexCheckException(CheckedItem.Result.NOTCHECKED,
                  "In-line check content not supported");
            }

            XCCDFCheck check = RuleImpl.newCheck(document, checkType);
View Full Code Here

  public void appendFacts(List<Fact> facts) {
    if (!facts.isEmpty()) {
      TargetFactsType factsType = data.addNewTargetFacts();
      for (Fact fact : facts) {
        FactType factType = factsType.addNewFact();
        factType.setName(fact.getName());
        factType.setType(mapValueType(fact.getType()));
        factType.setStringValue(fact.getValue());
      }
    }
  }
View Full Code Here

                XmlObject xmlObject = cursor.getObject();
                if (SelectableItemType.type.isAssignableFrom(xmlObject.schemaType())) {
                    SelectableItemType item = (SelectableItemType) xmlObject;

                    if (item instanceof GroupType) {
                        GroupType node = (GroupType) item;
                  GroupImpl group = new GroupImpl(node, this);
                  addGroupInternal(group);
                    } else if (item instanceof RuleType) {
                      RuleType node = (RuleType) item;
                  RuleImpl rule = new RuleImpl(node, this);
View Full Code Here

                XmlObject xmlObject = cursor.getObject();
                if (SelectableItemType.type.isAssignableFrom(xmlObject.schemaType())) {
                    SelectableItemType item = (SelectableItemType) xmlObject;

                    if (item instanceof GroupType) {
                        GroupType node = (GroupType) item;
                  GroupImpl group = new GroupImpl(node, this);
                  addGroupInternal(group);
                    } else if (item instanceof RuleType) {
                      RuleType node = (RuleType) item;
                  RuleImpl rule = new RuleImpl(node, this);
View Full Code Here

    }

    retval.setWeight(rule.getWeight());

    for (Ident ident : rule.getIdents()) {
      IdentType node = retval.addNewIdent();
      node.setSystem(ident.getSystem().toString());
      node.setStringValue(ident.getValue());
    }

        // TODO: P5: support fix
    return retval;
  }
View Full Code Here

  public void setTestSystem(String string) {
    data.setTestSystem(string);
  }

  public void appendIdentity(String name, Boolean privileged, Boolean authenticated) {
    IdentityType identity = data.addNewIdentity();
    identity.setStringValue(name);
    if (privileged != null) {
      identity.setPrivileged(privileged);
    }
    if (authenticated != null) {
      identity.setAuthenticated(authenticated);
    }
  }
View Full Code Here

  public void appendTailoring(SourceContext tailoring) {
    throw new UnsupportedOperationException();
  }

  public void setProfileId(String profileId) {
    IdrefType ref = IdrefType.Factory.newInstance();
    ref.setIdref(profileId);
    data.setProfile(ref);
   
  }
View Full Code Here

  @Override
  protected void applyRuleResultRecord(RuleResultType data, RuleResultRecord record) {
    data.setResult(mapRuleResult(record.getResult()));

        for (Message message : record.getMessages()) {
            MessageType node = data.addNewMessage();

            String context = message.getContext();
            if (context == null) {
              node.setStringValue(message.getText());
            } else {
              node.setStringValue(new StringBuilder()
                .append(context)
                .append(": ")
                .append(message.getText()).toString());
            }
            node.setSeverity(mapMessageSeverity(message.getSeverity()));
        }
  }
View Full Code Here

TOP

Related Classes of gov.nist.checklists.xccdf.x11.BenchmarkDocument

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.