for (int i = 0; i < report.getReportlets().size() && !interrupt; i++) { Optional<Reportlet> reportlet = ImplementationManager.buildReportlet(report.getReportlets().get(i)); if (reportlet.isPresent()) { try { status.set("Invoking reportlet " + report.getReportlets().get(i).getKey()); reportlet.get().extract(handler, status); } catch (Throwable t) {
Set<String> reportletKeys = report.getReportlets().stream(). map(Entity::getKey).collect(Collectors.toSet()); if (reportletKeys.size() != report.getReportlets().size()) { LOG.error("Reportlet key must be unique"); isValid = false;
@Override public void getReport(final Report report, final ReportTO reportTO) { report.setName(reportTO.getName()); report.setCronExpression(reportTO.getCronExpression()); report.setActive(reportTO.isActive()); ReportTemplate template = reportTemplateDAO.find(reportTO.getTemplate()); if (template == null) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing); sce.getElements().add("template"); throw sce; } report.setTemplate(template); reportTO.getReportlets().forEach(reportletKey -> { Implementation reportlet = implementationDAO.find(reportletKey); if (reportlet == null) { LOG.debug("Invalid " + Implementation.class.getSimpleName() + " {}, ignoring...", reportletKey); } else { report.add(reportlet); } }); // remove all implementations not contained in the TO report.getReportlets().removeIf(reportlet -> !reportTO.getReportlets().contains(reportlet.getKey())); }
report.getReportlets().stream().map(Entity::getKey).collect(Collectors.toList()));