Interface PrincipalService

All Known Subinterfaces:
PrincipalManagerService
All Known Implementing Classes:
PrincipalManagerImpl

public interface PrincipalService
Data access interface for the "Principal" entity.
  • Method Details

    • setNewPassword

      void setNewPassword(String username, String newpassword, boolean resetRequired)
      Sets new password and required-flag.
      Parameters:
      username - the name of the principal to set new password to
      newpassword - the new password to set
      resetRequired - value of require-new-password flag
    • setTemporaryPassword

      void setTemporaryPassword(String username, String newpassword)
      Sets the temporary_password for the given principal, which will be valid for login as well until it expires based on the last_password_dispatch.
      Parameters:
      username - the name of the principal
      newpassword - the temporary_password
    • resetTemporaryPassword

      void resetTemporaryPassword(String username)
      Invalidates the state of the temporary password request mechanism, resetting temporary_password to null and setting the flag requiring a new password after login to false.
      Parameters:
      username - the name of the principal to modify
    • updatePrincipalFields

      void updatePrincipalFields(String username, PrincipalFields... fields)
    • resetPrincipalFields

      void resetPrincipalFields(String username, PrincipalFields... fields)
    • updatePrincipalFields

      void updatePrincipalFields(Entity principal, PrincipalFields... fields)
    • resetPrincipalFields

      void resetPrincipalFields(Entity principal, PrincipalFields... fields)
    • getCurrentPrincipal

      Optional<Entity> getCurrentPrincipal()
    • getCurrentUser

      Optional<Entity> getCurrentUser()
    • getPrincipalEntity

      Optional<Entity> getPrincipalEntity(String username)
    • getUserEntity

      Optional<Entity> getUserEntity(String username)
    • loginNewlyCreatedUser

      void loginNewlyCreatedUser(Entity userEntity)
      Logs in a (newly created) user. Takes the related principal (only supported with one principal!). For example used in flows where new users (and thus logins) are created. Use with care!
    • loginUser

      void loginUser(String username)
      Logs in a user by username. Use with care!
    • createUniqueUsernames

      Map<Entity,String> createUniqueUsernames(List<Entity> users)
      Creates a unique username. Based on the User's email or firstname and lastname.