Search in sources :

Example 1 with WorkBucketContentHandler

use of com.evolveum.midpoint.repo.common.activity.run.buckets.segmentation.content.WorkBucketContentHandler in project midpoint by Evolveum.

the class BucketingManager method narrowQueryForWorkBucket.

/**
 * Narrows a query by taking specified bucket into account.
 */
public ObjectQuery narrowQueryForWorkBucket(@NotNull Class<? extends Containerable> type, ObjectQuery query, @NotNull ActivityDistributionDefinition distributionDefinition, @Nullable ItemDefinitionProvider itemDefinitionProvider, @NotNull WorkBucketType workBucket) throws SchemaException {
    WorkBucketContentHandler contentHandler = handlerRegistry.getHandler(workBucket.getContent());
    AbstractWorkSegmentationType segmentationConfig = BucketingUtil.getWorkSegmentationConfiguration(distributionDefinition.getBuckets());
    List<ObjectFilter> conjunctionMembers = new ArrayList<>(contentHandler.createSpecificFilters(workBucket, segmentationConfig, type, itemDefinitionProvider));
    return ObjectQueryUtil.addConjunctions(query, beans.prismContext, conjunctionMembers);
}
Also used : WorkBucketContentHandler(com.evolveum.midpoint.repo.common.activity.run.buckets.segmentation.content.WorkBucketContentHandler) ArrayList(java.util.ArrayList) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) AbstractWorkSegmentationType(com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractWorkSegmentationType)

Aggregations

ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)1 WorkBucketContentHandler (com.evolveum.midpoint.repo.common.activity.run.buckets.segmentation.content.WorkBucketContentHandler)1 AbstractWorkSegmentationType (com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractWorkSegmentationType)1 ArrayList (java.util.ArrayList)1