public class UserManager extends Lifecycle implements IUserManager, IAuthenticator
ILifecycle.DeferrableActivation
Constructor and Description |
---|
UserManager() |
Modifier and Type | Method and Description |
---|---|
void |
addUser(String userID,
char[] password) |
void |
authenticate(String userID,
char[] password)
Authenticates the user with the passed
userID by checking whether the supplied password
matches the password stored for this user. |
protected void |
doActivate() |
protected void |
doDeactivate() |
byte[] |
encrypt(String userID,
byte[] data,
String algorithmName,
byte[] salt,
int count) |
char[] |
getPassword(String userID) |
protected void |
load(Map<String,char[]> users) |
void |
removeUser(String userID) |
protected void |
save(Map<String,char[]> users) |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, getListeners, hasListeners, removeListener
public void addUser(String userID, char[] password)
addUser
in interface IUserManager
public void removeUser(String userID)
removeUser
in interface IUserManager
public char[] getPassword(String userID)
public void authenticate(String userID, char[] password)
IAuthenticator
userID
by checking whether the supplied password
matches the password stored for this user.
The implementation is required to throw a SecurityException
if the passwords do not match.
authenticate
in interface IAuthenticator
public byte[] encrypt(String userID, byte[] data, String algorithmName, byte[] salt, int count) throws SecurityException
encrypt
in interface IUserManager
SecurityException
protected void doActivate() throws Exception
doActivate
in class Lifecycle
Exception
protected void doDeactivate() throws Exception
doDeactivate
in class Lifecycle
Exception
protected void load(Map<String,char[]> users) throws IORuntimeException
IORuntimeException
protected void save(Map<String,char[]> users) throws IORuntimeException
IORuntimeException
Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html