Interface UserService

  • All Superinterfaces:
    CRUDService<java.lang.Long,​User>, org.springframework.security.core.userdetails.UserDetailsService
    All Known Implementing Classes:
    UserServiceImpl

    public interface UserService
    extends CRUDService<java.lang.Long,​User>, org.springframework.security.core.userdetails.UserDetailsService
    Customized service for accessing user objects.
    • Method Detail

      • loadUserByUsername

        org.springframework.security.core.userdetails.UserDetails loadUserByUsername​(java.lang.String username)
                                                                              throws org.springframework.security.core.userdetails.UsernameNotFoundException
        Specified by:
        loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsService
        Throws:
        org.springframework.security.core.userdetails.UsernameNotFoundException
      • getUserByUsername

        User getUserByUsername​(java.lang.String username)
                        throws EntityNotFoundException
        Get a user from the database with the supplied username.
        Parameters:
        username - the user's username.
        Returns:
        the user corresponding to the username.
        Throws:
        EntityNotFoundException - if the user cannot be found by that username
      • loadUserByEmail

        User loadUserByEmail​(java.lang.String email)
                      throws EntityNotFoundException
        Get a user from the database with the supplied email address
        Parameters:
        email - The email address to read a user for
        Returns:
        The user with the given email address
        Throws:
        EntityNotFoundException - If no user has the given email address
      • getUsersForProject

        java.util.Collection<Join<Project,​User>> getUsersForProject​(Project project)
        Get all users associated with a particular project.
        Parameters:
        project - the project to get users for.
        Returns:
        the users associated with the project.
      • searchUsersForProject

        org.springframework.data.domain.Page<Join<Project,​User>> searchUsersForProject​(Project project,
                                                                                             java.lang.String search,
                                                                                             int page,
                                                                                             int size,
                                                                                             org.springframework.data.domain.Sort sort)
        Get a page of user accounts on a project filtered by username.
        Parameters:
        project - the project to get users for
        search - the string to filter on
        page - the current page
        size - the size of page
        sort - the properties to sort on
        Returns:
        a page of users.
      • countUsersForProject

        java.lang.Long countUsersForProject​(Project project)
        Count the number of Users in a given Project
        Parameters:
        project - The Project to count Users for.
        Returns:
        Long number of Users in a Project
      • getUsersAvailableForProject

        java.util.List<User> getUsersAvailableForProject​(Project project,
                                                         java.lang.String filter)
        Get the list of Users that are not associated with the current project. This is a convenience method for the front end to see what users can be added to the project.
        Parameters:
        project - The project we want to list the available users for
        filter - the search string to filter usernames on.
        Returns:
        A List of Users that are not associated with the project.
      • getUsersForProjectByRole

        java.util.Collection<Join<Project,​User>> getUsersForProjectByRole​(Project project,
                                                                                ProjectRole projectRole)
        Get Users for a Project that have a particular role
        Parameters:
        project - The project to find users for
        projectRole - The ProjectRole a user needs to have to be returned
        Returns:
        A Collection of Join<Project,User>s that have the given role
      • changePassword

        User changePassword​(java.lang.Long userId,
                            java.lang.String password)
        Change the password on the User account. This method may be called by a fully-authenticated User, or by a User who is NOT fully-authenticated and User.isCredentialsNonExpired() returns false.
        Parameters:
        userId - the identifier of the account to change the password for.
        password - the new password for the user account.
        Returns:
        the user entity with the updated password.
      • getUsersLoggedIn

        java.lang.Long getUsersLoggedIn​(java.util.Date createdDate)
        Get count of users logged on during the time period
        Parameters:
        createdDate - the minimum date for users login
        Returns:
        An Long count of users logged in
      • getUsersCreatedInTimePeriod

        java.lang.Long getUsersCreatedInTimePeriod​(java.util.Date createdDate)
        Get count of users created during the time period
        Parameters:
        createdDate - the minimum date for users created
        Returns:
        An Long count of users created
      • getUsersCreatedGrouped

        java.util.List<GenericStatModel> getUsersCreatedGrouped​(java.util.Date createdDate,
                                                                StatisticTimePeriod statisticTimePeriod)
        Get list of GenericStatModel of users created in the past n time period grouped by the format provided.
        Parameters:
        createdDate - the minimum date for users created
        statisticTimePeriod - the enum containing format for which to group the results by
        Returns:
        An GenericStatModel list