package com.yahoo.vespa.hosted.controller.api.integration.user;

import com.yahoo.vespa.hosted.controller.api.role.Role;

import java.util.Collection;
import java.util.List;

/**
 * Management of {@link UserId}s and {@link RoleId}s, used for access control with {@link Role}s.
 *
 * @author jonmv
 */
public interface UserManagement {

    /** Creates the given role, or throws if the role already exists. */
    void createRole(RoleId role);

    /** Deletes the given role, or throws if it doesn't already exist. */
    void deleteRole(RoleId role);

    /** Ensures the given users exist, and are part of the given role, or throws if the role does not exist. */
    void addUsers(RoleId role, Collection<UserId> users);

    /** Ensures none of the given users are part of the given role, or throws if the role does not exist. */
    void removeUsers(RoleId role, Collection<UserId> users);

    /** Returns all known roles. */
    List<RoleId> listRoles();

    /** Returns all users in the given role, or throws if the role does not exist. */
    List<UserId> listUsers(RoleId role);

}

@@ -449,13 +449,13 @@
 /** 
-Delet
+Ensur
 es t
@@ -471,41 +471,17 @@
 role
-, or throws if it doesn't already
+ does not
  exi
@@ -900,24 +900,32 @@
 les. */%0A    
+default 
 List%3CRoleId%3E
@@ -936,17 +936,79 @@
 tRoles()
-;
+ %7B throw new UnsupportedOperationException(%22To be removed.%22); %7D
 %0A%0A    /*

Simplify UserManagement