Package org.apache.syncope.core.persistence.beans

Examples of org.apache.syncope.core.persistence.beans.AccountPolicy


                }
                break;

            case GLOBAL_ACCOUNT:
                // just one GLOBAL_ACCOUNT policy
                final AccountPolicy accountPolicy = policyDAO.getGlobalAccountPolicy();

                if (accountPolicy != null && !accountPolicy.getId().equals(object.getId())) {
                    context.buildConstraintViolationWithTemplate("Global Account policy already exists").addNode(
                            EntityViolationType.InvalidAccountPolicy.name()).addConstraintViolation();

                    return false;
                }
View Full Code Here


    private List<AccountPolicy> getAccountPolicies(final SyncopeUser user) {
        final List<AccountPolicy> policies = new ArrayList<AccountPolicy>();

        // Add global policy
        AccountPolicy policy = policyDAO.getGlobalAccountPolicy();
        if (policy != null) {
            policies.add(policy);
        }

        // add resource policies
View Full Code Here

                if (!(policyTO instanceof AccountPolicyTO)) {
                    throw new ClassCastException("Expected " + AccountPolicyTO.class.getName()
                            + ", found " + policyTO.getClass().getName());
                }
                if (policy == null) {
                    policy = (T) new AccountPolicy(isGlobal);
                }
                policy.setSpecification(((AccountPolicyTO) policyTO).getSpecification());
                break;

            case GLOBAL_SYNC:
View Full Code Here

    @PreAuthorize("hasRole('POLICY_READ')")
    @RequestMapping(method = RequestMethod.GET, value = "/account/global/read")
    public AccountPolicyTO getGlobalAccountPolicy() {
        LOG.debug("Reading global account policy");

        AccountPolicy policy = policyDAO.getGlobalAccountPolicy();
        if (policy == null) {
            throw new NotFoundException("No account policy found");
        }

        auditManager.audit(Category.policy, PolicySubCategory.read, Result.success,
                "Successfully read global account policy: " + policy.getId());

        return (AccountPolicyTO) binder.getPolicyTO(policy);
    }
View Full Code Here

                if (!(policyTO instanceof AccountPolicyTO)) {
                    throw new ClassCastException("Expected " + AccountPolicyTO.class.getName()
                            + ", found " + policyTO.getClass().getName());
                }
                if (policy == null) {
                    policy = (T) new AccountPolicy(isGlobal);
                }
                policy.setSpecification(((AccountPolicyTO) policyTO).getSpecification());
                break;

            case GLOBAL_SYNC:
View Full Code Here

                }
                break;

            case GLOBAL_ACCOUNT:
                // just one GLOBAL_ACCOUNT policy
                final AccountPolicy accountPolicy = policyDAO.getGlobalAccountPolicy();

                if (accountPolicy != null && !accountPolicy.getId().equals(object.getId())) {
                    context.buildConstraintViolationWithTemplate(getTemplate(
                            EntityViolationType.InvalidAccountPolicy, "Global Account policy already exists")).
                            addNode(object.getClass().getSimpleName()).addConstraintViolation();

                    return false;
View Full Code Here

    private List<AccountPolicy> getAccountPolicies(final SyncopeUser user) {
        final List<AccountPolicy> policies = new ArrayList<AccountPolicy>();

        // Add global policy
        AccountPolicy policy = policyDAO.getGlobalAccountPolicy();
        if (policy != null) {
            policies.add(policy);
        }

        // add resource policies
View Full Code Here

                }
                break;

            case GLOBAL_ACCOUNT:
                // just one GLOBAL_ACCOUNT policy
                final AccountPolicy accountPolicy = policyDAO.getGlobalAccountPolicy();

                if (accountPolicy != null && !accountPolicy.getId().equals(object.getId())) {
                    context.buildConstraintViolationWithTemplate(getTemplate(
                            EntityViolationType.InvalidAccountPolicy, "Global Account policy already exists")).
                            addNode(object.getClass().getSimpleName()).addConstraintViolation();

                    return false;
View Full Code Here

    private List<AccountPolicy> getAccountPolicies(final SyncopeUser user) {
        final List<AccountPolicy> policies = new ArrayList<AccountPolicy>();

        // Add global policy
        AccountPolicy policy = policyDAO.getGlobalAccountPolicy();
        if (policy != null) {
            policies.add(policy);
        }

        // add resource policies
View Full Code Here

    }

    @PreAuthorize("hasRole('POLICY_READ')")
    @RequestMapping(method = RequestMethod.GET, value = "/account/global/read")
    public AccountPolicyTO getGlobalAccountPolicy() {
        AccountPolicy policy = policyDAO.getGlobalAccountPolicy();
        if (policy == null) {
            throw new NotFoundException("No account policy found");
        }

        return (AccountPolicyTO) binder.getPolicyTO(policy);
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.persistence.beans.AccountPolicy

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.