Interface UserManagement

  • All Known Implementing Classes:
    MockUserManagement

    public interface UserManagement
    Management of UserIds as members of Roles.
    Author:
    jonmv
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addToRoles​(UserId user, java.util.Collection<Role> roles)
      Ensures the given user exist, and are part of the given roles, or throws if the roles does not exist.
      void addUsers​(Role role, java.util.Collection<UserId> users)
      Ensures the given users exist, and are part of the given role, or throws if the role does not exist.
      void createRole​(Role role)
      Creates the given role, or throws if the role already exists.
      void deleteRole​(Role role)
      Ensures the given role does not exist.
      java.util.List<User> listUsers​(Role role)
      Returns all users in the given role, or throws if the role does not exist.
      void removeFromRoles​(UserId user, java.util.Collection<Role> roles)
      Ensures the given users are not part of the given role, or throws if the roles does not exist.
      void removeUsers​(Role role, java.util.Collection<UserId> users)
      Ensures none of the given users are part of the given role, or throws if the role does not exist.
    • Method Detail

      • createRole

        void createRole​(Role role)
        Creates the given role, or throws if the role already exists.
      • deleteRole

        void deleteRole​(Role role)
        Ensures the given role does not exist.
      • addUsers

        void addUsers​(Role role,
                      java.util.Collection<UserId> users)
        Ensures the given users exist, and are part of the given role, or throws if the role does not exist.
      • addToRoles

        void addToRoles​(UserId user,
                        java.util.Collection<Role> roles)
        Ensures the given user exist, and are part of the given roles, or throws if the roles does not exist.
      • removeUsers

        void removeUsers​(Role role,
                         java.util.Collection<UserId> users)
        Ensures none of the given users are part of the given role, or throws if the role does not exist.
      • removeFromRoles

        void removeFromRoles​(UserId user,
                             java.util.Collection<Role> roles)
        Ensures the given users are not part of the given role, or throws if the roles does not exist.
      • listUsers

        java.util.List<User> listUsers​(Role role)
        Returns all users in the given role, or throws if the role does not exist.