use of org.apache.syncope.common.lib.to.PropagationTaskTO in project syncope by apache.
the class DefaultAnyObjectProvisioningManager method create.
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Override
public Pair<String, List<PropagationStatus>> create(final AnyObjectTO anyObjectTO, final Set<String> excludedResources, final boolean nullPriorityAsync) {
WorkflowResult<String> created = awfAdapter.create(anyObjectTO);
List<PropagationTaskTO> tasks = propagationManager.getCreateTasks(AnyTypeKind.ANY_OBJECT, created.getResult(), created.getPropByRes(), anyObjectTO.getVirAttrs(), excludedResources);
PropagationReporter propagationReporter = taskExecutor.execute(tasks, nullPriorityAsync);
return Pair.of(created.getResult(), propagationReporter.getStatuses());
}
use of org.apache.syncope.common.lib.to.PropagationTaskTO in project syncope by apache.
the class DefaultUserProvisioningManager method create.
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Override
public Pair<String, List<PropagationStatus>> create(final UserTO userTO, final boolean storePassword, final boolean disablePwdPolicyCheck, final Boolean enabled, final Set<String> excludedResources, final boolean nullPriorityAsync) {
WorkflowResult<Pair<String, Boolean>> created = uwfAdapter.create(userTO, disablePwdPolicyCheck, enabled, storePassword);
List<PropagationTaskTO> tasks = propagationManager.getUserCreateTasks(created.getResult().getLeft(), userTO.getPassword(), created.getResult().getRight(), created.getPropByRes(), userTO.getVirAttrs(), excludedResources);
PropagationReporter propagationReporter = taskExecutor.execute(tasks, nullPriorityAsync);
return Pair.of(created.getResult().getLeft(), propagationReporter.getStatuses());
}
use of org.apache.syncope.common.lib.to.PropagationTaskTO in project syncope by apache.
the class DefaultUserProvisioningManager method update.
@Override
public Pair<UserPatch, List<PropagationStatus>> update(final UserPatch userPatch, final boolean nullPriorityAsync) {
WorkflowResult<Pair<UserPatch, Boolean>> updated = uwfAdapter.update(userPatch);
List<PropagationTaskTO> tasks = propagationManager.getUserUpdateTasks(updated);
PropagationReporter propagationReporter = taskExecutor.execute(tasks, nullPriorityAsync);
return Pair.of(updated.getResult().getLeft(), propagationReporter.getStatuses());
}
use of org.apache.syncope.common.lib.to.PropagationTaskTO in project syncope by apache.
the class DefaultUserProvisioningManager method deprovision.
@Override
public List<PropagationStatus> deprovision(final String key, final Collection<String> resources, final boolean nullPriorityAsync) {
PropagationByResource propByRes = new PropagationByResource();
propByRes.set(ResourceOperation.DELETE, resources);
List<PropagationTaskTO> tasks = propagationManager.getDeleteTasks(AnyTypeKind.USER, key, propByRes, userDAO.findAllResourceKeys(key).stream().filter(resource -> !resources.contains(resource)).collect(Collectors.toList()));
PropagationReporter propagationReporter = taskExecutor.execute(tasks, nullPriorityAsync);
return propagationReporter.getStatuses();
}
use of org.apache.syncope.common.lib.to.PropagationTaskTO in project syncope by apache.
the class DefaultGroupProvisioningManager method create.
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Override
public Pair<String, List<PropagationStatus>> create(final GroupTO groupTO, final Map<String, String> groupOwnerMap, final Set<String> excludedResources, final boolean nullPriorityAsync) {
WorkflowResult<String> created = gwfAdapter.create(groupTO);
// see ConnObjectUtils#getAnyTOFromConnObject for GroupOwnerSchema
Optional<AttrTO> groupOwner = groupTO.getPlainAttr(StringUtils.EMPTY);
if (groupOwner.isPresent()) {
groupOwnerMap.put(created.getResult(), groupOwner.get().getValues().iterator().next());
}
List<PropagationTaskTO> tasks = propagationManager.getCreateTasks(AnyTypeKind.GROUP, created.getResult(), created.getPropByRes(), groupTO.getVirAttrs(), excludedResources);
PropagationReporter propagationReporter = taskExecutor.execute(tasks, nullPriorityAsync);
return Pair.of(created.getResult(), propagationReporter.getStatuses());
}
Aggregations