public class UserManager extends Lifecycle implements IUserManager, IAuthenticator
ILifecycle.DeferrableActivation| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,char[]> |
users |
| Constructor and Description |
|---|
UserManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(java.lang.String userID,
char[] password) |
void |
authenticate(java.lang.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(java.lang.String userID,
byte[] data,
java.lang.String algorithmName,
byte[] salt,
int count) |
char[] |
getPassword(java.lang.String userID) |
protected void |
load(java.util.Map<java.lang.String,char[]> users) |
void |
removeUser(java.lang.String userID) |
protected void |
save(java.util.Map<java.lang.String,char[]> users) |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringaddListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, getListeners, hasListeners, removeListenerpublic void addUser(java.lang.String userID,
char[] password)
addUser in interface IUserManagerpublic void removeUser(java.lang.String userID)
removeUser in interface IUserManagerpublic char[] getPassword(java.lang.String userID)
public void authenticate(java.lang.String userID,
char[] password)
IAuthenticatoruserID 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 IAuthenticatorpublic byte[] encrypt(java.lang.String userID,
byte[] data,
java.lang.String algorithmName,
byte[] salt,
int count)
throws java.lang.SecurityException
encrypt in interface IUserManagerjava.lang.SecurityExceptionprotected void doActivate()
throws java.lang.Exception
doActivate in class Lifecyclejava.lang.Exceptionprotected void doDeactivate()
throws java.lang.Exception
doDeactivate in class Lifecyclejava.lang.Exceptionprotected void load(java.util.Map<java.lang.String,char[]> users)
throws IORuntimeException
IORuntimeExceptionprotected void save(java.util.Map<java.lang.String,char[]> users)
throws IORuntimeException
IORuntimeExceptionCopyright (c) 2004-2019 Eike Stepper (Loehne, 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