use of com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationActionType in project midpoint by Evolveum.
the class SynchronizationServiceImpl method executeActions.
private <F extends FocusType> void executeActions(SynchronizationReactionType reactionDef, LensContext<F> context, SynchronizationSituation<F> situation, BeforeAfterType order, ResourceType resource, boolean logDebug, Task task, OperationResult parentResult) throws ConfigurationException, SchemaException {
for (SynchronizationActionType actionDef : reactionDef.getAction()) {
if ((actionDef.getOrder() == null && order == BeforeAfterType.BEFORE) || (actionDef.getOrder() != null && actionDef.getOrder() == order)) {
String handlerUri = actionDef.getHandlerUri();
if (handlerUri == null) {
handlerUri = actionDef.getRef();
}
if (handlerUri == null) {
LOGGER.error("Action definition in resource {} doesn't contain handler URI", resource);
throw new ConfigurationException("Action definition in resource " + resource + " doesn't contain handler URI");
}
Action action = actionManager.getActionInstance(handlerUri);
if (action == null) {
LOGGER.warn("Couldn't create action with uri '{}' in resource {}, skipping action.", new Object[] { handlerUri, resource });
continue;
}
// TODO: legacy userTemplate
Map<QName, Object> parameters = null;
if (actionDef.getParameters() != null) {
// TODO: process parameters
// parameters = actionDef.getParameters().getAny();
}
if (logDebug) {
LOGGER.debug("SYNCHRONIZATION: ACTION: Executing: {}.", new Object[] { action.getClass() });
} else {
LOGGER.trace("SYNCHRONIZATION: ACTION: Executing: {}.", new Object[] { action.getClass() });
}
action.handle(context, situation, parameters, task, parentResult);
}
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationActionType in project midpoint by Evolveum.
the class Migrator method migrateObjectSynchronization.
private void migrateObjectSynchronization(ObjectSynchronizationType sync) {
if (sync == null || sync.getReaction() == null) {
return;
}
List<SynchronizationReactionType> migratedReactions = new ArrayList<SynchronizationReactionType>();
for (SynchronizationReactionType reaction : sync.getReaction()) {
if (reaction.getAction() == null) {
continue;
}
List<SynchronizationActionType> migratedAction = new ArrayList<SynchronizationActionType>();
for (SynchronizationActionType action : reaction.getAction()) {
migratedAction.add(migrateAction(action));
}
SynchronizationReactionType migratedReaction = reaction.clone();
migratedReaction.getAction().clear();
migratedReaction.getAction().addAll(migratedAction);
migratedReactions.add(migratedReaction);
}
sync.getReaction().clear();
sync.getReaction().addAll(migratedReactions);
}
Aggregations