| 
 | Apache Tomcat 7.0.28 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.catalina.ha.session.SerializablePrincipal
public class SerializablePrincipal
Generic implementation of java.security.Principal that
 is available for use by Realm implementations.
 The GenericPrincipal does NOT implement serializable and I didn't want to
 change that implementation hence I implemented this one instead.
| Field Summary | |
|---|---|
| protected  String | nameThe username of the user represented by this Principal. | 
| protected  String | passwordThe authentication credentials for the user represented by this Principal. | 
| protected  Realm | realmThe Realm with which this Principal is associated. | 
| protected  String[] | rolesThe set of roles associated with this user. | 
| protected static StringManager | smThe string manager for this package. | 
| protected  Principal | userPrincipalThe user principal, if present. | 
| Constructor Summary | |
|---|---|
| SerializablePrincipal() | |
| SerializablePrincipal(String name,
                      String password)Construct a new Principal, associated with the specified Realm, for the specified username and password. | |
| SerializablePrincipal(String name,
                      String password,
                      List<String> roles)Construct a new Principal, associated with the specified Realm, for the specified username and password, with the specified role names (as Strings). | |
| SerializablePrincipal(String name,
                      String password,
                      List<String> 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). | |
| Method Summary | |
|---|---|
| static SerializablePrincipal | createPrincipal(GenericPrincipal principal) | 
|  String | getName() | 
|  String | getPassword() | 
|  GenericPrincipal | getPrincipal() | 
|  Realm | getRealm() | 
|  String[] | getRoles() | 
| static GenericPrincipal | readPrincipal(ObjectInput in) | 
|  void | setRealm(Realm realm) | 
|  String | toString()Return a String representation of this object, which exposes only information that should be public. | 
| static void | writePrincipal(GenericPrincipal p,
               ObjectOutput out) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
protected static final StringManager sm
protected String name
protected String password
protected transient Realm realm
protected String[] roles
protected Principal userPrincipal
| Constructor Detail | 
|---|
public SerializablePrincipal()
public SerializablePrincipal(String name,
                             String password)
name - The username of the user represented by this Principalpassword - Credentials used to authenticate this user
public SerializablePrincipal(String name,
                             String password,
                             List<String> roles)
name - The username of the user represented by this Principalpassword - Credentials used to authenticate this userroles - List of roles (must be Strings) possessed by this user
public SerializablePrincipal(String name,
                             String password,
                             List<String> roles,
                             Principal userPrincipal)
name - The username of the user represented by this Principalpassword - Credentials used to authenticate this userroles - List of roles (must be Strings) possessed by this useruserPrincipal - The user principal to be exposed to applications| Method Detail | 
|---|
public String getName()
public String getPassword()
public Realm getRealm()
public void setRealm(Realm realm)
public String[] getRoles()
public String toString()
toString in class Objectpublic static SerializablePrincipal createPrincipal(GenericPrincipal principal)
public GenericPrincipal getPrincipal()
public static GenericPrincipal readPrincipal(ObjectInput in)
                                      throws IOException,
                                             ClassNotFoundException
IOException
ClassNotFoundException
public static void writePrincipal(GenericPrincipal p,
                                  ObjectOutput out)
                           throws IOException
IOException| 
 | Apache Tomcat 7.0.28 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||