## imcode.server.user
Class ImcmsAuthenticatorAndUserAndRoleMapper

    java.lang.Object
      imcode.server.user.ImcmsAuthenticatorAndUserAndRoleMapper

All Implemented Interfaces:
  Authenticator, RoleGetter, UserAndRoleRegistry

    public class ImcmsAuthenticatorAndUserAndRoleMapper

extends java.lang.Object
implements UserAndRoleRegistry, Authenticator, RoleGetter

Field Summary
`static java.lang.String` `SQL_INSERT_INTO_ROLES`
`static java.lang.String` `SQL_ROLES_COLUMNS`
`static java.lang.String` `SQL_SELECT_ROLE_BY_NAME`

Constructor Summary
`ImcmsAuthenticatorAndUserAndRoleMapper(ImcmsServices services)`

Method Summary
`RoleDomainObject` `addRole(java.lang.String roleName)`
`void` `addRoleNames(java.lang.String[] externalRoleNames)`
`void` `addUser(UserDomainObject user)`
`boolean` `authenticate(java.lang.String loginName, java.lang.String password)`
`void` `deleteRole(RoleDomainObject role)`
`UserDomainObject[]` `findUsersByNamePrefix(java.lang.String namePrefix, boolean includeInactiveUsers)`
`java.lang.String[]` `getAllRoleNames()`
`RoleDomainObject[]` `getAllRoles()`
`RoleDomainObject[]` `getAllRolesExceptUsersRole()`
`UserDomainObject[]` `getAllUsers()`
`UserDomainObject[]` `getAllUsersWithRole(RoleDomainObject role)`
`UserDomainObject` `getDefaultUser()`
`RoleDomainObject` `getRole(RoleId roleId)`
`RoleDomainObject` `getRoleById(int roleId)`
`RoleDomainObject` `getRoleByName(java.lang.String wantedRoleName)`
`RoleDomainObject` `getRoleFromSqlResult(java.lang.String[] sqlResult)`
`java.lang.String[]` `getRoleNames(UserDomainObject user)` Deprecated.
`UserDomainObject` `getUser(int userId)`
`UserDomainObject` `getUser(java.lang.String loginName)`
`UserDomainObject` `getUserByIpAddress(java.lang.String ipAddress)`
`PhoneNumber[]` `getUserPhoneNumbers(int userToChangeId)`
`UserDomainObject[]` `getUsers(boolean includeUserExtern, boolean includeInactiveUsers)`
`java.lang.String` `getUserSessionId(UserDomainObject loggedInUser)`
`void` `initUserPhoneNumbers(UserDomainObject user)`
`void` `initUserRoles(UserDomainObject user)`
`void` `initUserUserAdminRoles(UserDomainObject user)`
`void` `saveRole(RoleDomainObject role)`
`void` `saveUser(java.lang.String loginName, UserDomainObject userToSave)`
`void` `saveUser(UserDomainObject user)`
`void` `updateUserSessionId(UserDomainObject loggedInUser)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SQL_ROLES_COLUMNS

    public static final java.lang.String SQL_ROLES_COLUMNS

See Also:
  Constant Field Values

### SQL_SELECT_ROLE_BY_NAME

    public static final java.lang.String SQL_SELECT_ROLE_BY_NAME

See Also:
  Constant Field Values

### SQL_INSERT_INTO_ROLES

    public static final java.lang.String SQL_INSERT_INTO_ROLES

See Also:
  Constant Field Values

Constructor Detail

### ImcmsAuthenticatorAndUserAndRoleMapper

    public ImcmsAuthenticatorAndUserAndRoleMapper(ImcmsServices services)

Method Detail

### authenticate

    public boolean authenticate(java.lang.String loginName,
                                java.lang.String password)

  Specified by:
    `authenticate` in interface `Authenticator`

### getUser

    public UserDomainObject getUser(java.lang.String loginName)

  Specified by:
    `getUser` in interface `UserAndRoleRegistry`

### getUser

    public UserDomainObject getUser(int userId)

  Returns:
    An object representing the user with the given id.

### saveUser

    public void saveUser(java.lang.String loginName,
                         UserDomainObject userToSave)

### updateUserSessionId

    public void updateUserSessionId(UserDomainObject loggedInUser)

### getUserSessionId

    public java.lang.String getUserSessionId(UserDomainObject loggedInUser)

### saveUser

    public void saveUser(UserDomainObject user)

### addUser

    public void addUser(UserDomainObject user)
                 throws UserAlreadyExistsException

  Throws:
    `UserAlreadyExistsException`

### getRoleNames

    public java.lang.String[] getRoleNames(UserDomainObject user)

  Deprecated.

  Specified by:
    `getRoleNames` in interface `UserAndRoleRegistry`

### getAllRoleNames

    public java.lang.String[] getAllRoleNames()

  Specified by:
    `getAllRoleNames` in interface `UserAndRoleRegistry`

### addRoleNames

    public void addRoleNames(java.lang.String[] externalRoleNames)

### getUsers

    public UserDomainObject[] getUsers(boolean includeUserExtern,
                                       boolean includeInactiveUsers)

### getAllUsersWithRole

    public UserDomainObject[] getAllUsersWithRole(RoleDomainObject role)

### addRole

    public RoleDomainObject addRole(java.lang.String roleName)

### deleteRole

    public void deleteRole(RoleDomainObject role)

### getAllRoles

    public RoleDomainObject[] getAllRoles()

### getAllRolesExceptUsersRole

    public RoleDomainObject[] getAllRolesExceptUsersRole()

### getRoleById

    public RoleDomainObject getRoleById(int roleId)

### getRoleByName

    public RoleDomainObject getRoleByName(java.lang.String wantedRoleName)

### getRoleFromSqlResult

    public RoleDomainObject getRoleFromSqlResult(java.lang.String[] sqlResult)

### getAllUsers

    public UserDomainObject[] getAllUsers()

### findUsersByNamePrefix

    public UserDomainObject[] findUsersByNamePrefix(java.lang.String namePrefix,
                                                    boolean includeInactiveUsers)

### initUserPhoneNumbers

    public void initUserPhoneNumbers(UserDomainObject user)

### initUserRoles

    public void initUserRoles(UserDomainObject user)

### initUserUserAdminRoles

    public void initUserUserAdminRoles(UserDomainObject user)

### saveRole

    public void saveRole(RoleDomainObject role)
                  throws NameTooLongException,
                         RoleAlreadyExistsException

  Throws:
    `NameTooLongException`
    `RoleAlreadyExistsException`

### getUserPhoneNumbers

    public PhoneNumber[] getUserPhoneNumbers(int userToChangeId)

### getDefaultUser

    public UserDomainObject getDefaultUser()

### getRole

    public RoleDomainObject getRole(RoleId roleId)

  Specified by:
    `getRole` in interface `RoleGetter`

### getUserByIpAddress

    public UserDomainObject getUserByIpAddress(java.lang.String ipAddress)