public class AuthenticatedPrincipal extends Object implements Serializable, Principal
Principal that can contain roles and additional attributes. This is
the return Object for AbstractAuthenticator implementations.| Constructor and Description |
|---|
AuthenticatedPrincipal() |
AuthenticatedPrincipal(String username) |
AuthenticatedPrincipal(String username,
Collection<String> roles) |
AuthenticatedPrincipal(String username,
Collection<String> roles,
Map<String,String> attributes) |
AuthenticatedPrincipal(String username,
Collection<String> roles,
Map<String,String> attributes,
Collection<String> groups) |
AuthenticatedPrincipal(String username,
Collection<String> roles,
Map<String,String> attributes,
Collection<String> groups,
boolean adminPrincipal) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(String key,
String value) |
void |
addGroup(String name) |
static AuthenticatedPrincipal |
deserialize(String json) |
String |
getAttribute(String key)
Get the given attribute.
|
Map<String,String> |
getAttributes() |
String |
getDisplayName() |
Collection<String> |
getGroups() |
String |
getName() |
Collection<String> |
getRoles() |
boolean |
isAdminPrincipal() |
boolean |
isGroupAware() |
String |
serialize() |
void |
setAdminPrincipal(boolean adminPrincipal) |
void |
setAttributes(Map<String,String> attributes) |
void |
setGroups(Collection<String> groups) |
void |
setName(String name) |
void |
setRoles(Collection<String> roles) |
String |
toString() |
public AuthenticatedPrincipal()
public AuthenticatedPrincipal(String username)
public AuthenticatedPrincipal(String username, Collection<String> roles)
public AuthenticatedPrincipal(String username, Collection<String> roles, Map<String,String> attributes)
public AuthenticatedPrincipal(String username, Collection<String> roles, Map<String,String> attributes, Collection<String> groups)
public AuthenticatedPrincipal(String username, Collection<String> roles, Map<String,String> attributes, Collection<String> groups, boolean adminPrincipal)
public Collection<String> getRoles()
public String getAttribute(String key)
key - the attribute key to get.public void addGroup(String name)
public String getDisplayName()
public String toString()
public void setName(String name)
name - the name to setpublic void setRoles(Collection<String> roles)
roles - the roles to setpublic void setAttributes(Map<String,String> attributes)
attributes - the attributes to setpublic Collection<String> getGroups()
public void setGroups(Collection<String> groups)
public boolean isGroupAware()
public boolean isAdminPrincipal()
public void setAdminPrincipal(boolean adminPrincipal)
public String serialize()
public static AuthenticatedPrincipal deserialize(String json)
Copyright © 2012–2014 SURFnet bv, The Netherlands. All rights reserved.