Code example for Principal

Methods: getName

0
        } 
    } 
 
    /** {@inheritDoc} */ 
    public Principal authenticate(final Principal p) {
        if (this.roleMap.containsKey(p.getName())) {
            return p;
        } else { 
            return null; 
        } 
    } 
 
    /** {@inheritDoc} */ 
    public String[] getRoles(final Principal p) {
        final Set<String> roleSet = this.roleMap.get(p.getName());
        return roleSet.toArray(new String[roleSet.size()]);
    } 
 
    /** {@inheritDoc} */ 
    public boolean hasRole(final Principal principal, final String role) {