Pass the user repository in to the user manager rather than constructing
it so that applications that care to do so can use their own custom user repository. git-svn-id: https://samskivert.googlecode.com/svn/trunk@720 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: UserManager.java,v 1.10 2001/09/21 03:01:46 mdb Exp $
|
// $Id: UserManager.java,v 1.11 2002/05/01 01:50:05 shaper Exp $
|
||||||
//
|
//
|
||||||
// samskivert library - useful routines for java programs
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -39,9 +39,8 @@ import com.samskivert.util.*;
|
|||||||
public class UserManager
|
public class UserManager
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* A user manager creates a user repository through which to load and
|
* A user manager must be supplied with a {@link UserRepository}
|
||||||
* save user records. A connection provider must be supplied via which
|
* through which it loads and saves user records.
|
||||||
* the user repository can obtain its database connection.
|
|
||||||
*
|
*
|
||||||
* <p> Presently the user manager requires the following configuration
|
* <p> Presently the user manager requires the following configuration
|
||||||
* information:
|
* information:
|
||||||
@@ -61,16 +60,14 @@ public class UserManager
|
|||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param config the user manager configuration properties.
|
* @param config the user manager configuration properties.
|
||||||
* @param provider a database connection provider that will be used by
|
* @param repository the user repository through which user records
|
||||||
* the user repository to obtain it's database connection.
|
* are loaded and saved.
|
||||||
*
|
|
||||||
* @see UserRepository#UserRepository
|
|
||||||
*/
|
*/
|
||||||
public UserManager (Properties config, ConnectionProvider provider)
|
public UserManager (Properties config, UserRepository repository)
|
||||||
throws PersistenceException
|
throws PersistenceException
|
||||||
{
|
{
|
||||||
// open up the user repository
|
// save off the user repository
|
||||||
_repository = new UserRepository(provider);
|
_repository = repository;
|
||||||
|
|
||||||
// fetch the login URL from the properties
|
// fetch the login URL from the properties
|
||||||
_loginURL = config.getProperty("login_url");
|
_loginURL = config.getProperty("login_url");
|
||||||
|
|||||||
Reference in New Issue
Block a user