|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.security.SimplePrincipal (src) org.jboss.security.NestablePrincipal
An implementation of Group that allows that acts as a stack of Principals with a single Principal Group member active at any time. When one adds a Principal to a NestablePrincipal the Principal is pushed onto the active Princpal stack and any of the Group methods operate as though the Group contains only the Principal. When removing the Principal that corresponds to the active Principal, the active Principal is popped from the stack and the new active Principal is effectively set to the new top of the stack. The typical usage of this class is when doing a JAAS LoginContext login to runAs a new Principal with a new CallerPrincipal identity without destroying the current CallerPrincipal identity and roles.
Constructor Summary | |
NestablePrincipal(java.lang.String name)
Creates new NestablePrincipal with the given name |
Method Summary | |
boolean |
addMember(java.security.Principal user)
Pushes the user onto the Principal stack and makes it the active Principal. |
boolean |
isMember(java.security.Principal member)
Returns true if the passed principal is a member of the group. |
java.util.Enumeration |
members()
Returns an enumeration that contains the single active Principal. |
boolean |
removeMember(java.security.Principal user)
Removes the first occurence of user from the Principal stack. |
Methods inherited from class org.jboss.security.SimplePrincipal (src) |
equals, getName, hashCode, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.security.Principal |
equals, getName, hashCode, toString |
Constructor Detail |
public NestablePrincipal(java.lang.String name)
Method Detail |
public java.util.Enumeration members()
members
in interface java.security.acl.Group
public boolean removeMember(java.security.Principal user)
removeMember
in interface java.security.acl.Group
user
- the principal to remove from this group.
public boolean addMember(java.security.Principal user)
addMember
in interface java.security.acl.Group
public boolean isMember(java.security.Principal member)
isMember
in interface java.security.acl.Group
member
- the principal whose membership is to be checked.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |