mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-04-01 18:00:12 +02:00
fix UserManager
This commit is contained in:
@@ -81,23 +81,4 @@ public interface Manager<T extends TypedObject, E extends Exception>
|
||||
* @return
|
||||
*/
|
||||
public Collection<T> getAll();
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
* @param <H>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public <H extends Handler<T, E>> H getHandler(String type);
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Collection<Type> getTypes();
|
||||
}
|
||||
|
||||
@@ -31,28 +31,39 @@
|
||||
|
||||
|
||||
|
||||
package sonia.scm.user;
|
||||
package sonia.scm;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*
|
||||
* @param <T>
|
||||
* @param <E>
|
||||
*/
|
||||
public class UserHandlerNotFoundException extends UserException
|
||||
public interface TypeManager<T extends TypedObject, E extends Exception>
|
||||
extends Manager<T, E>
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final long serialVersionUID = -4704703054646330523L;
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
* @param <H>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public <H extends Handler<T, E>> H getHandler(String type);
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
public UserHandlerNotFoundException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
public Collection<Type> getTypes();
|
||||
}
|
||||
@@ -36,14 +36,14 @@ package sonia.scm.repository;
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import sonia.scm.ListenerSupport;
|
||||
import sonia.scm.Manager;
|
||||
import sonia.scm.TypeManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public interface RepositoryManager
|
||||
extends Manager<Repository, RepositoryException>,
|
||||
extends TypeManager<Repository, RepositoryException>,
|
||||
ListenerSupport<RepositoryListener>
|
||||
{
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* Copyright (c) 2010, Sebastian Sdorra
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
@@ -13,7 +13,7 @@
|
||||
* 3. Neither the name of SCM-Manager; nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
@@ -24,22 +24,72 @@
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* http://bitbucket.org/sdorra/scm-manager
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.user;
|
||||
|
||||
import sonia.scm.Handler;
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import sonia.scm.HandlerEvent;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public interface UserHandler extends Handler<User, UserException>
|
||||
public abstract class AbstractUserManager implements UserManager
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void addListener(UserListener listener)
|
||||
{
|
||||
listenerSet.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void removeListener(UserListener listener)
|
||||
{
|
||||
listenerSet.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
* @param event
|
||||
*/
|
||||
protected void fireEvent(User user, HandlerEvent event)
|
||||
{
|
||||
for (UserListener listener : listenerSet)
|
||||
{
|
||||
listener.onEvent(user, event);
|
||||
}
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private Set<UserListener> listenerSet = new HashSet<UserListener>();
|
||||
}
|
||||
@@ -1,422 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2010, Sebastian Sdorra
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of SCM-Manager; nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* http://bitbucket.org/sdorra/scm-manager
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.user;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.ConfigurationException;
|
||||
import sonia.scm.HandlerEvent;
|
||||
import sonia.scm.SCMContextProvider;
|
||||
import sonia.scm.Type;
|
||||
import sonia.scm.util.AssertUtil;
|
||||
import sonia.scm.util.IOUtil;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@Singleton
|
||||
public class BasicUserManager implements UserManager
|
||||
{
|
||||
|
||||
/** the logger for BasicUserManager */
|
||||
private static final Logger logger =
|
||||
LoggerFactory.getLogger(BasicUserManager.class);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param handlerSet
|
||||
*/
|
||||
@Inject
|
||||
public BasicUserManager(Set<UserHandler> handlerSet)
|
||||
{
|
||||
AssertUtil.assertIsNotEmpty(handlerSet);
|
||||
|
||||
for (UserHandler handler : handlerSet)
|
||||
{
|
||||
addHandler(handler);
|
||||
}
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void addListener(UserListener listener)
|
||||
{
|
||||
listenerSet.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public void close() throws IOException
|
||||
{
|
||||
for (UserHandler handler : handlerMap.values())
|
||||
{
|
||||
IOUtil.close(handler);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public void create(User user) throws Exception, IOException
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("create user {} of type {}", user.getName(), user.getType());
|
||||
}
|
||||
|
||||
AssertUtil.assertIsValid(user);
|
||||
getHandler(user).create(user);
|
||||
fireEvent(user, HandlerEvent.CREATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public void delete(User user) throws Exception, IOException
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("delete user {} of type {}", user.getName(), user.getType());
|
||||
}
|
||||
|
||||
getHandler(user).delete(user);
|
||||
fireEvent(user, HandlerEvent.DELETE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
@Override
|
||||
public void init(SCMContextProvider context)
|
||||
{
|
||||
for (UserHandler handler : handlerMap.values())
|
||||
{
|
||||
handler.init(context);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public void modify(User user) throws Exception, IOException
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("modify user {} of type {}", user.getName(), user.getType());
|
||||
}
|
||||
|
||||
AssertUtil.assertIsValid(user);
|
||||
getHandler(user).modify(user);
|
||||
fireEvent(user, HandlerEvent.MODIFY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public void refresh(User user) throws Exception, IOException
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("refresh user {} of type {}", user.getName(), user.getType());
|
||||
}
|
||||
|
||||
// getHandler(user).refresh(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param listener
|
||||
*/
|
||||
@Override
|
||||
public void removeListener(UserListener listener)
|
||||
{
|
||||
listenerSet.remove(listener);
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public User get(String id)
|
||||
{
|
||||
User user = null;
|
||||
|
||||
for (UserHandler handler : handlerMap.values())
|
||||
{
|
||||
if (handler.isConfigured())
|
||||
{
|
||||
|
||||
// user = handler.get(id);
|
||||
if (user != null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Collection<User> getAll()
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("fetch all users");
|
||||
}
|
||||
|
||||
Set<User> repositories = new HashSet<User>();
|
||||
|
||||
/*
|
||||
* for (UserHandler handler : handlerMap.values())
|
||||
* {
|
||||
* if (handler.isConfigured())
|
||||
* {
|
||||
* Collection<User> handlerRepositories = handler.getAll();
|
||||
*
|
||||
* if (handlerRepositories != null)
|
||||
* {
|
||||
* repositories.addAll(handlerRepositories);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("fetched {} users", repositories.size());
|
||||
}
|
||||
|
||||
return repositories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserHandler getHandler(String type)
|
||||
{
|
||||
return handlerMap.get(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Collection<Type> getTypes()
|
||||
{
|
||||
return typeSet;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param handler
|
||||
*/
|
||||
private void addHandler(UserHandler handler)
|
||||
{
|
||||
AssertUtil.assertIsNotNull(handler);
|
||||
|
||||
Type type = handler.getType();
|
||||
|
||||
AssertUtil.assertIsNotNull(type);
|
||||
|
||||
if (handlerMap.containsKey(type.getName()))
|
||||
{
|
||||
throw new ConfigurationException(
|
||||
type.getName().concat("allready registered"));
|
||||
}
|
||||
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("added UserHandler {} for type {}", handler.getClass(), type);
|
||||
}
|
||||
|
||||
handlerMap.put(type.getName(), handler);
|
||||
typeSet.add(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
* @param event
|
||||
*/
|
||||
private void fireEvent(User user, HandlerEvent event)
|
||||
{
|
||||
for (UserListener listener : listenerSet)
|
||||
{
|
||||
listener.onEvent(user, event);
|
||||
}
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param user
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws UserException
|
||||
*/
|
||||
private UserHandler getHandler(User user) throws UserException
|
||||
{
|
||||
AssertUtil.assertIsNotNull(user);
|
||||
|
||||
String type = user.getType();
|
||||
|
||||
AssertUtil.assertIsNotEmpty(type);
|
||||
|
||||
UserHandler handler = handlerMap.get(type);
|
||||
|
||||
if (handler == null)
|
||||
{
|
||||
throw new UserHandlerNotFoundException(
|
||||
"could not find UserHandler for ".concat(type));
|
||||
}
|
||||
else if (!handler.isConfigured())
|
||||
{
|
||||
throw new UserException(
|
||||
"UserHandler for type ".concat(type).concat(" is not configured"));
|
||||
}
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private Set<UserListener> listenerSet = new HashSet<UserListener>();
|
||||
|
||||
/** Field description */
|
||||
private Map<String, UserHandler> handlerMap = new HashMap<String,
|
||||
UserHandler>();
|
||||
|
||||
/** Field description */
|
||||
private Set<Type> typeSet = new LinkedHashSet<Type>();
|
||||
}
|
||||
@@ -43,17 +43,4 @@ import sonia.scm.Manager;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public interface UserManager
|
||||
extends Manager<User, Exception>, ListenerSupport<UserListener>
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param type
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserHandler getHandler(String type);
|
||||
}
|
||||
extends Manager<User, Exception>, ListenerSupport<UserListener> {}
|
||||
|
||||
@@ -41,12 +41,12 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.SCMContextProvider;
|
||||
import sonia.scm.Type;
|
||||
import sonia.scm.user.AbstractUserManager;
|
||||
import sonia.scm.user.User;
|
||||
import sonia.scm.user.UserAllreadyExistException;
|
||||
import sonia.scm.user.UserException;
|
||||
import sonia.scm.user.UserHandler;
|
||||
import sonia.scm.util.IOUtil;
|
||||
import sonia.scm.util.Util;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
@@ -64,31 +64,22 @@ import javax.xml.bind.JAXB;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@Singleton
|
||||
public class XmlUserHandler implements UserHandler
|
||||
public class XmlUserManager extends AbstractUserManager
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
public static final String ADMIN_PATH = "/sonia/scm/config/admin-account.xml";
|
||||
|
||||
/** Field description */
|
||||
public static final String FILE_EXTENSION = ".xml";
|
||||
|
||||
/** Field description */
|
||||
public static final String TYPE_DISPLAYNAME = "XML";
|
||||
|
||||
/** Field description */
|
||||
public static final String TYPE_NAME = "xml";
|
||||
|
||||
/** Field description */
|
||||
public static final Type type = new Type(TYPE_NAME, TYPE_DISPLAYNAME);
|
||||
|
||||
/** Field description */
|
||||
public static final String DATABASEFILE =
|
||||
"config".concat(File.separator).concat("users.xml");
|
||||
|
||||
/** the logger for XmlUserHandler */
|
||||
/** Field description */
|
||||
public static final String TYPE = "xml";
|
||||
|
||||
/** the logger for XmlUserManager */
|
||||
private static final Logger logger =
|
||||
LoggerFactory.getLogger(XmlUserHandler.class);
|
||||
LoggerFactory.getLogger(XmlUserManager.class);
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
@@ -122,9 +113,14 @@ public class XmlUserHandler implements UserHandler
|
||||
throw new UserAllreadyExistException();
|
||||
}
|
||||
|
||||
user.setType(TYPE_NAME);
|
||||
String type = user.getType();
|
||||
|
||||
synchronized (XmlUserHandler.class)
|
||||
if (Util.isEmpty(type))
|
||||
{
|
||||
user.setType(TYPE);
|
||||
}
|
||||
|
||||
synchronized (XmlUserManager.class)
|
||||
{
|
||||
userDB.add(user.clone());
|
||||
storeDB();
|
||||
@@ -147,7 +143,7 @@ public class XmlUserHandler implements UserHandler
|
||||
|
||||
if (userDB.contains(name))
|
||||
{
|
||||
synchronized (XmlUserHandler.class)
|
||||
synchronized (XmlUserManager.class)
|
||||
{
|
||||
userDB.remove(name);
|
||||
storeDB();
|
||||
@@ -201,9 +197,7 @@ public class XmlUserHandler implements UserHandler
|
||||
|
||||
if (userDB.contains(name))
|
||||
{
|
||||
user.setType(TYPE_NAME);
|
||||
|
||||
synchronized (XmlUserHandler.class)
|
||||
synchronized (XmlUserManager.class)
|
||||
{
|
||||
userDB.remove(name);
|
||||
userDB.add(user.clone());
|
||||
@@ -225,6 +219,7 @@ public class XmlUserHandler implements UserHandler
|
||||
* @throws IOException
|
||||
* @throws UserException
|
||||
*/
|
||||
@Override
|
||||
public void refresh(User user) throws UserException, IOException
|
||||
{
|
||||
User fresh = userDB.get(user.getName());
|
||||
@@ -247,6 +242,7 @@ public class XmlUserHandler implements UserHandler
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public User get(String id)
|
||||
{
|
||||
User user = userDB.get(id);
|
||||
@@ -265,6 +261,7 @@ public class XmlUserHandler implements UserHandler
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Collection<User> getAll()
|
||||
{
|
||||
LinkedList<User> users = new LinkedList<User>();
|
||||
@@ -277,30 +274,6 @@ public class XmlUserHandler implements UserHandler
|
||||
return users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Type getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean isConfigured()
|
||||
{
|
||||
return (userDBFile != null) && userDBFile.exists();
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -309,7 +282,7 @@ public class XmlUserHandler implements UserHandler
|
||||
*/
|
||||
private void createAdminAccount()
|
||||
{
|
||||
InputStream input = XmlUserHandler.class.getResourceAsStream(ADMIN_PATH);
|
||||
InputStream input = XmlUserManager.class.getResourceAsStream(ADMIN_PATH);
|
||||
|
||||
try
|
||||
{
|
||||
Reference in New Issue
Block a user