org.objectweb.cjdbc.common.users
Class AbstractDatabaseUser

java.lang.Object
  extended byorg.objectweb.cjdbc.common.users.AbstractDatabaseUser
All Implemented Interfaces:
java.security.Principal, java.io.Serializable
Direct Known Subclasses:
AdminUser, DatabaseBackendUser, VirtualDatabaseUser

public abstract class AbstractDatabaseUser
extends java.lang.Object
implements java.io.Serializable, java.security.Principal

An AbstractDatabaseUser is just a login/password combination to represent an abstract database user.

Version:
1.0
Author:
Emmanuel Cecchet
See Also:
Serialized Form

Field Summary
protected  java.lang.String login
          Login name.
protected  java.lang.String password
          Password.
 
Constructor Summary
protected AbstractDatabaseUser(java.lang.String login, java.lang.String password)
          Creates a new AbstractDatabaseUser instance.
 
Method Summary
 boolean equals(java.lang.Object other)
          Two AbstractDatabaseUser are equals if both objects have same login & password.
 java.lang.String getLogin()
          Gets the login name.
 java.lang.String getName()
          Gets the login name.
 java.lang.String getPassword()
          Gets the password.
abstract  java.lang.String getXml()
           
 boolean matches(java.lang.String login, java.lang.String password)
          Tests if the login and password provided matches the login/password of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
hashCode, toString
 

Field Detail

login

protected java.lang.String login
Login name.


password

protected java.lang.String password
Password.

Constructor Detail

AbstractDatabaseUser

protected AbstractDatabaseUser(java.lang.String login,
                               java.lang.String password)
Creates a new AbstractDatabaseUser instance. The caller must ensure that the parameters are not null.

Parameters:
login - the user name.
password - the password.
Method Detail

getLogin

public java.lang.String getLogin()
Gets the login name.

Returns:
the login name.

getName

public java.lang.String getName()
Gets the login name.

Specified by:
getName in interface java.security.Principal
Returns:
the login name.

getPassword

public java.lang.String getPassword()
Gets the password.

Returns:
the password.

matches

public boolean matches(java.lang.String login,
                       java.lang.String password)
Tests if the login and password provided matches the login/password of this object.

Parameters:
login - a user name.
password - a password.
Returns:
true if it matches this object's login/password.

equals

public boolean equals(java.lang.Object other)
Two AbstractDatabaseUser are equals if both objects have same login & password.

Specified by:
equals in interface java.security.Principal
Parameters:
other - the object to compare with.
Returns:
true if both objects have same login & password.

getXml

public abstract java.lang.String getXml()
See Also:
XmlComponent.getXml()


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.