Class UserRepository


  • public class UserRepository
    extends Object
    • Constructor Detail

      • UserRepository

        public UserRepository()
    • Method Detail

      • getUserId

        public static Integer getUserId​(String username)
        This expects username to be unique in the system!
        Parameters:
        username -
        jdbc -
        Returns:
        Throws:
        Exception
      • getUser

        public static Optional<de.narimo.commons.dto.geometa.User> getUser​(String username)
        This expects username to be unique in the system!
        Parameters:
        username -
        jdbc -
        Returns:
        Throws:
        Exception
      • createUser

        public static String createUser​(String email,
                                        String organisation,
                                        String userFirstName,
                                        String userLastName,
                                        String newPassword)
                                 throws IOException
        Creates a user and returns the alphanumeric secret that has been created for the user to validate his account. NOTE: This should work for a user, if his email is already registered but is marked as disabled!
        Parameters:
        email -
        organisation -
        userFirstName -
        userLastName -
        newPassword -
        Returns:
        Throws:
        IOException
      • getUsersById

        public static List<de.narimo.commons.dto.geometa.User> getUsersById​(List<Integer> userIds)
        Return all users by the specified ids.
        Parameters:
        adminIds -
        Returns:
      • confirmUserRegistration

        public static void confirmUserRegistration​(String email,
                                                   String registrationSecret)
                                            throws IOException
        Confirm a user registration in case a correct combination of email and registration secret has been provided. This combination must be unique to be accepted.
        Parameters:
        email -
        registrationSecret -
        Throws:
        IOException
      • resetPassword

        public static void resetPassword​(String newPassword,
                                         String passwordResetSecret,
                                         String email)
                                  throws IOException
        Reset a password for a row that has been marked with a password reset secret before.
        Parameters:
        newPassword -
        passwordResetSecret -
        Throws:
        IOException
      • canUserCreateWorkspace

        public static boolean canUserCreateWorkspace​(long userId)