Class TenantHolder

java.lang.Object
org.apache.nifi.ldap.tenants.TenantHolder

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

  • Constructor Details

    • TenantHolder

      public TenantHolder(Set<User> allUsers, Set<Group> allGroups)
      Creates a new holder and populates all convenience data structures.
  • Method Details

    • 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 group 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
    • getAllUsers

      public Set<User> getAllUsers()
    • getUsersById

      public Map<String,User> getUsersById()
    • 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)