test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserPrincipalProviderTest.java
test_class.identifier: UserPrincipalProviderTest
test_class.superclass: extends AbstractPrincipalProviderTest
test_case.body: @Test
      public void testGroupMembers() throws Exception {
          Principal principal = principalProvider.getPrincipal(testGroup.getPrincipal().getName());
          assertTrue(principal instanceof GroupPrincipal);
  
          boolean found = false;
          Enumeration<? extends Principal> members = ((GroupPrincipal) principal).members();
          while (members.hasMoreElements() && !found) {
              found = members.nextElement().equals(getTestUser().getPrincipal());
          }
          assertTrue(found);
      }
test_case.class_method_signature: UserPrincipalProviderTest.testGroupMembers()
test_case.full_signature: @Test public void testGroupMembers()
test_case.identifier: testGroupMembers
test_case.invocations: getPrincipal getName getPrincipal assertTrue members hasMoreElements equals nextElement getPrincipal getTestUser assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGroupMembers()
focal_class.declarator: log = LoggerFactory.getLogger(UserPrincipalProvider.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(UserPrincipalProvider.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: PARAM_CACHE_EXPIRATION = "cacheExpiration"
focal_class.modifier: static final
focal_class.original_string: static final String PARAM_CACHE_EXPIRATION = "cacheExpiration";
focal_class.type: String
focal_class.var_name: PARAM_CACHE_EXPIRATION
focal_class.declarator: EXPIRATION_NO_CACHE = 0
focal_class.modifier: static final
focal_class.original_string: static final long EXPIRATION_NO_CACHE = 0;
focal_class.type: long
focal_class.var_name: EXPIRATION_NO_CACHE
focal_class.declarator: MEMBERSHIP_THRESHOLD = 0
focal_class.modifier: private static final
focal_class.original_string: private static final long MEMBERSHIP_THRESHOLD = 0;
focal_class.type: long
focal_class.var_name: MEMBERSHIP_THRESHOLD
focal_class.declarator: root
focal_class.modifier: private final
focal_class.original_string: private final Root root;
focal_class.type: Root
focal_class.var_name: root
focal_class.declarator: config
focal_class.modifier: private final
focal_class.original_string: private final UserConfiguration config;
focal_class.type: UserConfiguration
focal_class.var_name: config
focal_class.declarator: namePathMapper
focal_class.modifier: private final
focal_class.original_string: private final NamePathMapper namePathMapper;
focal_class.type: NamePathMapper
focal_class.var_name: namePathMapper
focal_class.declarator: userProvider
focal_class.modifier: private final
focal_class.original_string: private final UserProvider userProvider;
focal_class.type: UserProvider
focal_class.var_name: userProvider
focal_class.declarator: membershipProvider
focal_class.modifier: private final
focal_class.original_string: private final MembershipProvider membershipProvider;
focal_class.type: MembershipProvider
focal_class.var_name: membershipProvider
focal_class.declarator: expiration
focal_class.modifier: private final
focal_class.original_string: private final long expiration;
focal_class.type: long
focal_class.var_name: expiration
focal_class.declarator: cacheEnabled
focal_class.modifier: private final
focal_class.original_string: private final boolean cacheEnabled;
focal_class.type: boolean
focal_class.var_name: cacheEnabled
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserPrincipalProvider.java
focal_class.identifier: UserPrincipalProvider
focal_class.interfaces: implements PrincipalProvider
focal_class.class_method_signature: UserPrincipalProvider.UserPrincipalProvider(@NotNull Root root,
                            @NotNull UserConfiguration userConfiguration,
                            @NotNull NamePathMapper namePathMapper)
focal_class.full_signature:   UserPrincipalProvider(@NotNull Root root,
                            @NotNull UserConfiguration userConfiguration,
                            @NotNull NamePathMapper namePathMapper)
focal_class.identifier: UserPrincipalProvider
focal_class.parameters: (@NotNull Root root,
                            @NotNull UserConfiguration userConfiguration,
                            @NotNull NamePathMapper namePathMapper)
focal_class.signature:  UserPrincipalProvider(@NotNull Root root,
                            @NotNull UserConfiguration userConfiguration,
                            @NotNull NamePathMapper namePathMapper)
focal_class.class_method_signature: UserPrincipalProvider.getPrincipal(@NotNull String principalName)
focal_class.full_signature: @Override public Principal getPrincipal(@NotNull String principalName)
focal_class.identifier: getPrincipal
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull String principalName)
focal_class.return: Principal
focal_class.signature: Principal getPrincipal(@NotNull String principalName)
focal_class.class_method_signature: UserPrincipalProvider.getItemBasedPrincipal(@NotNull String principalOakPath)
focal_class.full_signature: @Nullable @Override public ItemBasedPrincipal getItemBasedPrincipal(@NotNull String principalOakPath)
focal_class.identifier: getItemBasedPrincipal
focal_class.modifiers: @Nullable @Override public
focal_class.parameters: (@NotNull String principalOakPath)
focal_class.return: ItemBasedPrincipal
focal_class.signature: ItemBasedPrincipal getItemBasedPrincipal(@NotNull String principalOakPath)
focal_class.class_method_signature: UserPrincipalProvider.getMembershipPrincipals(@NotNull Principal principal)
focal_class.full_signature: @NotNull @Override public Set<Principal> getMembershipPrincipals(@NotNull Principal principal)
focal_class.identifier: getMembershipPrincipals
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull Principal principal)
focal_class.return: Set<Principal>
focal_class.signature: Set<Principal> getMembershipPrincipals(@NotNull Principal principal)
focal_class.class_method_signature: UserPrincipalProvider.getPrincipals(@NotNull String userID)
focal_class.full_signature: @NotNull @Override public Set<? extends Principal> getPrincipals(@NotNull String userID)
focal_class.identifier: getPrincipals
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull String userID)
focal_class.return: Set<? extends Principal>
focal_class.signature: Set<? extends Principal> getPrincipals(@NotNull String userID)
focal_class.class_method_signature: UserPrincipalProvider.findPrincipals(@Nullable final String nameHint, final int searchType)
focal_class.full_signature: @NotNull @Override public Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType)
focal_class.identifier: findPrincipals
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@Nullable final String nameHint, final int searchType)
focal_class.return: Iterator<? extends Principal>
focal_class.signature: Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final int searchType)
focal_class.class_method_signature: UserPrincipalProvider.findPrincipals(@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
              long limit)
