Package org.apache.syncope.core.propagation

Examples of org.apache.syncope.core.propagation.PropagationReporter


        WorkflowResult<Long> created = rwfAdapter.create(actual);

        EntitlementUtil.extendAuthContext(created.getResult());

        List<PropagationTask> tasks = propagationManager.getRoleCreateTaskIds(created, actual.getVirtualAttributes());
        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propagationReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propagationReporter.onPrimaryResourceFailure(tasks);
        }

        response.setStatus(HttpServletResponse.SC_CREATED);

        final RoleTO savedTO = binder.getRoleTO(created.getResult());
        savedTO.setPropagationStatusTOs(propagationReporter.getStatuses());
        return savedTO;
    }
View Full Code Here


         */
        WorkflowResult<Long> updated = rwfAdapter.update(actual);

        List<PropagationTask> tasks = propagationManager.getRoleUpdateTaskIds(updated,
                actual.getVirtualAttributesToBeRemoved(), actual.getVirtualAttributesToBeUpdated());
        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propagationReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propagationReporter.onPrimaryResourceFailure(tasks);
        }
        final RoleTO updatedTO = binder.getRoleTO(updated.getResult());
        updatedTO.setPropagationStatusTOs(propagationReporter.getStatuses());
        return updatedTO;
    }
View Full Code Here

        }

        RoleTO roleTO = new RoleTO();
        roleTO.setId(roleId);

        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propagationReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propagationReporter.onPrimaryResourceFailure(tasks);
        }
        roleTO.setPropagationStatusTOs(propagationReporter.getStatuses());

        rwfAdapter.delete(roleId);

        return roleTO;
    }
View Full Code Here

         */
        WorkflowResult<Map.Entry<Long, Boolean>> created = uwfAdapter.create(actual);

        List<PropagationTask> tasks = propagationManager.getUserCreateTaskIds(
                created, actual.getPassword(), actual.getVirtualAttributes());
        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propagationReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propagationReporter.onPrimaryResourceFailure(tasks);
        }

        final UserTO savedTO = binder.getUserTO(created.getResult().getKey());
        savedTO.setPropagationStatusTOs(propagationReporter.getStatuses());
        return savedTO;
    }
View Full Code Here

            }

            updated.setPropByRes(origPropByRes);
        }

        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);

        if (tasks.isEmpty()) {
            // SYNCOPE-459: take care of user virtual attributes ...
            final PropagationByResource propByResVirAttr = binder.forceVirtualAttributes(
                    updated.getResult().getKey(),
                    actual.getVirtualAttributesToBeRemoved(),
                    actual.getVirtualAttributesToBeUpdated());
            // SYNCOPE-501: update only virtual attributes (if any of them changed), change password must be null
            tasks.addAll(propByResVirAttr.isEmpty() ? Collections.<PropagationTask>emptyList()
                    : propagationManager.getUserUpdateTaskIds(updated, null, actual.
                            getVirtualAttributesToBeRemoved(), actual.getVirtualAttributesToBeUpdated()));
        }

        if (!tasks.isEmpty()) {
            try {
                taskExecutor.execute(tasks, propagationReporter);
            } catch (PropagationException e) {
                LOG.error("Error propagation primary resource", e);
                propagationReporter.onPrimaryResourceFailure(tasks);
            }
        }

        // 4. prepare result, including propagation status on external resources
        final UserTO updatedTO = binder.getUserTO(updated.getResult().getKey());
        updatedTO.setPropagationStatusTOs(propagationReporter.getStatuses());
        return updatedTO;
    }
View Full Code Here

        if (propagationRequestTO != null) {
            resourcesToBeExcluded.removeAll(propagationRequestTO.getResources());
        }

        List<PropagationTask> tasks = propagationManager.getUserUpdateTaskIds(user, status, resourcesToBeExcluded);
        PropagationReporter propReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propReporter.onPrimaryResourceFailure(tasks);
        }

        final UserTO savedTO = binder.getUserTO(updated.getResult());
        savedTO.setPropagationStatusTOs(propReporter.getStatuses());
        return savedTO;
    }
View Full Code Here

        List<PropagationTask> tasks = propagationManager.getUserDeleteTaskIds(userId);

        final UserTO userTO = new UserTO();
        userTO.setId(userId);

        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propagationReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propagationReporter.onPrimaryResourceFailure(tasks);
        }

        userTO.setPropagationStatusTOs(propagationReporter.getStatuses());

        uwfAdapter.delete(userId);

        return userTO;
    }
View Full Code Here

         */
        WorkflowResult<Map.Entry<Long, Boolean>> created = uwfAdapter.create(actual);

        List<PropagationTask> tasks = propagationManager.getUserCreateTaskIds(
                created, actual.getPassword(), actual.getVirtualAttributes());
        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propagationReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propagationReporter.onPrimaryResourceFailure(tasks);
        }

        final UserTO savedTO = binder.getUserTO(created.getResult().getKey());
        savedTO.setPropagationStatusTOs(propagationReporter.getStatuses());
        return savedTO;
    }
View Full Code Here

            }

            updated.setPropByRes(origPropByRes);
        }

        PropagationReporter propagationReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propagationReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propagationReporter.onPrimaryResourceFailure(tasks);
        }

        // 4. prepare result, including propagation status on external resources
        final UserTO updatedTO = binder.getUserTO(updated.getResult().getKey());
        updatedTO.setPropagationStatusTOs(propagationReporter.getStatuses());
        return updatedTO;
    }
View Full Code Here

        if (propagationRequestTO != null) {
            resourcesToBeExcluded.removeAll(propagationRequestTO.getResources());
        }

        List<PropagationTask> tasks = propagationManager.getUserUpdateTaskIds(user, status, resourcesToBeExcluded);
        PropagationReporter propReporter =
                ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
        try {
            taskExecutor.execute(tasks, propReporter);
        } catch (PropagationException e) {
            LOG.error("Error propagation primary resource", e);
            propReporter.onPrimaryResourceFailure(tasks);
        }

        final UserTO savedTO = binder.getUserTO(updated.getResult());
        savedTO.setPropagationStatusTOs(propReporter.getStatuses());
        return savedTO;
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.propagation.PropagationReporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.