Search in sources :

Example 1 with ConnectorInstanceSpecificationType

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

the class ResourceManager method supportsCapability.

private <T extends CapabilityType> boolean supportsCapability(ConnectorInstanceSpecificationType additionalConnectorType, Collection<Object> nativeCapabilities, Class<T> capabilityClass) {
    CapabilitiesType specifiedCapabilitiesType = additionalConnectorType.getCapabilities();
    if (specifiedCapabilitiesType != null) {
        CapabilityCollectionType configuredCapCollectionType = specifiedCapabilitiesType.getConfigured();
        if (configuredCapCollectionType != null) {
            T configuredCap = CapabilityUtil.getCapability(configuredCapCollectionType.getAny(), capabilityClass);
            if (configuredCap != null && !CapabilityUtil.isCapabilityEnabled(configuredCap)) {
                return false;
            }
        }
    }
    T cap = CapabilityUtil.getCapability(nativeCapabilities, capabilityClass);
    if (cap == null) {
        return false;
    }
    return CapabilityUtil.isCapabilityEnabled(cap);
}
Also used : CapabilityCollectionType(com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilityCollectionType) CapabilitiesType(com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType)

Example 2 with ConnectorInstanceSpecificationType

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

the class ResourceManager method completeCapabilities.

private void completeCapabilities(PrismObject<ResourceType> resource, boolean forceRefresh, Map<String, Collection<Object>> capabilityMap, Collection<ItemDelta<?, ?>> modifications, OperationResult result) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException {
    ResourceType resourceType = resource.asObjectable();
    ConnectorSpec defaultConnectorSpec = getDefaultConnectorSpec(resource);
    CapabilitiesType resourceCapType = resourceType.getCapabilities();
    if (resourceCapType == null) {
        resourceCapType = new CapabilitiesType();
        resourceType.setCapabilities(resourceCapType);
    }
    completeConnectorCapabilities(defaultConnectorSpec, resourceCapType, new ItemPath(ResourceType.F_CAPABILITIES), forceRefresh, capabilityMap == null ? null : capabilityMap.get(null), modifications, result);
    for (ConnectorInstanceSpecificationType additionalConnectorType : resource.asObjectable().getAdditionalConnector()) {
        ConnectorSpec connectorSpec = getConnectorSpec(resource, additionalConnectorType);
        CapabilitiesType connectorCapType = additionalConnectorType.getCapabilities();
        if (connectorCapType == null) {
            connectorCapType = new CapabilitiesType();
            additionalConnectorType.setCapabilities(connectorCapType);
        }
        ItemPath itemPath = additionalConnectorType.asPrismContainerValue().getPath().subPath(ConnectorInstanceSpecificationType.F_CAPABILITIES);
        completeConnectorCapabilities(connectorSpec, connectorCapType, itemPath, forceRefresh, capabilityMap == null ? null : capabilityMap.get(additionalConnectorType.getName()), modifications, result);
    }
}
Also used : CapabilitiesType(com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ConnectorInstanceSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorInstanceSpecificationType) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 3 with ConnectorInstanceSpecificationType

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

the class ResourceManager method getAllConnectorSpecs.

private List<ConnectorSpec> getAllConnectorSpecs(PrismObject<ResourceType> resource) throws SchemaException {
    List<ConnectorSpec> connectorSpecs = new ArrayList<>();
    connectorSpecs.add(getDefaultConnectorSpec(resource));
    for (ConnectorInstanceSpecificationType additionalConnectorType : resource.asObjectable().getAdditionalConnector()) {
        connectorSpecs.add(getConnectorSpec(resource, additionalConnectorType));
    }
    return connectorSpecs;
}
Also used : ArrayList(java.util.ArrayList) ConnectorInstanceSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorInstanceSpecificationType)

Aggregations

CapabilitiesType (com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilitiesType)2 ConnectorInstanceSpecificationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorInstanceSpecificationType)2 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)1 CapabilityCollectionType (com.evolveum.midpoint.xml.ns._public.common.common_3.CapabilityCollectionType)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1 ArrayList (java.util.ArrayList)1