|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.SimplePrincipal (src)
org.jboss.security.NestableGroup
An implementation of Group that allows that acts as a stack of Groups with a single Group member active at any time. When one adds a Group to a NestableGroup the Group is pushed onto the active Group stack and any of the Group methods operate as though the NestableGroup contains only the Group. When removing the Group that corresponds to the active Group, the active Group is popped from the stack and the new active Group is 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 set of roles that should be added without destroying the current identity and roles.
Constructor Summary | |
NestableGroup(java.lang.String name)
Creates new NestableGroup with the given name |
Method Summary | |
boolean |
addMember(java.security.Principal group)
Pushes the group onto the Group stack and makes it the active Group. |
boolean |
isMember(java.security.Principal member)
Returns true if the passed principal is a member of the active 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. |
java.lang.String |
toString()
|
Methods inherited from class org.jboss.security.SimplePrincipal (src) |
equals, getName, hashCode |
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 |
Constructor Detail |
public NestableGroup(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 group) throws java.lang.IllegalArgumentException
addMember
in interface java.security.acl.Group
group
- the instance of Group that contains the roles to set as the
active Group.
java.lang.IllegalArgumentException
- thrown if group is not an instance of Group.public boolean isMember(java.security.Principal member)
isMember
in interface java.security.acl.Group
member
- the principal whose membership is to be checked.
public java.lang.String toString()
toString
in interface java.security.Principal
toString
in class SimplePrincipal (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |