Search in sources :

Example 1 with ItemProcessingRequest

use of com.evolveum.midpoint.repo.common.activity.run.processing.ItemProcessingRequest in project midpoint by Evolveum.

the class ClassicCollectionReportExportActivityRun method iterateOverItemsInBucket.

@Override
public void iterateOverItemsInBucket(OperationResult result) throws CommonException {
    // Issue the search to audit or model/repository
    // And use the following handler to handle the results
    AtomicInteger sequence = new AtomicInteger(0);
    Handler<Containerable> handler = record -> {
        ItemProcessingRequest<Containerable> request = ContainerableProcessingRequest.create(sequence.getAndIncrement(), record, this);
        coordinator.submit(request, result);
        return true;
    };
    searchSpecificationHolder.run(handler, result);
}
Also used : ItemProcessingRequest(com.evolveum.midpoint.repo.common.activity.run.processing.ItemProcessingRequest) ActivityRunException(com.evolveum.midpoint.repo.common.activity.run.ActivityRunException) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) com.evolveum.midpoint.repo.common.activity.run(com.evolveum.midpoint.repo.common.activity.run) RunningTask(com.evolveum.midpoint.task.api.RunningTask) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) com.evolveum.midpoint.report.impl.controller(com.evolveum.midpoint.report.impl.controller) ReportServiceImpl(com.evolveum.midpoint.report.impl.ReportServiceImpl) CommonException(com.evolveum.midpoint.util.exception.CommonException) Nullable(org.jetbrains.annotations.Nullable) Handler(com.evolveum.midpoint.util.Handler) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ContainerableProcessingRequest(com.evolveum.midpoint.repo.common.activity.run.processing.ContainerableProcessingRequest) NotNull(org.jetbrains.annotations.NotNull) Containerable(com.evolveum.midpoint.prism.Containerable) ReportUtils(com.evolveum.midpoint.report.impl.ReportUtils) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ItemProcessingRequest(com.evolveum.midpoint.repo.common.activity.run.processing.ItemProcessingRequest) Containerable(com.evolveum.midpoint.prism.Containerable)

Example 2 with ItemProcessingRequest

use of com.evolveum.midpoint.repo.common.activity.run.processing.ItemProcessingRequest in project midpoint by Evolveum.

the class ClassicDashboardReportExportActivityRun method iterateOverItemsInBucket.

@Override
public void iterateOverItemsInBucket(OperationResult result) throws CommonException {
    // Issue the search to audit or model/repository
    // And use the following handler to handle the results
    List<DashboardWidgetType> widgets = support.getDashboard().getWidget();
    AtomicInteger widgetSequence = new AtomicInteger(1);
    for (DashboardWidgetType widget : widgets) {
        ExportDashboardReportLine<Containerable> widgetLine = new ExportDashboardReportLine<>(widgetSequence.getAndIncrement(), widget);
        ItemProcessingRequest<ExportDashboardReportLine<Containerable>> widgetRequest = new ExportDashboardReportLineProcessingRequest(widgetLine, this);
        coordinator.submit(widgetRequest, result);
        if (support.isWidgetTableVisible()) {
            AtomicInteger sequence = new AtomicInteger(1);
            Handler<Containerable> handler = record -> {
                ExportDashboardReportLine<Containerable> line = new ExportDashboardReportLine<>(sequence.getAndIncrement(), record, widget.getIdentifier());
                ItemProcessingRequest<ExportDashboardReportLine<Containerable>> request = new ExportDashboardReportLineProcessingRequest(line, this);
                coordinator.submit(request, result);
                return true;
            };
            DashboardWidgetHolder holder = mapOfWidgetsController.get(widget.getIdentifier());
            ContainerableReportDataSource searchSpecificationHolder = holder.getSearchSpecificationHolder();
            searchSpecificationHolder.run(handler, result);
        }
    }
}
Also used : ItemProcessingRequest(com.evolveum.midpoint.repo.common.activity.run.processing.ItemProcessingRequest) ActivityRunException(com.evolveum.midpoint.repo.common.activity.run.ActivityRunException) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) com.evolveum.midpoint.repo.common.activity.run(com.evolveum.midpoint.repo.common.activity.run) RunningTask(com.evolveum.midpoint.task.api.RunningTask) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) com.evolveum.midpoint.report.impl.controller(com.evolveum.midpoint.report.impl.controller) ReportServiceImpl(com.evolveum.midpoint.report.impl.ReportServiceImpl) CommonException(com.evolveum.midpoint.util.exception.CommonException) LinkedHashMap(java.util.LinkedHashMap) List(java.util.List) Handler(com.evolveum.midpoint.util.Handler) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Containerable(com.evolveum.midpoint.prism.Containerable) DashboardWidgetHolder(com.evolveum.midpoint.report.impl.activity.ExportDashboardActivitySupport.DashboardWidgetHolder) NotNull(org.jetbrains.annotations.NotNull) ReportUtils(com.evolveum.midpoint.report.impl.ReportUtils) DashboardWidgetHolder(com.evolveum.midpoint.report.impl.activity.ExportDashboardActivitySupport.DashboardWidgetHolder) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ItemProcessingRequest(com.evolveum.midpoint.repo.common.activity.run.processing.ItemProcessingRequest) Containerable(com.evolveum.midpoint.prism.Containerable)

Aggregations

Containerable (com.evolveum.midpoint.prism.Containerable)2 com.evolveum.midpoint.repo.common.activity.run (com.evolveum.midpoint.repo.common.activity.run)2 ActivityRunException (com.evolveum.midpoint.repo.common.activity.run.ActivityRunException)2 ItemProcessingRequest (com.evolveum.midpoint.repo.common.activity.run.processing.ItemProcessingRequest)2 ReportServiceImpl (com.evolveum.midpoint.report.impl.ReportServiceImpl)2 ReportUtils (com.evolveum.midpoint.report.impl.ReportUtils)2 com.evolveum.midpoint.report.impl.controller (com.evolveum.midpoint.report.impl.controller)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 RunningTask (com.evolveum.midpoint.task.api.RunningTask)2 Handler (com.evolveum.midpoint.util.Handler)2 CommonException (com.evolveum.midpoint.util.exception.CommonException)2 com.evolveum.midpoint.xml.ns._public.common.common_3 (com.evolveum.midpoint.xml.ns._public.common.common_3)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 NotNull (org.jetbrains.annotations.NotNull)2 ContainerableProcessingRequest (com.evolveum.midpoint.repo.common.activity.run.processing.ContainerableProcessingRequest)1 DashboardWidgetHolder (com.evolveum.midpoint.report.impl.activity.ExportDashboardActivitySupport.DashboardWidgetHolder)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 Nullable (org.jetbrains.annotations.Nullable)1