Examples of TaskUtil


Examples of org.apache.syncope.core.util.TaskUtil

        return result;
    }

    protected TaskUtil getTaskUtil(final String kind) {
        TaskUtil result = null;

        try {
            result = TaskUtil.valueOf(kind.toUpperCase());
        } catch (Exception e) {
            LOG.error("Task not supported: " + kind);
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

        return result;
    }

    protected TaskUtil getTaskUtil(final Task task) {
        TaskUtil result = (task instanceof PropagationTask)
                ? TaskUtil.PROPAGATION
                : (task instanceof NotificationTask)
                        ? TaskUtil.NOTIFICATION
                        : (task instanceof SyncTask)
                                ? TaskUtil.SYNC
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

        return result;
    }

    protected TaskUtil getTaskUtil(final TaskTO taskTO) {
        TaskUtil result = (taskTO instanceof PropagationTaskTO)
                ? TaskUtil.PROPAGATION
                : (taskTO instanceof SyncTaskTO)
                        ? TaskUtil.SYNC
                        : (taskTO instanceof SchedTaskTO)
                                ? TaskUtil.SCHED
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

    @PreAuthorize("hasRole('TASK_CREATE')")
    public TaskTO createSchedTaskInternal(final SchedTaskTO taskTO) {
        LOG.debug("Creating task " + taskTO);

        TaskUtil taskUtil = getTaskUtil(taskTO);

        SchedTask task = binder.createSchedTask(taskTO, taskUtil);
        task = taskDAO.save(task);

        try {
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

        SchedTask task = taskDAO.find(taskTO.getId());
        if (task == null) {
            throw new NotFoundException("Task " + taskTO.getId());
        }

        TaskUtil taskUtil = getTaskUtil(task);

        SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);

        binder.updateSchedTask(task, taskTO, taskUtil);
        task = taskDAO.save(task);
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

    }

    @PreAuthorize("hasRole('TASK_LIST')")
    @RequestMapping(method = RequestMethod.GET, value = "/{kind}/list")
    public List<TaskTO> list(@PathVariable("kind") final String kind) {
        TaskUtil taskUtil = getTaskUtil(kind);

        List<Task> tasks = taskDAO.findAll(taskUtil.taskClass());
        List<TaskTO> taskTOs = new ArrayList<TaskTO>(tasks.size());
        for (Task task : tasks) {
            taskTOs.add(binder.getTaskTO(task, taskUtil));
        }
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

    @PreAuthorize("hasRole('TASK_LIST')")
    @RequestMapping(method = RequestMethod.GET, value = "/{kind}/list/{page}/{size}")
    public List<TaskTO> list(@PathVariable("kind") final String kind, @PathVariable("page") final int page,
            @PathVariable("size") final int size) {

        TaskUtil taskUtil = getTaskUtil(kind);

        List<Task> tasks = taskDAO.findAll(page, size, taskUtil.taskClass());
        List<TaskTO> taskTOs = new ArrayList<TaskTO>(tasks.size());
        for (Task task : tasks) {
            taskTOs.add(binder.getTaskTO(task, taskUtil));
        }
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

    public TaskTO read(@PathVariable("taskId") final Long taskId) {
        Task task = taskDAO.find(taskId);
        if (task == null) {
            throw new NotFoundException("Task " + taskId);
        }
        TaskUtil taskUtil = getTaskUtil(task);

        auditManager.audit(Category.task, TaskSubCategory.read, Result.success,
                "Successfully read task: " + task.getId() + "/" + taskUtil);

        return binder.getTaskTO(task, taskUtil);
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

        Task task = taskDAO.find(taskId);
        if (task == null) {
            throw new NotFoundException("Task " + taskId);
        }
        TaskUtil taskUtil = getTaskUtil(task);

        TaskExecTO result = null;
        LOG.debug("Execution started for {}", task);
        switch (taskUtil) {
            case PROPAGATION:
View Full Code Here

Examples of org.apache.syncope.core.util.TaskUtil

        }

        SyncopeClientException sce = new SyncopeClientException(
                SyncopeClientExceptionType.InvalidPropagationTaskExecReport);

        TaskUtil taskUtil = getTaskUtil(exec.getTask());
        if (TaskUtil.PROPAGATION == taskUtil) {
            PropagationTask task = (PropagationTask) exec.getTask();
            if (task.getPropagationMode() != PropagationMode.TWO_PHASES) {
                sce.addElement("Propagation mode: " + task.getPropagationMode());
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.