test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAuthorizationConfigurationTest.java
test_class.identifier: CompositeAuthorizationConfigurationTest
test_class.superclass: extends AbstractSecurityTest
test_case.body: @Test
      public void testDefaultEvaluationFilter() {
          PermissionProvider pp = mock(PermissionProvider.class, withSettings().extraInterfaces(AggregatedPermissionProvider.class));
          AuthorizationConfiguration ac1 = mock(AuthorizationConfiguration.class);
          AuthorizationConfiguration ac2 = mock(AuthorizationConfiguration.class);
          for (AuthorizationConfiguration ac : new AuthorizationConfiguration[] {ac1, ac2}) {
              when(ac.getPermissionProvider(any(Root.class), anyString(), any(Set.class))).thenReturn(pp);
              when(ac.getParameters()).thenReturn(ConfigurationParameters.EMPTY);
              when(ac.getContext()).thenReturn(Context.DEFAULT);
          }
          CompositeAuthorizationConfiguration cc = getCompositeConfiguration(ac1, ac2);
          PermissionProvider permissionProvider = cc.getPermissionProvider(root, adminSession.getWorkspaceName(), ImmutableSet.of(EveryonePrincipal.getInstance()));
          permissionProvider.refresh();
  
          verify(pp, times(2)).refresh();
      }
