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, toString
checkPermission, getServerConfig, getServerContext, getStatisticManager
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString
public static final PermissionDefinition permissionDef
public AbstractUserManager(S serverCtx)
public PermissionDefinition getPermissionDefinition()
PermissionControlled
PermissionControlled
object with a unique name
and provides a list of supported assignable permissions.getPermissionDefinition
in interface PermissionControlled
public final void init() throws java.lang.Exception
UserManager
init
in interface Initializable
init
in interface UserManager<S extends ServerContext>
java.lang.Exception
public final void clear()
Clearable
public 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>
PermissionException
public final UserId[] getUserIds()
getUserIds
in interface UserManager<S extends ServerContext>
public final void setDefaultUserPassword(SessionId sessionId, java.lang.String encryptedPassword) throws java.lang.Exception
UserAuthenticator
setDefaultUserPassword
in interface UserAuthenticator
java.lang.Exception
public final void resetPassword(SessionId sessionId, User user, boolean isClear) throws java.lang.Exception
UserAuthenticator
resetPassword
in interface UserAuthenticator
java.lang.Exception
public final void changePassword(SessionId sessionId, java.lang.String userName, java.lang.String oldPasswordDigest, java.lang.String newPasswordDigest) throws java.lang.Exception
UserAuthenticator
changePassword
in interface UserAuthenticator
java.lang.Exception
public final User insertUser(SessionId sessionId, User user) throws java.lang.Exception
UserManager
UserManager
implementation will return a
server specific user subclass.insertUser
in interface UserManager<S extends ServerContext>
java.lang.Exception
public final void updateUser(SessionId sessionId, User user) throws java.lang.Exception
updateUser
in interface UserManager<S extends ServerContext>
java.lang.Exception
public final void deleteUser(SessionId sessionId, User user) throws java.lang.Exception
deleteUser
in interface UserManager<S extends ServerContext>
java.lang.Exception
public final User findUserForLogin(LoginData data) throws InvalidLoginException
UserAuthenticator
findUserForLogin
in interface UserAuthenticator
InvalidLoginException
public 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.Exception
protected abstract void read(java.util.List<User> userList) throws java.lang.Exception
java.lang.Exception
protected abstract void performChangePassword(SessionId sessionId, User user, java.lang.String oldPassword, java.lang.String newPassword) throws java.lang.Exception
java.lang.Exception
protected abstract void performResetPassword(SessionId sessionId, User user, boolean isClear) throws java.lang.Exception
java.lang.Exception
protected abstract User performInsertUser(SessionId sessionId, User user, java.util.List<User> userList) throws java.lang.Exception
java.lang.Exception
protected abstract void performDeleteUser(SessionId sessionId, User user) throws java.lang.Exception
java.lang.Exception
protected abstract void performUpdateUser(SessionId sessionId, User user) throws java.lang.Exception
java.lang.Exception
Copyright © 2014 EsprIT-Systems. All Rights Reserved.