org.apache.catalina.ha.session
public class SerializablePrincipal extends Object implements Serializable
Realm
implementations.
The GenericPrincipal does NOT implement serializable and I didn't want to
change that implementation hence I implemented this one instead.Version: $Revision: 610930 $ $Date: 2008-01-10 22:09:27 +0100 (Thu, 10 Jan 2008) $
Field Summary | |
---|---|
protected static Log | log |
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 static StringManager | sm
The string manager for this package. |
protected Principal | userPrincipal
The user principal, if present. |
Constructor Summary | |
---|---|
SerializablePrincipal() | |
SerializablePrincipal(Realm realm, String name, String password)
Construct a new Principal, associated with the specified Realm, for the
specified username and password.
| |
SerializablePrincipal(Realm realm, 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(Realm realm, 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 realm) |
Realm | getRealm() |
String[] | getRoles() |
static GenericPrincipal | readPrincipal(ObjectInput in, Realm realm) |
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) |
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
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
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 user principal to be exposed to applications