test_case.class_method_signature: CompositeAuthorizationConfigurationTest.testDefaultEvaluationFilter()
test_case.full_signature: @Test public void testDefaultEvaluationFilter()
test_case.identifier: testDefaultEvaluationFilter
test_case.invocations: mock extraInterfaces withSettings mock mock thenReturn when getPermissionProvider any anyString any thenReturn when getParameters thenReturn when getContext getCompositeConfiguration getPermissionProvider getWorkspaceName of getInstance refresh refresh verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDefaultEvaluationFilter()
focal_class.declarator: log = LoggerFactory.getLogger(CompositeAuthorizationConfiguration.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(CompositeAuthorizationConfiguration.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: compositionType = CompositionType.AND
focal_class.modifier: private
focal_class.original_string: private CompositionType compositionType = CompositionType.AND;
focal_class.type: CompositionType
focal_class.var_name: compositionType
focal_class.declarator: aggregationFilter = AggregationFilter.DEFAULT
focal_class.modifier: private
focal_class.original_string: private AggregationFilter aggregationFilter = AggregationFilter.DEFAULT;
focal_class.type: AggregationFilter
focal_class.var_name: aggregationFilter
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAuthorizationConfiguration.java
focal_class.identifier: CompositeAuthorizationConfiguration
focal_class.interfaces: implements AuthorizationConfiguration
focal_class.class_method_signature: CompositeAuthorizationConfiguration.CompositeAuthorizationConfiguration()
focal_class.full_signature: public  CompositeAuthorizationConfiguration()
focal_class.identifier: CompositeAuthorizationConfiguration
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  CompositeAuthorizationConfiguration()
focal_class.class_method_signature: CompositeAuthorizationConfiguration.CompositeAuthorizationConfiguration(@NotNull SecurityProvider securityProvider)
focal_class.full_signature: public  CompositeAuthorizationConfiguration(@NotNull SecurityProvider securityProvider)
focal_class.identifier: CompositeAuthorizationConfiguration
focal_class.modifiers: public
focal_class.parameters: (@NotNull SecurityProvider securityProvider)
focal_class.signature:  CompositeAuthorizationConfiguration(@NotNull SecurityProvider securityProvider)
focal_class.class_method_signature: CompositeAuthorizationConfiguration.withCompositionType(@Nullable String ct)
focal_class.full_signature: public void withCompositionType(@Nullable String ct)
focal_class.identifier: withCompositionType
focal_class.modifiers: public
focal_class.parameters: (@Nullable String ct)
focal_class.return: void
focal_class.signature: void withCompositionType(@Nullable String ct)
focal_class.class_method_signature: CompositeAuthorizationConfiguration.withAggregationFilter(@NotNull AggregationFilter aggregationFilter)
focal_class.full_signature: public void withAggregationFilter(@NotNull AggregationFilter aggregationFilter)
focal_class.identifier: withAggregationFilter
focal_class.modifiers: public
focal_class.parameters: (@NotNull AggregationFilter aggregationFilter)
focal_class.return: void
focal_class.signature: void withAggregationFilter(@NotNull AggregationFilter aggregationFilter)
focal_class.class_method_signature: CompositeAuthorizationConfiguration.getAccessControlManager(@NotNull final Root root,
                                                          @NotNull final NamePathMapper namePathMapper)
focal_class.full_signature: @NotNull @Override public AccessControlManager getAccessControlManager(@NotNull final Root root,
                                                          @NotNull final NamePathMapper namePathMapper)
focal_class.identifier: getAccessControlManager
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull final Root root,
                                                          @NotNull final NamePathMapper namePathMapper)
focal_class.return: AccessControlManager
focal_class.signature: AccessControlManager getAccessControlManager(@NotNull final Root root,
                                                          @NotNull final NamePathMapper namePathMapper)
focal_class.class_method_signature: CompositeAuthorizationConfiguration.getRestrictionProvider()
focal_class.full_signature: @NotNull @Override public RestrictionProvider getRestrictionProvider()
focal_class.identifier: getRestrictionProvider
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: ()
focal_class.return: RestrictionProvider
focal_class.signature: RestrictionProvider getRestrictionProvider()
focal_class.class_method_signature: CompositeAuthorizationConfiguration.getPermissionProvider(@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)
focal_class.full_signature: @NotNull @Override public PermissionProvider getPermissionProvider(@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)
focal_class.identifier: getPermissionProvider
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)
focal_class.return: PermissionProvider
focal_class.signature: PermissionProvider getPermissionProvider(@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)
focal_class.superclass: extends CompositeConfiguration<AuthorizationConfiguration>
focal_method.body: @NotNull
      @Override
      public PermissionProvider getPermissionProvider(@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals) {
          List<AuthorizationConfiguration> configurations = getConfigurations();
          switch (configurations.size()) {
              case 0: throw new IllegalStateException();
              case 1: return configurations.get(0).getPermissionProvider(root, workspaceName, principals);
              default:
                  List<AggregatedPermissionProvider> aggrPermissionProviders = new ArrayList<>(configurations.size());
                  for (AuthorizationConfiguration conf : configurations) {
                      PermissionProvider pProvider = conf.getPermissionProvider(root, workspaceName, principals);
                      if (pProvider instanceof AggregatedPermissionProvider) {
                          AggregatedPermissionProvider aggrProvider = (AggregatedPermissionProvider) pProvider;
                          aggrPermissionProviders.add(aggrProvider);
                          if (aggregationFilter.stop(aggrProvider, principals)) {
                              break;
                          }
                      } else {
                          log.debug("Ignoring permission provider of '{}': Not an AggregatedPermissionProvider", conf.getClass().getName());
                      }
                  }
                  PermissionProvider pp;
                  switch (aggrPermissionProviders.size()) {
                      case 0 :
                          pp = EmptyPermissionProvider.getInstance();
                          break;
                      case 1 :
                          pp = aggrPermissionProviders.get(0);
                          break;
                      default :
                          pp = CompositePermissionProvider.create(root, aggrPermissionProviders, getContext(), compositionType, getRootProvider(), getTreeProvider());
                  }
                  return pp;
          }
      }
focal_method.class_method_signature: CompositeAuthorizationConfiguration.getPermissionProvider(@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)
focal_method.full_signature: @NotNull @Override public PermissionProvider getPermissionProvider(@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)
focal_method.identifier: getPermissionProvider
focal_method.invocations: getConfigurations size getPermissionProvider get size getPermissionProvider add stop debug getName getClass size getInstance get create getContext getRootProvider getTreeProvider
focal_method.modifiers: @NotNull @Override public
focal_method.parameters: (@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)
focal_method.return: PermissionProvider
focal_method.signature: PermissionProvider getPermissionProvider(@NotNull final Root root,
                                                      @NotNull final String workspaceName,
                                                      @NotNull final Set<Principal> principals)