Search in sources :

Example 1 with CachingPolicyType

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

the class ProvisioningUtil method getCachingStrategy.

public static CachingStategyType getCachingStrategy(ProvisioningContext ctx) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, ExpressionEvaluationException {
    ResourceType resource = ctx.getResource();
    CachingPolicyType caching = resource.getCaching();
    if (caching == null || caching.getCachingStategy() == null) {
        ReadCapabilityType readCapabilityType = ResourceTypeUtil.getEffectiveCapability(resource, ReadCapabilityType.class);
        Boolean cachingOnly = readCapabilityType.isCachingOnly();
        if (cachingOnly == Boolean.TRUE) {
            return CachingStategyType.PASSIVE;
        }
        return CachingStategyType.NONE;
    }
    return caching.getCachingStategy();
}
Also used : ReadCapabilityType(com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ReadCapabilityType) CachingPolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.CachingPolicyType) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)

Aggregations

CachingPolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.CachingPolicyType)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1 ReadCapabilityType (com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ReadCapabilityType)1