org.jboss.security
Class RunAsIdentity

java.lang.Object
  extended byorg.jboss.security.SimplePrincipal (src) 
      extended byorg.jboss.security.CallerIdentity (src) 
          extended byorg.jboss.security.RunAsIdentity
All Implemented Interfaces:
java.security.Principal, java.io.Serializable

public class RunAsIdentity
extends CallerIdentity (src)

The RunAsIdentity is a Principal that associates the run-as principal with his run-as role(s).

See Also:
Serialized Form

Constructor Summary
RunAsIdentity(java.lang.String roleName, java.lang.String principalName)
          Construct an inmutable instance of a RunAsIdentity
RunAsIdentity(java.lang.String roleName, java.lang.String principalName, java.util.Set extraRoleNames)
          Construct an inmutable instance of a RunAsIdentity
 
Method Summary
 boolean doesUserHaveRole(java.security.Principal role)
           
 boolean doesUserHaveRole(java.util.Set methodRoles)
          True if the run-as principal has any of the method roles
 java.util.Set getRunAsRoles()
           
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jboss.security.CallerIdentity (src)
equals, getCredential, hashCode
 
Methods inherited from class org.jboss.security.SimplePrincipal (src)
getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RunAsIdentity

public RunAsIdentity(java.lang.String roleName,
                     java.lang.String principalName)
Construct an inmutable instance of a RunAsIdentity


RunAsIdentity

public RunAsIdentity(java.lang.String roleName,
                     java.lang.String principalName,
                     java.util.Set extraRoleNames)
Construct an inmutable instance of a RunAsIdentity

Method Detail

getRunAsRoles

public java.util.Set getRunAsRoles()

doesUserHaveRole

public boolean doesUserHaveRole(java.security.Principal role)

doesUserHaveRole

public boolean doesUserHaveRole(java.util.Set methodRoles)
True if the run-as principal has any of the method roles


toString

public java.lang.String toString()
Returns a string representation of the object.

Specified by:
toString in interface java.security.Principal
Overrides:
toString in class CallerIdentity (src)
Returns:
a string representation of the object.