Search in sources :

Example 1 with BucketProgressOverviewType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.BucketProgressOverviewType in project midpoint by Evolveum.

the class GetBucketOperationAttempt method setOrUpdateEstimatedNumberOfBuckets.

private void setOrUpdateEstimatedNumberOfBuckets() throws SchemaException {
    Integer number = bucketFactory.estimateNumberOfBuckets();
    if (number != null && !number.equals(getNumberOfBuckets(activityState))) {
        List<ItemDelta<?, ?>> numberOfBucketsMods = PrismContext.get().deltaFor(TaskType.class).item(activityStateItemPath.append(F_BUCKETING, F_NUMBER_OF_BUCKETS)).replace(number).asItemDeltas();
        LOGGER.trace("Going to set # of buckets:\n{}", DebugUtil.debugDumpLazily(numberOfBucketsMods, 1));
        modifications.addAll(numberOfBucketsMods);
    }
    // The number of complete buckets is not changed by this operation, so we can report the progress right now.
    bucketProgressHolder.accept(new BucketProgressOverviewType().totalBuckets(number).completeBuckets(BucketingUtil.getCompleteBucketsNumber(currentBuckets)));
}
Also used : TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) ItemDelta(com.evolveum.midpoint.prism.delta.ItemDelta) BucketProgressOverviewType(com.evolveum.midpoint.xml.ns._public.common.common_3.BucketProgressOverviewType)

Aggregations

ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)1 BucketProgressOverviewType (com.evolveum.midpoint.xml.ns._public.common.common_3.BucketProgressOverviewType)1 TaskType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType)1