jhomenet.security
Class RdbmsPrincipal

java.lang.Object
  extended by jhomenet.security.RdbmsPrincipal
All Implemented Interfaces:
java.io.Serializable, java.security.Principal

public class RdbmsPrincipal
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.

Author:
David Irwin
See Also:
Serialized Form

Constructor Summary
RdbmsPrincipal()
          Create a RdbmsPrincipal with no user name.
RdbmsPrincipal(java.lang.String newName)
          Create a RdbmsPrincipal using a String representation of the user name.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified Object with this RdbmsPrincipal for equality.
 java.lang.String getName()
          Return the user name for this RdbmsPrincipal.
 int hashCode()
          Return a hash code for this RdbmsPrincipal.
 java.lang.String toString()
          Return a string representation of this RdbmsPrincipal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RdbmsPrincipal

public RdbmsPrincipal()
Create a RdbmsPrincipal with no user name.


RdbmsPrincipal

public RdbmsPrincipal(java.lang.String newName)
Create a RdbmsPrincipal using a String representation of the user name.

Parameters:
newName - the user identification number (UID) for this user.
Method Detail

getName

public java.lang.String getName()
Return the user name for this RdbmsPrincipal.

Specified by:
getName in interface java.security.Principal
Returns:
the user name for this RdbmsPrincipal

equals

public boolean equals(java.lang.Object o)
Compares the specified Object with this RdbmsPrincipal for equality. Returns true if the given object is also a RdbmsPrincipal and the two RdbmsPrincipals have the same name.

Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object
Parameters:
o - Object to be compared for equality with this RdbmsPrincipal.
Returns:
true if the specified Object is equal equal to this RdbmsPrincipal.

hashCode

public int hashCode()
Return a hash code for this RdbmsPrincipal.

Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this RdbmsPrincipal.

toString

public java.lang.String toString()
Return a string representation of this RdbmsPrincipal.

Specified by:
toString in interface java.security.Principal
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this RdbmsPrincipal.


Copyright © 2004-2005 David Irwin. All Rights Reserved.