You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Rob Leachman <qu...@bitblaster.com> on 2002/04/17 23:39:44 UTC

extending DBUserManager-how?

Hello,

I'm rather stuck and I think the answer might be "learn
more Java" but am writing anyway. 

Hope this isn't too lame or obvious. How can the 2.1
DBUserManger be extended to have more than the 3 production
exceptions?

I need a confirmed email address as part of the
authentication for my app. I dived into the hooks
provided (TR services.SecurityService.user.manager) and
I thought I was on the right trail, for a little bit.
Now I wonder. How does one do such a thing with 2.1?
(The answers seem to change at 2.2 or 3.0 but for now
I think I need to stay with "production ready").

Maybe some code will make my problem clear? I fear this
will be boorish, oh well here goes, a diff of my attempt
starts like this:

> package cc.rnn.extensions;
> import org.apache.turbine.services.security.db.DBUserManager;
> import cc.rnn.extensions.NoConfirmationException;
92c40
< public class DBUserManager implements UserManager
---
> public class MyDBUserManager extends DBUserManager


and a bit later (diff with context):


       */
      public User retrieve( String username, String password )
           throws PasswordMismatchException, UnknownEntityException, 
!                 DataBackendException, NoConfirmationException
      {
          User user = retrieve(username);
+ 	if (!user.getConfirmed().equals("CONFIRMED"))
+             throw new NoConfirmationException("Unconfirmed!");
          authenticate(user, password);
          return user;
      }


The error:

retrieve(java.lang.String,java.lang.String) in 
{my}.MyDBUserManager cannot override retrieve(
java.lang.String,java.lang.String) in 
org.apache.turbine.services.security.db.DBUserManager; 
overridden method does not throw 
{my}.NoConfirmationException

Thus my question, how can I extend 2.1 DBUserManager
to include a new exception? THANKS


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>