org.keel.services.authentication
Class LoginPrincipal
java.lang.Object
org.keel.services.authentication.LoginPrincipal
- All Implemented Interfaces:
- java.security.Principal, java.io.Serializable
- public class LoginPrincipal
- extends java.lang.Object
- implements java.security.Principal, java.io.Serializable
Basic implementation of the Principal class. By implementing our own Principal for our application, we can more easily add and remove instances of our principals in the authenticated Subject during the login and logout process.
- Version:
- 1.0
- Author:
- Paul Feuer and John Musser
- See Also:
Principal, Serialized Form
| Field Summary |
private java.lang.String |
name
|
| Constructor Summary |
LoginPrincipal()
Create a LoginPrincipal with no user name. |
LoginPrincipal(java.lang.String newName)
Create a LoginPrincipal using a String representation of the user name. |
| Method Summary |
boolean |
equals(java.lang.Object o)
Compares the specified Object with this LoginPrincipal for equality. |
java.lang.String |
getName()
Return the user name for this LoginPrincipal. |
int |
hashCode()
Return a hash code for this LoginPrincipal. |
java.lang.String |
toString()
Return a string representation of this LoginPrincipal. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
name
private java.lang.String name
-
LoginPrincipal
public LoginPrincipal()
-
Create a
LoginPrincipal with no user name.
LoginPrincipal
public LoginPrincipal(java.lang.String newName)
-
Create a
LoginPrincipal using a String representation of the user name.
equals
public boolean equals(java.lang.Object o)
-
Compares the specified Object with this
LoginPrincipal for equality. Returns true if the given object is also a LoginPrincipal and the two LoginPrincipals have the same name.
-
- Specified by:
equals in interface java.security.Principal
-
- Parameters:
o - Object to be compared for equality with this LoginPrincipal.
- Returns:
- true if the specified Object is equal equal to this
LoginPrincipal.
hashCode
public int hashCode()
-
Return a hash code for this
LoginPrincipal.
-
- Specified by:
hashCode in interface java.security.Principal
-
- Returns:
- a hash code for this
LoginPrincipal.
toString
public java.lang.String toString()
-
Return a string representation of this
LoginPrincipal.
-
- Specified by:
toString in interface java.security.Principal
-
- Returns:
- a string representation of this
LoginPrincipal.
getName
public java.lang.String getName()
-
Return the user name for this
LoginPrincipal.
-
- Specified by:
getName in interface java.security.Principal
-
- Returns:
- the user name for this
LoginPrincipal
Please see keelframework.org for information about new Keel releases.