Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » realm » [javadoc | source]
org.apache.catalina.realm
public class: GenericPrincipal [javadoc | source]
java.lang.Object
   org.apache.catalina.realm.GenericPrincipal

All Implemented Interfaces:
    Principal

Generic implementation of java.security.Principal that is available for use by Realm implementations.
Field Summary
protected  String name    The username of the user represented by this Principal. 
protected  String password    The authentication credentials for the user represented by this Principal. 
protected  Realm realm    The Realm with which this Principal is associated. 
protected  String[] roles    The set of roles associated with this user. 
protected  Principal userPrincipal    The authenticated Principal to be exposed to applications. 
Constructor:
 public GenericPrincipal(Realm realm,
    String name,
    String password) 
    Construct a new Principal, associated with the specified Realm, for the specified username and password.
    Parameters:
    realm - The Realm that owns this Principal
    name - The username of the user represented by this Principal
    password - Credentials used to authenticate this user
 public GenericPrincipal(Realm realm,
    String name,
    String password,
    List roles) 
    Construct a new Principal, associated with the specified Realm, for the specified username and password, with the specified role names (as Strings).
    Parameters:
    realm - The Realm that owns this principal
    name - The username of the user represented by this Principal
    password - Credentials used to authenticate this user
    roles - List of roles (must be Strings) possessed by this user
 public GenericPrincipal(Realm realm,
    String name,
    String password,
    List roles,
    Principal userPrincipal) 
    Construct a new Principal, associated with the specified Realm, for the specified username and password, with the specified role names (as Strings).
    Parameters:
    realm - The Realm that owns this principal
    name - The username of the user represented by this Principal
    password - Credentials used to authenticate this user
    roles - List of roles (must be Strings) possessed by this user
    userPrincipal - - the principal to be returned from the request getUserPrincipal call if not null; if null, this will be returned
Method from org.apache.catalina.realm.GenericPrincipal Summary:
getName,   getPassword,   getRealm,   getRoles,   getUserPrincipal,   hasRole,   setRealm,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.realm.GenericPrincipal Detail:
 public String getName() 
 public String getPassword() 
 public Realm getRealm() 
 public String[] getRoles() 
 public Principal getUserPrincipal() 
 public boolean hasRole(String role) 
    Does the user represented by this Principal possess the specified role?
  void setRealm(Realm realm) 
 public String toString() 
    Return a String representation of this object, which exposes only information that should be public.