public abstract class AbstractUserManager<S extends ServerContext> extends AbstractInitializableServerObject<S> implements UserManager<S>, Clearable
| Modifier and Type | Field and Description |
|---|---|
static PermissionDefinition |
permissionDef |
DEFAULT_ADMIN_USERNAME, DEFAULT_PASSWORD_ADMIN, DEFAULT_PASSWORD_ESPRIT| Constructor and Description |
|---|
AbstractUserManager(S serverCtx) |
| Modifier and Type | Method and Description |
|---|---|
void |
changePassword(SessionId sessionId,
java.lang.String userName,
java.lang.String oldPasswordDigest,
java.lang.String newPasswordDigest)
Verifies the old password and sets the new one.
|
protected void |
checkIsUpdateAllowedOnUser(User user) |
void |
clear()
Clears the content
|
void |
deleteUser(SessionId sessionId,
User user) |
User |
findUserById(int uid) |
User |
findUserByName(java.lang.String userName) |
User |
findUserForLogin(LoginData data)
Verifies user login data and returns a UserId on success.
|
PermissionDefinition |
getPermissionDefinition()
Returns an object that identifies a
PermissionControlled object with a unique name
and provides a list of supported assignable permissions. |
protected java.io.File |
getUserConfigFile() |
int |
getUserCount() |
UserId[] |
getUserIds() |
protected java.util.List<User> |
getUserList() |
User[] |
getUsers(SessionId sessionId) |
void |
init()
Loads all users from the underlying persistent store
|
User |
insertUser(SessionId sessionId,
User user)
Note that the underlying
UserManager implementation will return a
server specific user subclass. |
boolean |
isEmptyPasswordAllowed()
Returns the flag as configured in ServerStartup
|
protected int |
nextUserId()
Takes the biggest existing uidKey + 1
|
protected void |
performAfterUpdateUser(SessionId sessionId,
User user)
May do something after a User update (required i.e. for permission management)
|
protected abstract void |
performChangePassword(SessionId sessionId,
User user,
java.lang.String oldPassword,
java.lang.String newPassword) |
protected abstract void |
performDeleteUser(SessionId sessionId,
User user) |
protected abstract User |
performInsertUser(SessionId sessionId,
User user,
java.util.List<User> userList) |
protected abstract void |
performResetPassword(SessionId sessionId,
User user,
boolean isClear) |
protected abstract void |
performUpdateUser(SessionId sessionId,
User user) |
protected abstract void |
read(java.util.List<User> userList) |
void |
resetPassword(SessionId sessionId,
User user,
boolean isClear)
Resets the password for the given User to the system default user password as configured
in the srv_params.cfg file.
|
void |
setDefaultUserPassword(SessionId sessionId,
java.lang.String encryptedPassword)
Sets the system default password for new users
|
void |
updateUser(SessionId sessionId,
User user) |
checkInitialized, isInitialized, setInitialized, toStringcheckPermission, getServerConfig, getServerContext, getStatisticManagergetApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannelconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toStringpublic static final PermissionDefinition permissionDef
public AbstractUserManager(S serverCtx)
public PermissionDefinition getPermissionDefinition()
PermissionControlledPermissionControlled object with a unique name
and provides a list of supported assignable permissions.getPermissionDefinition in interface PermissionControlledpublic final void init()
throws java.lang.Exception
UserManagerinit in interface Initializableinit in interface UserManager<S extends ServerContext>java.lang.Exceptionpublic final void clear()
Clearablepublic final int getUserCount()
getUserCount in interface UserManager<S extends ServerContext>public final User[] getUsers(SessionId sessionId) throws PermissionException
getUsers in interface UserManager<S extends ServerContext>PermissionExceptionpublic final UserId[] getUserIds()
getUserIds in interface UserManager<S extends ServerContext>public final void setDefaultUserPassword(SessionId sessionId, java.lang.String encryptedPassword) throws java.lang.Exception
UserAuthenticatorsetDefaultUserPassword in interface UserAuthenticatorjava.lang.Exceptionpublic final void resetPassword(SessionId sessionId, User user, boolean isClear) throws java.lang.Exception
UserAuthenticatorresetPassword in interface UserAuthenticatorjava.lang.Exceptionpublic final void changePassword(SessionId sessionId, java.lang.String userName, java.lang.String oldPasswordDigest, java.lang.String newPasswordDigest) throws java.lang.Exception
UserAuthenticatorchangePassword in interface UserAuthenticatorjava.lang.Exceptionpublic final User insertUser(SessionId sessionId, User user) throws java.lang.Exception
UserManagerUserManager implementation will return a
server specific user subclass.insertUser in interface UserManager<S extends ServerContext>java.lang.Exceptionpublic final void updateUser(SessionId sessionId, User user) throws java.lang.Exception
updateUser in interface UserManager<S extends ServerContext>java.lang.Exceptionpublic final void deleteUser(SessionId sessionId, User user) throws java.lang.Exception
deleteUser in interface UserManager<S extends ServerContext>java.lang.Exceptionpublic final User findUserForLogin(LoginData data) throws InvalidLoginException
UserAuthenticatorfindUserForLogin in interface UserAuthenticatorInvalidLoginExceptionpublic final User findUserByName(java.lang.String userName)
findUserByName in interface UserManager<S extends ServerContext>public final User findUserById(int uid)
findUserById in interface UserManager<S extends ServerContext>public final boolean isEmptyPasswordAllowed()
isEmptyPasswordAllowed in interface UserManager<S extends ServerContext>protected int nextUserId()
protected java.io.File getUserConfigFile()
protected final java.util.List<User> getUserList()
protected void checkIsUpdateAllowedOnUser(User user) throws java.lang.Exception
java.lang.Exceptionprotected abstract void read(java.util.List<User> userList) throws java.lang.Exception
java.lang.Exceptionprotected abstract void performChangePassword(SessionId sessionId, User user, java.lang.String oldPassword, java.lang.String newPassword) throws java.lang.Exception
java.lang.Exceptionprotected abstract void performResetPassword(SessionId sessionId, User user, boolean isClear) throws java.lang.Exception
java.lang.Exceptionprotected abstract User performInsertUser(SessionId sessionId, User user, java.util.List<User> userList) throws java.lang.Exception
java.lang.Exceptionprotected abstract void performDeleteUser(SessionId sessionId, User user) throws java.lang.Exception
java.lang.Exceptionprotected abstract void performUpdateUser(SessionId sessionId, User user) throws java.lang.Exception
java.lang.ExceptionCopyright © 2014 EsprIT-Systems. All Rights Reserved.