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

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


    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

            case ACCOUNT:
                if (!(policyTO instanceof AccountPolicyTO)) {
                    throw new ClassCastException("policyTO is expected to be typed AccountPolicyTO: " + 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("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

    public AccountPolicyTO create(final HttpServletResponse response, @RequestBody final AccountPolicyTO policyTO)
            throws SyncopeClientCompositeErrorException {

        LOG.debug("Creating policy " + policyTO);

        final AccountPolicy policy = binder.getPolicy(null, policyTO);

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

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

    @RequestMapping(method = RequestMethod.GET, value = "/account/global/read")
    public AccountPolicyTO getGlobalAccountPolicy() throws NotFoundException {

        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

    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

        return (PasswordPolicyTO) binder.getPolicyTO(policy);
    }

    @PreAuthorize("hasRole('POLICY_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

                }
                break;

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

                if (accountPolicy != null && !accountPolicy.getId().equals(policy.getId())) {
                    throw new InvalidEntityException(PasswordPolicy.class, EntityViolationType.InvalidAccountPolicy,
                            "Global Account policy already exists");
                }
                break;
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.