Package org.rhq.core.domain.auth

Examples of org.rhq.core.domain.auth.Principal


    /**
     * @see org.rhq.enterprise.server.auth.SubjectManagerLocal#createPrincipal(Subject, String, String)
     */
    @RequiredPermission(Permission.MANAGE_SECURITY)
    public void createPrincipal(Subject whoami, String username, String password) throws SubjectException {
        Principal principal = new Principal(username, CryptoUtil.createPasswordHash("MD5", "base64", null, null,
            password));
        createPrincipal(whoami, principal);
    }
View Full Code Here


    }

    private void changePasswordInternal(String username, String password) {
        Query query = entityManager.createNamedQuery(Principal.QUERY_FIND_BY_USERNAME);
        query.setParameter("principal", username);
        Principal principal = (Principal) query.getSingleResult();
        String passwordHash = CryptoUtil.createPasswordHash("MD5", CryptoUtil.BASE64_ENCODING, null, null, password);
        principal.setPassword(passwordHash);
    }
View Full Code Here

     */
    public boolean isUserWithPrincipal(String username) {
        try {
            Query q = entityManager.createNamedQuery(Principal.QUERY_FIND_BY_USERNAME);
            q.setParameter("principal", username);
            Principal principal = (Principal) q.getSingleResult();
            return (principal != null);
        } catch (NoResultException e) {
            return false;
        }
    }
View Full Code Here

                + "]");
        }

        Query q = entityManager.createNamedQuery(Principal.QUERY_FIND_BY_USERNAME);
        q.setParameter("principal", subject.getName());
        Principal principal = (Principal) q.getSingleResult();
        entityManager.remove(principal);
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.auth.Principal

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.