protected Map<String, String> getConnObjectKeys(final Any<?> any, final AnyUtils anyUtils) { Map<String, String> connObjectKeys = new HashMap<>(); anyUtils.getAllResources(any). forEach(resource -> resource.getProvision(any.getType()). filter(provision -> provision.getMapping() != null). ifPresent(provision -> { MappingItem connObjectKeyItem = MappingUtils.getConnObjectKeyItem(provision). orElseThrow(() -> new NotFoundException( "ConnObjectKey mapping for " + any.getType().getKey() + " " + any.getKey() + " on resource '" + resource.getKey() + "'")); mappingManager.getConnObjectKeyValue(any, provision). ifPresent(value -> connObjectKeys.put(resource.getKey(), value)); })); return connObjectKeys; } }
anyUtils.getAllResources(any).forEach(resource -> { Provision provision = resource.getProvision(any.getType()).orElse(null); Optional<? extends MappingItem> connObjectKeyItem = MappingUtils.getConnObjectKeyItem(provision);
private Map<VirSchema, List<String>> getValues(final Any<?> any, final Set<VirSchema> schemas) { Set<ExternalResource> ownedResources = anyUtilsFactory.getInstance(any).getAllResources(any);
protected void update( final Any<?> any, final Boolean enable, final ConnectorObject beforeObj, final ProvisioningReport result) { boolean changepwd = any instanceof User; List<String> ownedResources = getAnyUtils().getAllResources(any).stream(). map(Entity::getKey).collect(Collectors.toList()); List<String> noPropResources = new ArrayList<>(ownedResources); noPropResources.remove(profile.getTask().getResource().getKey()); PropagationByResource propByRes = new PropagationByResource(); propByRes.add(ResourceOperation.UPDATE, profile.getTask().getResource().getKey()); propByRes.addOldConnObjectKey(profile.getTask().getResource().getKey(), beforeObj.getUid().getUidValue()); List<PropagationTaskInfo> taskInfos = propagationManager.getUpdateTasks( any.getType().getKind(), any.getKey(), changepwd, enable, propByRes, null, noPropResources); if (!taskInfos.isEmpty()) { taskInfos.get(0).setBeforeObj(Optional.of(beforeObj)); PropagationReporter reporter = new DefaultPropagationReporter(); taskExecutor.execute(taskInfos.get(0), reporter); reportPropagation(result, reporter); } }
requiredValuesMissing = checkMandatoryOnResources(any, anyUtils.getAllResources(any)); if (!requiredValuesMissing.isEmpty()) { scce.addException(requiredValuesMissing);
Set<ExternalResource> resources = anyUtils.getAllResources(any); SyncopeClientException invalidValues = SyncopeClientException.build(ClientExceptionType.InvalidValues);