Class UserGroupHolder

java.lang.Object
org.apache.nifi.authorization.UserGroupHolder

public class UserGroupHolder extends Object
A holder to provide atomic access to user group data structures.
  • Field Details

  • Constructor Details

    • UserGroupHolder

      public UserGroupHolder(Tenants tenants)
      Creates a new holder and populates all convenience data structures.
      Parameters:
      tenants - the current tenants instance
  • Method Details

    • createUsers

      private Set<User> createUsers(Users users)
      Creates a set of Users from the JAXB Users.
      Parameters:
      users - the JAXB Users
      Returns:
      a set of API Users matching the provided JAXB Users
    • createGroups

      private Set<Group> createGroups(Groups groups, Users users)
      Creates a set of Groups from the JAXB Groups.
      Parameters:
      groups - the JAXB Groups
      Returns:
      a set of API Groups matching the provided JAXB Groups
    • createUserByIdMap

      private Map<String,User> createUserByIdMap(Set<User> users)
      Creates a Map from user identifier to User.
      Parameters:
      users - the set of all users
      Returns:
      the Map from user identifier to User
    • createUserByIdentityMap

      private Map<String,User> createUserByIdentityMap(Set<User> users)
      Creates a Map from user identity to User.
      Parameters:
      users - the set of all users
      Returns:
      the Map from user identity to User
    • createGroupByIdMap

      private Map<String,Group> createGroupByIdMap(Set<Group> groups)
      Creates a Map from group identifier to Group.
      Parameters:
      groups - the set of all groups
      Returns:
      the Map from group identifier to Group
    • createGroupByNameMap

      private Map<String,Group> createGroupByNameMap(Set<Group> groups)
      Creates a Map from group name to group.
      Parameters:
      groups - the set of all groups
      Returns:
      the Map from name to Group
    • createGroupsByUserIdentityMap

      private Map<String,Set<Group>> createGroupsByUserIdentityMap(Set<Group> groups, Set<User> users)
      Creates a Map from user identity to the set of Groups for that identity.
      Parameters:
      groups - all groups
      users - all users
      Returns:
      a Map from User identity to the set of Groups for that identity
    • getTenants

      public Tenants getTenants()
    • getAllUsers

      public Set<User> getAllUsers()
    • getUsersById

      public Map<String,User> getUsersById()
    • getUsersByIdentity

      public Map<String,User> getUsersByIdentity()
    • getAllGroups

      public Set<Group> getAllGroups()
    • getGroupsById

      public Map<String,Group> getGroupsById()
    • getGroupsByName

      public Map<String,Group> getGroupsByName()
    • getUser

      public User getUser(String identity)
    • getGroups

      public Set<Group> getGroups(String userIdentity)