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

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


        if (subjectTO instanceof UserTO && StringUtils.isBlank(((UserTO) subjectTO).getPassword())) {
            final UserTO userTO = (UserTO) subjectTO;

            List<PasswordPolicySpec> ppSpecs = new ArrayList<PasswordPolicySpec>();

            PasswordPolicy globalPP = policyDAO.getGlobalPasswordPolicy();
            if (globalPP != null && globalPP.getSpecification() != null) {
                ppSpecs.add(globalPP.<PasswordPolicySpec>getSpecification());
            }

            for (MembershipTO memb : userTO.getMemberships()) {
                SyncopeRole role = roleDAO.find(memb.getRoleId());
                if (role != null && role.getPasswordPolicy() != null
View Full Code Here


    public String generate(final SyncopeUser user)
            throws InvalidPasswordPolicySpecException {

        List<PasswordPolicySpec> ppSpecs = new ArrayList<PasswordPolicySpec>();

        PasswordPolicy globalPP = policyDAO.getGlobalPasswordPolicy();
        if (globalPP != null && globalPP.getSpecification() != null) {
            ppSpecs.add(globalPP.<PasswordPolicySpec>getSpecification());
        }

        for (SyncopeRole role : user.getRoles()) {
            if (role.getPasswordPolicy() != null && role.getPasswordPolicy().getSpecification() != null) {
                ppSpecs.add(role.getPasswordPolicy().<PasswordPolicySpec>getSpecification());
View Full Code Here

        if (subjectTO instanceof UserTO && StringUtils.isBlank(((UserTO) subjectTO).getPassword())) {
            final UserTO userTO = (UserTO) subjectTO;

            List<PasswordPolicySpec> ppSpecs = new ArrayList<PasswordPolicySpec>();

            PasswordPolicy globalPP = policyDAO.getGlobalPasswordPolicy();
            if (globalPP != null && globalPP.getSpecification() != null) {
                ppSpecs.add(globalPP.<PasswordPolicySpec>getSpecification());
            }

            for (MembershipTO memb : userTO.getMemberships()) {
                SyncopeRole role = roleDAO.find(memb.getRoleId());
                if (role != null && role.getPasswordPolicy() != null
View Full Code Here

    private void setPassword(final SyncopeUser user, final String password,
            final SyncopeClientCompositeErrorException scce) {

        int passwordHistorySize = 0;
        PasswordPolicy policy = policyDAO.getGlobalPasswordPolicy();
        if (policy != null && policy.getSpecification() != null) {
            passwordHistorySize = policy.<PasswordPolicySpec>getSpecification().getHistoryLength();
        }

        try {
            user.setPassword(password, getPredefinedCipherAlgoritm(), passwordHistorySize);
        } catch (NotFoundException e) {
View Full Code Here

    private void setPassword(final SyncopeUser user, final String password,
            final SyncopeClientCompositeErrorException scce) {

        int passwordHistorySize = 0;
        PasswordPolicy policy = policyDAO.getGlobalPasswordPolicy();
        if (policy != null && policy.getSpecification() != null) {
            passwordHistorySize = policy.<PasswordPolicySpec>getSpecification().getHistoryLength();
        }

        try {
            user.setPassword(password, getPredefinedCipherAlgoritm(), passwordHistorySize);
        } catch (NotFoundException e) {
View Full Code Here

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

            case GLOBAL_ACCOUNT:
View Full Code Here

    private void setPassword(final SyncopeUser user, final String password,
            final SyncopeClientCompositeErrorException scce) {

        int passwordHistorySize = 0;
        PasswordPolicy policy = policyDAO.getGlobalPasswordPolicy();
        if (policy != null && policy.getSpecification() != null) {
            passwordHistorySize = policy.<PasswordPolicySpec>getSpecification().getHistoryLength();
        }

        try {
            user.setPassword(password, getPredefinedCipherAlgoritm(), passwordHistorySize);
        } catch (NotFoundException e) {
View Full Code Here

        if (subjectTO instanceof UserTO && StringUtils.isBlank(((UserTO) subjectTO).getPassword())) {
            final UserTO userTO = (UserTO) subjectTO;

            List<PasswordPolicySpec> ppSpecs = new ArrayList<PasswordPolicySpec>();

            PasswordPolicy globalPP = policyDAO.getGlobalPasswordPolicy();
            if (globalPP != null && globalPP.getSpecification() != null) {
                ppSpecs.add(globalPP.<PasswordPolicySpec>getSpecification());
            }

            for (MembershipTO memb : userTO.getMemberships()) {
                SyncopeRole role = roleDAO.find(memb.getRoleId());
                if (role != null && role.getPasswordPolicy() != null
View Full Code Here

        }

        switch (object.getType()) {
            case GLOBAL_PASSWORD:
                // just one GLOBAL_PASSWORD policy
                final PasswordPolicy passwordPolicy = policyDAO.getGlobalPasswordPolicy();

                if (passwordPolicy != null && !passwordPolicy.getId().equals(object.getId())) {
                    context.buildConstraintViolationWithTemplate(
                            getTemplate(EntityViolationType.InvalidPasswordPolicy, "Password policy already exists")).
                            addNode(object.getClass().getSimpleName()).addConstraintViolation();

                    return false;
View Full Code Here

    private List<PasswordPolicy> getPasswordPolicies(final SyncopeUser user) {
        final List<PasswordPolicy> policies = new ArrayList<PasswordPolicy>();

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

        // add resource policies
View Full Code Here

TOP

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

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.