private void collect(MessageType type, Set<String> result, XmlConstraintsConclusion constraintConclusion) { if (constraintConclusion != null && Utils.isCollectionNotEmpty(constraintConclusion.getConstraint())) { for (XmlConstraint constraint : constraintConclusion.getConstraint()) { XmlName message = getMessage(type, constraint); if (message != null) { result.add(message.getValue()); } if (Utils.isStringNotBlank(constraint.getId())) { collect(type, result, getBasicBuildingBlockById(constraint.getId())); } } } }
private Set<TimestampWrapper> filterValidSignatureTimestamps(List<TimestampWrapper> allTimestamps) { Set<TimestampWrapper> result = new HashSet<TimestampWrapper>(); for (TimestampWrapper timestampWrapper : allTimestamps) { if (!TimestampType.SIGNATURE_TIMESTAMP.name().equals(timestampWrapper.getType())) { break; } boolean foundValidationTSP = false; for (XmlValidationProcessTimestamps timestampValidation : timestampValidations) { List<XmlConstraint> constraints = timestampValidation.getConstraint(); for (XmlConstraint tspValidation : constraints) { if (Utils.areStringsEqual(timestampWrapper.getId(), tspValidation.getId())) { foundValidationTSP = true; // PVA : if OK message imprint is validated in SVA of timestamp (depending of constraint.xml) if (XmlStatus.OK.equals(tspValidation.getStatus())) { result.add(timestampWrapper); break; } } } } if (!foundValidationTSP) { LOG.warn("Cannot find tsp validation info for tsp {}", timestampWrapper.getId()); } } return result; }