focal_class.full_signature: @NotNull @Override public Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
              long limit)
focal_class.identifier: findPrincipals
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
              long limit)
focal_class.return: Iterator<? extends Principal>
focal_class.signature: Iterator<? extends Principal> findPrincipals(@Nullable final String nameHint, final boolean fullText, final int searchType, long offset,
              long limit)
focal_class.class_method_signature: UserPrincipalProvider.findPrincipals(int searchType)
focal_class.full_signature: @NotNull @Override public Iterator<? extends Principal> findPrincipals(int searchType)
focal_class.identifier: findPrincipals
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (int searchType)
focal_class.return: Iterator<? extends Principal>
focal_class.signature: Iterator<? extends Principal> findPrincipals(int searchType)
focal_class.class_method_signature: UserPrincipalProvider.getAuthorizableTree(@NotNull Principal principal)
focal_class.full_signature: @Nullable private Tree getAuthorizableTree(@NotNull Principal principal)
focal_class.identifier: getAuthorizableTree
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull Principal principal)
focal_class.return: Tree
focal_class.signature: Tree getAuthorizableTree(@NotNull Principal principal)
focal_class.class_method_signature: UserPrincipalProvider.createPrincipal(@Nullable Tree authorizableTree)
focal_class.full_signature: @Nullable private Principal createPrincipal(@Nullable Tree authorizableTree)
focal_class.identifier: createPrincipal
focal_class.modifiers: @Nullable private
focal_class.parameters: (@Nullable Tree authorizableTree)
focal_class.return: Principal
focal_class.signature: Principal createPrincipal(@Nullable Tree authorizableTree)
focal_class.class_method_signature: UserPrincipalProvider.createUserPrincipal(@NotNull String id, @NotNull Tree userTree)
focal_class.full_signature: @Nullable private Principal createUserPrincipal(@NotNull String id, @NotNull Tree userTree)
focal_class.identifier: createUserPrincipal
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull String id, @NotNull Tree userTree)
focal_class.return: Principal
focal_class.signature: Principal createUserPrincipal(@NotNull String id, @NotNull Tree userTree)
focal_class.class_method_signature: UserPrincipalProvider.createGroupPrincipal(@NotNull Tree groupTree)
focal_class.full_signature: @Nullable private Principal createGroupPrincipal(@NotNull Tree groupTree)
focal_class.identifier: createGroupPrincipal
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NotNull Tree groupTree)
focal_class.return: Principal
focal_class.signature: Principal createGroupPrincipal(@NotNull Tree groupTree)
focal_class.class_method_signature: UserPrincipalProvider.getPrincipalName(@NotNull Tree tree)
focal_class.full_signature: @Nullable private static String getPrincipalName(@NotNull Tree tree)
focal_class.identifier: getPrincipalName
focal_class.modifiers: @Nullable private static
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: String
focal_class.signature: String getPrincipalName(@NotNull Tree tree)
focal_class.class_method_signature: UserPrincipalProvider.getGroupMembership(@NotNull Tree authorizableTree)
focal_class.full_signature: @NotNull private Set<Principal> getGroupMembership(@NotNull Tree authorizableTree)
focal_class.identifier: getGroupMembership
focal_class.modifiers: @NotNull private
focal_class.parameters: (@NotNull Tree authorizableTree)
focal_class.return: Set<Principal>
focal_class.signature: Set<Principal> getGroupMembership(@NotNull Tree authorizableTree)
focal_class.class_method_signature: UserPrincipalProvider.cacheGroups(@NotNull Tree authorizableNode, @NotNull Set<Principal> groupPrincipals)
focal_class.full_signature: private void cacheGroups(@NotNull Tree authorizableNode, @NotNull Set<Principal> groupPrincipals)
focal_class.identifier: cacheGroups
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree authorizableNode, @NotNull Set<Principal> groupPrincipals)
focal_class.return: void
focal_class.signature: void cacheGroups(@NotNull Tree authorizableNode, @NotNull Set<Principal> groupPrincipals)
focal_class.class_method_signature: UserPrincipalProvider.readGroupsFromCache(@NotNull Tree authorizableNode, @NotNull Set<Principal> groups)
focal_class.full_signature: private boolean readGroupsFromCache(@NotNull Tree authorizableNode, @NotNull Set<Principal> groups)
focal_class.identifier: readGroupsFromCache
focal_class.modifiers: private
focal_class.parameters: (@NotNull Tree authorizableNode, @NotNull Set<Principal> groups)
focal_class.return: boolean
focal_class.signature: boolean readGroupsFromCache(@NotNull Tree authorizableNode, @NotNull Set<Principal> groups)
focal_class.class_method_signature: UserPrincipalProvider.isValidCache(Tree principalCache)
focal_class.full_signature: private static boolean isValidCache(Tree principalCache)
focal_class.identifier: isValidCache
focal_class.modifiers: private static
focal_class.parameters: (Tree principalCache)
focal_class.return: boolean
focal_class.signature: boolean isValidCache(Tree principalCache)
focal_class.class_method_signature: UserPrincipalProvider.buildSearchPatternContains(@NotNull String nameHint)
focal_class.full_signature: private static String buildSearchPatternContains(@NotNull String nameHint)
focal_class.identifier: buildSearchPatternContains
focal_class.modifiers: private static
focal_class.parameters: (@NotNull String nameHint)
focal_class.return: String
focal_class.signature: String buildSearchPatternContains(@NotNull String nameHint)
focal_class.class_method_signature: UserPrincipalProvider.buildSearchPatternFT(@NotNull String nameHint)
focal_class.full_signature: private static String buildSearchPatternFT(@NotNull String nameHint)
focal_class.identifier: buildSearchPatternFT
focal_class.modifiers: private static
focal_class.parameters: (@NotNull String nameHint)
focal_class.return: String
focal_class.signature: String buildSearchPatternFT(@NotNull String nameHint)
focal_class.class_method_signature: UserPrincipalProvider.matchesEveryone(String nameHint, int searchType)
focal_class.full_signature: private static boolean matchesEveryone(String nameHint, int searchType)
focal_class.identifier: matchesEveryone
focal_class.modifiers: private static
focal_class.parameters: (String nameHint, int searchType)
focal_class.return: boolean
focal_class.signature: boolean matchesEveryone(String nameHint, int searchType)
focal_method.body: @Override
      public Principal getPrincipal(@NotNull String principalName) {
          Tree authorizableTree = userProvider.getAuthorizableByPrincipal(new PrincipalImpl(principalName));
          Principal principal = createPrincipal(authorizableTree);
  
          if (principal == null) {
              // no such principal or error while accessing principal from user/group
              return (EveryonePrincipal.NAME.equals(principalName)) ? EveryonePrincipal.getInstance() : null;
          } else {
              return principal;
          }
      }
focal_method.class_method_signature: UserPrincipalProvider.getPrincipal(@NotNull String principalName)
focal_method.full_signature: @Override public Principal getPrincipal(@NotNull String principalName)
focal_method.identifier: getPrincipal
focal_method.invocations: getAuthorizableByPrincipal createPrincipal equals getInstance
focal_method.modifiers: @Override public
focal_method.parameters: (@NotNull String principalName)
focal_method.return: Principal
focal_method.signature: Principal getPrincipal(@NotNull String principalName)