Interface UserService


public interface UserService
The UserService provides several methods to create users and manipulate user role data
Author:
reichama
  • Method Details

    • insert

      UID insert(NuclosUser user) throws BusinessException
      This method creates a Nuclos User and returns the id of the new object.
      A password will be generated and a default notification Email with the password will be send.
      A new user does not have any roles and therefore does not have any rights in Nuclos. Use method addRole() and removeRole() for modifications
      Parameters:
      user -
      Returns:
      Throws:
      BusinessException
    • insert

      UID insert(NuclosUser user, String password) throws BusinessException
      This method creates a Nuclos User and returns the id of the new object.
      Sends a default notification Email with the password.
      A new user does not have any roles and therefore does not have any rights in Nuclos. Use method addRole() and removeRole() for modifications
      Parameters:
      user -
      password - If no password is given, one will be generated. The same applies to the username.
      Returns:
      Throws:
      BusinessException
    • insert

      UID insert(NuclosUser user, String password, boolean sendNotification) throws BusinessException
      This method creates a Nuclos User and returns the id of the new object.
      A new user does not have any roles and therefore does not have any rights in Nuclos. Use method addRole() and removeRole() for modifications
      Parameters:
      user -
      password - If no password is given, one will be generated. The same applies to the username.
      sendNotification - Send a default notification Email with the password
      Returns:
      Throws:
      BusinessException
    • insert

      @Deprecated UID insert(String username, String firstname, String lastname, String email, Boolean passwordChangeRequired) throws BusinessException
      Deprecated.
      Deprecated: Use the insert methods with NuclosUser This method creates a Nuclos User and returns the id of the new object. Password is created by Nuclos automatically. Afterwards a notification Email containing the password is sent to the user.
      Note: A new user does not have any roles and therefore does not have any rights in Nuclos. Use method addRole() and removeRole() for modifications
      Parameters:
      username - , firstname, lastname, email, passwordChangeRequired
      Returns:
      UID
      Throws:
      BusinessException
    • insert

      @Deprecated UID insert(String username, String firstname, String lastname, String email, String password, Boolean passwordChangeRequired) throws BusinessException
      Deprecated.
      Deprecated: Use the insert methods with NuclosUser This method creates a Nuclos User and returns the id of the new object. A password must be provided. Afterwards a notification Email containing the password is sent to the user.
      Note: A new user does not have any roles and therefore does not have any rights in Nuclos. Use method addRole() and removeRole() for modifications
      Parameters:
      username - , firstname, lastname, email, password, passwordChangeRequired
      Returns:
      UID
      Throws:
      BusinessException
    • update

      void update(NuclosUser user) throws BusinessException
      This method updates the given Nuclos User.
      Parameters:
      user -
      Throws:
      BusinessException
    • resetPassword

      void resetPassword(NuclosUser user, String password, boolean sendNotification) throws BusinessException
      This method resets the password for the given Nuclos User.
      Parameters:
      user -
      password - If no password is given, one will be generated. The same applies to the username.
      sendNotification - Send a default notification Email with the password
      Throws:
      BusinessException
    • verifyPasswordResolveUserId

      default Optional<UID> verifyPasswordResolveUserId(String username, String password)
      Will try to verify user/password against Nuclos User and on success return the UID. If it fails (e.g. username not found or password wrong) it will return an empty Optional.
      Parameters:
      username -
      password -
      Returns:
      Optional UID if found or empty
    • grantRole

      UID grantRole(Class<? extends NuclosRole> role, NuclosUser user) throws BusinessException
      This method assigns a role to a given user. The class of the user role is generated automatically and corresponds to an existing user role in Nuclos. The NuclosUser can be extracted by using QueryProvider or BusinessObjectProvider
      Parameters:
      role -
      user -
      Returns:
      Throws:
      BusinessException
    • grantRole

      UID grantRole(NuclosRole role, NuclosUser user) throws BusinessException
      This method assigns a role to a given user. The NuclosUser and NuclosRole can be extracted by using QueryProvider or BusinessObjectProvider Use the classes org.nuclos.system.User and org.nuclos.system.Role
      Parameters:
      role -
      user -
      Returns:
      Throws:
      BusinessException
    • grantMandator

      UID grantMandator(NuclosMandator mandator, NuclosUser user) throws BusinessException
      This method assigns a mandator to a given user. The class of the user mandator is generated automatically and corresponds to an existing mandator in Nuclos. The NuclosMandator can be extracted by using QueryProvider or BusinessObjectProvider
      Parameters:
      mandator -
      user -
      Returns:
      Throws:
      BusinessException
    • revokeMandator

      void revokeMandator(NuclosMandator mandator, NuclosUser user) throws BusinessException
      This method revokes a mandator from a given user. The class of the user mandator is generated automatically and corresponds to an existing mandator in Nuclos. The NuclosMandator can be extracted by using QueryProvider or BusinessObjectProvider
      Parameters:
      mandator -
      user -
      Throws:
      BusinessException
    • isMandatorGranted

      boolean isMandatorGranted(NuclosMandator mandator, NuclosUser user) throws BusinessException
      This method checks if a mandator is granted to a given user. The class of the user mandator is generated automatically and corresponds to an existing mandator in Nuclos. The NuclosMandator can be extracted by using QueryProvider or BusinessObjectProvider
      Parameters:
      mandator -
      user -
      Returns:
      true if the Mandator is granted to the given user
      Throws:
      BusinessException
    • revokeRole

      void revokeRole(Class<? extends NuclosRole> role, NuclosUser user) throws BusinessException
      This method dispossesses a user of the given role. The class of the user role is generated automatically and corresponds to an existing user role in Nuclos. The NuclosUser can be extracted by using QueryProvider or BusinessObjectProvider. If the user is not assigned to the role a BusinessException is thrown.
      Parameters:
      role -
      user -
      Throws:
      BusinessException
    • revokeRole

      void revokeRole(NuclosRole role, NuclosUser user) throws BusinessException
      This method dispossesses a user of the given role. The class of the user role is generated automatically and corresponds to an existing user role in Nuclos. The NuclosUser and NuclosRole can be extracted by using QueryProvider or BusinessObjectProvider. Use the classes org.nuclos.system.User and org.nuclos.system.Role. If the user is not assigned to the role a BusinessException is thrown.
      Parameters:
      role -
      user -
      Throws:
      BusinessException
    • expire

      void expire(NuclosUser user, Date date) throws BusinessException
      This method allows to define a date on which to expire a specific user account. The NuclosUser can be extracted by using QueryProvider or BusinessObjectProvider.
      Parameters:
      user -
      date -
      Throws:
      BusinessException
    • delete

      void delete(NuclosUser user) throws BusinessException
      This method allows to delete a specific user account. The NuclosUser can be extracted by using QueryProvider or BusinessObjectProvider.
      Parameters:
      user -
      Throws:
      BusinessException