org.eaglei.repository.auth
Class AuthUserTomcat

java.lang.Object
  extended by org.eaglei.repository.auth.AuthUserTomcat
All Implemented Interfaces:
AuthUser

public class AuthUserTomcat
extends java.lang.Object
implements AuthUser

Simple lightweight class to manage RDBMS authorization system users for the purpose of importing and exporting auth. users.

Author:
Larry Stone Started June 24 2010

Constructor Summary
AuthUserTomcat(java.lang.String u, java.lang.String p, boolean s)
           
 
Method Summary
 boolean authenticate(java.lang.String pw)
          Separate method to test password, in case it's encrypted or something.
 void commit()
          Update auth DB entries if any values have changed.
 void create()
          Create a new user entry.
 void delete()
          Flag this user for deletion upon commit.
 boolean equals(java.lang.Object o)
          
 void flush(java.sql.Connection c)
          Do the actual work to update auth DB entries if any values have changed.
 java.lang.String getPassword()
          Getter
 java.lang.String getUsername()
          Getter
 int hashCode()
          
 boolean isSuperuser()
          Getter
 void setIsSuperuser(boolean su)
          Setter for superuser role
 void setPassword(java.lang.String pw)
          Setter for password
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthUserTomcat

public AuthUserTomcat(java.lang.String u,
                      java.lang.String p,
                      boolean s)
Method Detail

create

public void create()
Create a new user entry. The actual creation is deferred until the commit call. Just mark this object for creation later.

Specified by:
create in interface AuthUser

delete

public void delete()
Flag this user for deletion upon commit.

Specified by:
delete in interface AuthUser

getUsername

public java.lang.String getUsername()
Getter

Specified by:
getUsername in interface AuthUser

getPassword

public java.lang.String getPassword()
Getter

Specified by:
getPassword in interface AuthUser

isSuperuser

public boolean isSuperuser()
Getter

Specified by:
isSuperuser in interface AuthUser

authenticate

public boolean authenticate(java.lang.String pw)
Separate method to test password, in case it's encrypted or something. returns true when authentication succeeds.

Specified by:
authenticate in interface AuthUser
Parameters:
pw - password to try
Returns:
true if it would succeed in authenticating this user

setPassword

public void setPassword(java.lang.String pw)
Setter for password

Specified by:
setPassword in interface AuthUser
Parameters:
pw - new password

setIsSuperuser

public void setIsSuperuser(boolean su)
Setter for superuser role

Specified by:
setIsSuperuser in interface AuthUser
Parameters:
su - new superuser status

commit

public void commit()
            throws javax.servlet.ServletException
Update auth DB entries if any values have changed.

Specified by:
commit in interface AuthUser
Throws:
javax.servlet.ServletException

flush

public void flush(java.sql.Connection c)
           throws javax.servlet.ServletException,
                  javax.naming.NamingException,
                  java.sql.SQLException
Do the actual work to update auth DB entries if any values have changed.

Throws:
javax.servlet.ServletException
javax.naming.NamingException
java.sql.SQLException

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object


Copyright © 2009-2011 Eagle-I. All Rights Reserved.