james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Benett <char...@benett1.demon.co.uk>
Subject Re: Working on UsersJDBCRepository.
Date Fri, 08 Jun 2001 09:26:47 GMT
Hi, Darrell,

Darrell DeBoer wrote:
> Hi all,
> I've just started playing around with the James source, and was hoping to
> help out. Looking at the TODO, I saw that a direct JDBC repository for Users
> and Mail was a high priority, and decided to try tackling that (User
> repository first).

Great! Help with db storage would be a big help.

> However, I've noticed that there's a bit of activity in CVS around the
> userrepository, and I don't want to waste my time on something that is
> already being completed. I noticed a reference to a "UsersJDBCRepository" in
> the james-config file, but it's not in CVS. Has this been implemented?
> Otherwise, that's where I'm planning to start.

I started fiddling with a UsersJDBCRepository, but I haven't got
anywhere with it.
I'd be v happy for you to jump in. (I'm not a db guru)

> Basically, my plans are:
> 1) Create
>         AbstractUsersRepository implements UsersRepository
> with all methods implemented on top of a few core protected methods
> (eg
>         addUser(JamesUser user),
>         removeUser(JamesUser user),
>         updateUser(JamesUser user),
>         Iterator listAllUsers() { returns an Iterator of JamesUser instances };
> )
> This will make it very easy to implement a new UserRepository, and overriding
> other methods could make it faster, if looping through all the users to find
> one proves to be too slow.
> 2) Create:
>         UsersJDBCRepository extends AbstractUsersRepository
> which executes CallableStatements on the database connection for all database
> access. This keeps the SQL generation and database peculiarities out of the
> code.

And make proposals/v1.3/.../UsersFileRepository extend

> 3) For now, just update the sql scripts which create the tables to also
> create Stored Procs on the database. I've got access to Postgresql and Oracle
> installs, so I'll do up scripts for those as well.

Can you do MySQL as well?

> 4) I haven't looked at the Mail repository yet, but I assume a similar JDBC
> implementation could be used there.

Sounds reasonable. 

> 5) Longer term, we could have the tables and procedures created automatically
> as part of installation, but this is probably low priority.
> Your comments would be appreciated. If I'm stepping on someones toes here let
> me know, and I'll look through the code for something else that I think I can
> do...

Go for it!

To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org

View raw message