com.gisgraphy.service.impl

## Class UserManagerImpl

- java.lang.Object
- - com.gisgraphy.service.impl.UniversalManagerImpl
  - - com.gisgraphy.service.impl.UserManagerImpl

- All Implemented Interfaces:
    UniversalManager, UserManager, UserService

      public class UserManagerImpl
      extends UniversalManagerImpl
      implements UserManager, UserService

  Implementation of UserManager interface.
  Author:
    Matt Raible

- - ### Field Summary

    - ### Fields inherited from class com.gisgraphy.service.impl.UniversalManagerImpl

      `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserManagerImpl()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `User` | `getUser(String userId)` Retrieves a user by userId.
    `User` | `getUserByUsername(String username)` Finds a user by their username.
    `List<User>` | `getUsers(User user)` Retrieves a list of users, filtering with parameters on a user object
    `void` | `removeUser(String userId)` Removes a user from the database by their userId
    `User` | `saveUser(User user)` Saves a user's information
    `void` | `setUserDao(UserDao dao)` Set the Dao for communication with the data layer.

    - ### Methods inherited from class com.gisgraphy.service.impl.UniversalManagerImpl

      `get, getAll, remove, save, setDao`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.gisgraphy.service.UniversalManager

      `get, getAll, remove, save`

- - ### Constructor Detail

    - #### UserManagerImpl

          public UserManagerImpl()

  - ### Method Detail

    - #### setUserDao

          public void setUserDao(UserDao dao)

      Set the Dao for communication with the data layer.
      Specified by:
        `setUserDao` in interface `UserManager`
      Parameters:
        `dao` - the UserDao that communicates with the database

    - #### getUser

          public User getUser(String userId)

      Retrieves a user by userId. An exception is thrown if user not found
      Specified by:
        `getUser` in interface `UserManager`
      Specified by:
        `getUser` in interface `UserService`
      Parameters:
        `userId` - the identifier for the user
      Returns:
        User

    - #### getUsers

          public List<User> getUsers(User user)

      Retrieves a list of users, filtering with parameters on a user object
      Specified by:
        `getUsers` in interface `UserManager`
      Specified by:
        `getUsers` in interface `UserService`
      Parameters:
        `user` - parameters to filter on
      Returns:
        List

    - #### saveUser

          @Transactional
          public User saveUser(User user)
                        throws UserExistsException

      Saves a user's information
      Specified by:
        `saveUser` in interface `UserManager`
      Specified by:
        `saveUser` in interface `UserService`
      Parameters:
        `user` - the user's information
      Returns:
        user the updated user object
      Throws:
        `UserExistsException` - thrown when user already exists

    - #### removeUser

          public void removeUser(String userId)

      Removes a user from the database by their userId
      Specified by:
        `removeUser` in interface `UserManager`
      Specified by:
        `removeUser` in interface `UserService`
      Parameters:
        `userId` - the user's id

    - #### getUserByUsername

          public User getUserByUsername(String username)
                                 throws org.springframework.security.userdetails.UsernameNotFoundException

      Finds a user by their username.
      Specified by:
        `getUserByUsername` in interface `UserManager`
      Specified by:
        `getUserByUsername` in interface `UserService`
      Parameters:
        `username` - the login name of the human
      Returns:
        User the populated user object
      Throws:
        `org.springframework.security.userdetails.UsernameNotFoundException` - thrown when username not found

Copyright © 2015. All rights reserved.