Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.Credential


        moveRole(accreditable, role, true);
    }

    private void moveRole(Accreditable accreditable, Role role, boolean down) {

        Credential cred = getCredential(accreditable, role);
        int position = this.credentials.indexOf(cred);

        if (!down && position > 0) {
            this.credentials.remove(cred);
            this.credentials.add(position - 1, cred);
View Full Code Here


        Accreditable[] accreditables = identity.getAccreditables();
        Credential[] credentials = getCredentials();
        Set returnCredential = new LinkedHashSet();

        for (int credIndex = 0; credIndex < credentials.length; credIndex++) {
            Credential credential = credentials[credIndex];
           
            for (int accrIndex = 0; accrIndex < accreditables.length; accrIndex++) {
                Accreditable accreditable = accreditables[accrIndex];

                if (credential.getAccreditable().equals(accreditable)) {
                    returnCredential.add(credential);
                }
            }
        }
View Full Code Here

    public boolean equals(Object obj) {
        if (!getClass().isInstance(obj)) {
            return false;
        }
        Credential cred = (Credential) obj;
        return cred.getAccreditable().equals(getAccreditable()) && cred.getRole().equals(getRole());
    }
View Full Code Here

            Policy policy = buildSubtreePolicy(controller, url);
            Credential[] tmp = policy.getCredentials();
            // we need to revert the order of the credentials
            // to keep the most important policy on top
            for (int j = tmp.length - 1; j >= 0; j--) {
                Credential credential = tmp[j];
                orderedCredential.put(String.valueOf(position), credential);
                position++;
            }
        }
        Credential[] returnCredential = new CredentialImpl[orderedCredential.size()];
View Full Code Here

        for (int i = 0; i < credentials.length; i++) {
            Role role = credentials[i].getRole();
            CredentialImpl credential = new CredentialImpl(credentials[i].getAccreditable(), role);
            credential.setMethod(credential.getMethod());
            Credential newCredential = null;

            for (int k = 0; k < newCredentials.length; k++) {
                if (newCredentials[k].getAccreditable().equals(credential.getAccreditable())) {
                    newCredential = newCredentials[k];
                }
            }

            getLogger().info("Accreditable: [" + credential.getAccreditable() + "]");
            assertNotNull(newCredential);

            Role oldRole = credential.getRole();
            Role newRole = newCredential.getRole();
            assertEquals(oldRole, newRole);

            /*
             * for (int j = 0; j < roles.length; j++) { assertEquals(roles[j],
             * newRoles[j]); getLogger().info(" Role: [" + roles[j] + "]"); }
View Full Code Here

TOP

Related Classes of org.apache.lenya.ac.Credential

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.