public class Credential
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Credential(java.lang.String username)
Create a user credential with the specified username.
|
Credential(java.lang.String username,
java.util.Set<Group> groups,
java.util.Set<Attribute> attributes)
Create a user credential with the specified username, group set, and
attribute set.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Attribute attribute)
Add the specified attribute to the attribute set.
|
void |
addGroup(Group group)
Add the specified group to the group set.
|
Attribute |
getAttribute(java.lang.String name)
Get the attribute with the specified name from the attribute set.
|
java.util.Set<Attribute> |
getAttributes()
Get the attribute set.
|
Group |
getGroup(java.lang.String name)
Get the group with the specified name.
|
java.util.Set<Group> |
getGroups()
Get the group set.
|
java.lang.String |
getUsername()
Get the username.
|
boolean |
hasAttribute(java.lang.String name)
Check whether there is an attribute with the specified name in the
attribute set.
|
boolean |
hasGroup(java.lang.String name)
Check whether there is a group with the specified name in the group set.
|
void |
removeAttribute(java.lang.String name)
Remove the attribute with the specified name from the attribute set.
|
void |
removeGroup(java.lang.String name)
Remove the group with the specified name from the group set.
|
void |
setAttributes(java.util.Set<Attribute> attributes)
Set the attribute set.
|
void |
setGroups(java.util.Set<Group> groups)
Set the group set.
|
public Credential(java.lang.String username)
username
- The username.public java.lang.String getUsername()
public java.util.Set<Group> getGroups()
setGroups(Set)
to persist the modifications.public void setGroups(java.util.Set<Group> groups)
groups
- The group set.public Group getGroup(java.lang.String name)
name
- The name.public void addGroup(Group group)
group
- The group.public boolean hasGroup(java.lang.String name)
name
- The name.public void removeGroup(java.lang.String name)
name
- The name.public java.util.Set<Attribute> getAttributes()
setAttributes(Set)
to persist the
modifications.public void setAttributes(java.util.Set<Attribute> attributes)
attributes
- The attribute set.public Attribute getAttribute(java.lang.String name)
name
- The name.public void addAttribute(Attribute attribute)
attribute
- The attribute.public boolean hasAttribute(java.lang.String name)
name
- The name.public void removeAttribute(java.lang.String name)
name
- The name.