use of org.apache.syncope.common.lib.to.PropagationTaskTO in project syncope by apache.
the class DefaultGroupProvisioningManager method create.
@Override
public Pair<String, List<PropagationStatus>> create(final GroupTO groupTO, final boolean nullPriorityAsync) {
WorkflowResult<String> created = gwfAdapter.create(groupTO);
List<PropagationTaskTO> tasks = propagationManager.getCreateTasks(AnyTypeKind.GROUP, created.getResult(), created.getPropByRes(), groupTO.getVirAttrs(), Collections.<String>emptySet());
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 DefaultGroupProvisioningManager method update.
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Override
public Pair<GroupPatch, List<PropagationStatus>> update(final GroupPatch groupPatch, final Set<String> excludedResources, final boolean nullPriorityAsync) {
WorkflowResult<GroupPatch> updated = gwfAdapter.update(groupPatch);
List<PropagationTaskTO> tasks = propagationManager.getUpdateTasks(AnyTypeKind.GROUP, updated.getResult().getKey(), false, null, updated.getPropByRes(), groupPatch.getVirAttrs(), excludedResources);
PropagationReporter propagationReporter = taskExecutor.execute(tasks, nullPriorityAsync);
return Pair.of(updated.getResult(), propagationReporter.getStatuses());
}
use of org.apache.syncope.common.lib.to.PropagationTaskTO in project syncope by apache.
the class DefaultGroupProvisioningManager method provision.
@Override
public List<PropagationStatus> provision(final String key, final Collection<String> resources, final boolean nullPriorityAsync) {
PropagationByResource propByRes = new PropagationByResource();
propByRes.addAll(ResourceOperation.UPDATE, resources);
List<PropagationTaskTO> tasks = propagationManager.getUpdateTasks(AnyTypeKind.GROUP, key, false, null, propByRes, null, null);
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 deprovision.
@Override
public List<PropagationStatus> deprovision(final String key, final Collection<String> resources, final boolean nullPriorityAsync) {
PropagationByResource propByRes = new PropagationByResource();
propByRes.addAll(ResourceOperation.DELETE, resources);
List<PropagationTaskTO> tasks = propagationManager.getDeleteTasks(AnyTypeKind.GROUP, key, propByRes, groupDAO.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 PropagationTaskDirectoryPanel method getActions.
@Override
public ActionsPanel<PropagationTaskTO> getActions(final IModel<PropagationTaskTO> model) {
final ActionsPanel<PropagationTaskTO> panel = super.getActions(model);
final PropagationTaskTO taskTO = model.getObject();
panel.add(new ActionLink<PropagationTaskTO>() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target, final PropagationTaskTO modelObject) {
PropagationTaskDirectoryPanel.this.getTogglePanel().close(target);
viewTask(taskTO, target);
}
}, ActionLink.ActionType.VIEW_EXECUTIONS, StandardEntitlement.TASK_READ);
// [SYNCOPE-1115] - Display attributes for propagation tasks
panel.add(new ActionLink<PropagationTaskTO>() {
private static final long serialVersionUID = 9206257220553949594L;
@Override
public void onClick(final AjaxRequestTarget target, final PropagationTaskTO modelObject) {
PropagationTaskDirectoryPanel.this.getTogglePanel().close(target);
viewTaskDetails(modelObject, target);
}
}, ActionLink.ActionType.VIEW_DETAILS, StandardEntitlement.TASK_READ);
panel.add(new ActionLink<PropagationTaskTO>() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target, final PropagationTaskTO modelObject) {
try {
restClient.startExecution(taskTO.getKey(), null);
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (SyncopeClientException e) {
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
LOG.error("While running {}", taskTO.getKey(), e);
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}, ActionLink.ActionType.EXECUTE, StandardEntitlement.TASK_EXECUTE);
panel.add(new ActionLink<PropagationTaskTO>() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target, final PropagationTaskTO modelObject) {
try {
restClient.delete(TaskType.PROPAGATION, taskTO.getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
PropagationTaskDirectoryPanel.this.getTogglePanel().close(target);
} catch (SyncopeClientException e) {
LOG.error("While deleting {}", taskTO.getKey(), e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
}
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}, ActionLink.ActionType.DELETE, StandardEntitlement.TASK_DELETE, true);
return panel;
}
Aggregations