|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.common.subject.SubjectPrincipalAnalyzer
public class SubjectPrincipalAnalyzer
Constructor Summary | |
---|---|
SubjectPrincipalAnalyzer(Subject subject)
|
Method Summary | ||
---|---|---|
|
findPrincipal(Class<T> principalClass,
String name)
Gets fist principal of given class with given name. |
|
List<Attribute> |
getAttributes()
Creates a list of Attribute s within the subject. |
|
AttributeValue |
getComplexAttributeValue(String attributeName)
Retrieves the AttributeValue of the first AttributePrincipal with a given name. |
|
Map<String,AttributeValue> |
getComplexAttributeValues(Subject subject)
Creates a map of all attributes with (the last) values as AttributeValue . |
|
|
getPrincipal(Class<T> principalClass)
Gets first principal of given class. |
|
|
getPrincipals(Class<T> principalClass)
|
|
Set<String> |
getRoles()
Retrieves all RolePrincipal names form the subject. |
|
String[] |
getRolesAsArray()
Retrieves all RolePrincipal names form the subject. |
|
Map<String,String> |
getSimpleAttributeValues()
Creates a map of all attributes with (the last) values as string. |
|
String |
getSingleAttributeValue(String attributeName)
Retrieves the value of the first AttributePrincipal with a given name. |
|
Subject |
getSubject()
|
|
String |
getUsername()
Retrieves the username of the subject. |
|
boolean |
isInRole(String role)
Responsible for checking if a user has a given role. |
|
void |
removePrincipal(Principal principal)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubjectPrincipalAnalyzer(Subject subject)
Method Detail |
---|
public String getSingleAttributeValue(String attributeName)
AttributePrincipal
with a given name.
subject
- subject containing the attribute informationattributeName
- the name of the attribute that contains the information.
AttributePrincipal
of the subject
where NamePrincipal.getName()
equals attributeName
, null
if no
such exists.public AttributeValue getComplexAttributeValue(String attributeName)
AttributeValue
of the first AttributePrincipal
with a given name.
subject
- subject containing the attribute informationattributeName
- the name of the attribute that contains the information.
AttributePrincipal
of the subject
where NamePrincipal.getName()
equals attributeName
, null
if no
such exists.public Map<String,String> getSimpleAttributeValues()
public Map<String,AttributeValue> getComplexAttributeValues(Subject subject)
AttributeValue
.
AttributeValue
>public List<Attribute> getAttributes()
Attribute
s within the subject.
subject
-
public String[] getRolesAsArray()
subject
- the current subject.
public Set<String> getRoles()
subject
- the current subject.
public boolean isInRole(String role)
subject
- the current subject.role
- a role name.
public String getUsername()
subject
- containing the username information.
UsernameIDPrincipal
found, null
otherwise.public <T extends Principal> T findPrincipal(Class<T> principalClass, String name)
public <T extends Principal> T getPrincipal(Class<T> principalClass)
public <T extends Principal> Set<T> getPrincipals(Class<T> principalClass)
public void removePrincipal(Principal principal)
public Subject getSubject()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |