Package org.apache.syncope.core.persistence.dao

Examples of org.apache.syncope.core.persistence.dao.NotFoundException


        if (moreVariables != null && !moreVariables.isEmpty()) {
            variables.putAll(moreVariables);
        }

        if (StringUtils.isBlank(user.getWorkflowId())) {
            throw new WorkflowException(new NotFoundException("Empty workflow id for " + user));
        }

        List<Task> tasks = taskService.createTaskQuery().processInstanceId(user.getWorkflowId()).list();
        if (tasks.size() == 1) {
            try {
View Full Code Here


    @Override
    public void updateDefinition(final WorkflowDefinitionTO definition)
            throws WorkflowException {

        if (!ActivitiUserWorkflowAdapter.WF_PROCESS_ID.equals(definition.getId())) {
            throw new NotFoundException("Workflow process id " + definition.getId());
        }

        try {
            repositoryService.createDeployment().addInputStream(ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE,
                    new ByteArrayInputStream(definition.getXmlDefinition().getBytes())).deploy();
View Full Code Here

    private WorkflowFormTO getFormTO(final Task task, final TaskFormData formData) {
        WorkflowFormTO formTO = new WorkflowFormTO();

        SyncopeUser user = userDAO.findByWorkflowId(task.getProcessInstanceId());
        if (user == null) {
            throw new NotFoundException("User with workflow id " + task.getProcessInstanceId());
        }
        formTO.setUserId(user.getId());

        formTO.setTaskId(task.getId());
        formTO.setKey(formData.getFormKey());
View Full Code Here

    private Map.Entry<Task, TaskFormData> checkTask(final String taskId, final String username) {
        Task task;
        try {
            task = taskService.createTaskQuery().taskId(taskId).singleResult();
        } catch (ActivitiException e) {
            throw new NotFoundException("Activiti Task " + taskId, e);
        }

        TaskFormData formData;
        try {
            formData = formService.getTaskFormData(task.getId());
        } catch (ActivitiException e) {
            throw new NotFoundException("Form for Activiti Task " + taskId, e);
        }

        if (!adminUser.equals(username)) {
            SyncopeUser user = userDAO.find(username);
            if (user == null) {
                throw new NotFoundException("Syncope User " + username);
            }
        }

        return new SimpleEntry<Task, TaskFormData>(task, formData);
    }
View Full Code Here

                    + checked.getKey().getOwner() + " but submited by " + username));
        }

        SyncopeUser user = userDAO.findByWorkflowId(checked.getKey().getProcessInstanceId());
        if (user == null) {
            throw new NotFoundException("User with workflow id " + checked.getKey().getProcessInstanceId());
        }

        Set<String> preTasks = getPerformedTasks(user);
        try {
            formService.submitTaskFormData(form.getTaskId(), form.getPropertiesForSubmit());
View Full Code Here

    @PreAuthorize("hasRole('POLICY_UPDATE')")
    @RequestMapping(method = RequestMethod.POST, value = "/password/update")
    public PasswordPolicyTO update(@RequestBody final PasswordPolicyTO policyTO) {
        Policy policy = policyDAO.find(policyTO.getId());
        if (!(policy instanceof PasswordPolicy)) {
            throw new NotFoundException("PasswordPolicy with id " + policyTO.getId());
        }

        return update(policyTO, policy);
    }
View Full Code Here

    @PreAuthorize("hasRole('POLICY_UPDATE')")
    @RequestMapping(method = RequestMethod.POST, value = "/account/update")
    public AccountPolicyTO update(@RequestBody final AccountPolicyTO policyTO) {
        Policy policy = policyDAO.find(policyTO.getId());
        if (!(policy instanceof AccountPolicy)) {
            throw new NotFoundException("AccountPolicy with id " + policyTO.getId());
        }

        return update(policyTO, policy);
    }
View Full Code Here

    }

    public ConnInstance getConnInstance(final ResourceTO resourceTO) {
        ConnInstance connInstance = connInstanceDAO.find(resourceTO.getConnectorId());
        if (connInstance == null) {
            throw new NotFoundException("Connector '" + resourceTO.getConnectorId() + "'");
        }

        final ConnInstance connInstanceClone = (ConnInstance) SerializationUtils.clone(connInstance);
        return getConnInstance(connInstanceClone, resourceTO.getConnConfProperties());
    }
View Full Code Here

            }
            SyncTaskTO syncTaskTO = (SyncTaskTO) taskTO;

            ExternalResource resource = resourceDAO.find(syncTaskTO.getResource());
            if (resource == null) {
                throw new NotFoundException("Resource " + syncTaskTO.getResource());
            }
            ((SyncTask) task).setResource(resource);

            fill((SyncTask) task, syncTaskTO);
        }
View Full Code Here

    @Transactional(readOnly = true)
    public RoleTO selfRead(@PathVariable("roleId") final Long roleId) {
        // Explicit search instead of using binder.getRoleFromId() in order to bypass auth checks - will do here
        SyncopeRole role = roleDAO.find(roleId);
        if (role == null) {
            throw new NotFoundException("Role " + roleId);
        }

        Set<Long> ownedRoleIds;
        SyncopeUser authUser = userDAO.find(SecurityContextHolder.getContext().getAuthentication().getName());
        if (authUser == null) {
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.persistence.dao.NotFoundException

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.