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);
}
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);
}
}
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;
}
Aggregations