test_class.declarator: provider
test_class.modifier: private
test_class.original_string: private RestrictionProviderImpl provider;
test_class.type: RestrictionProviderImpl
test_class.var_name: provider
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/RestrictionProviderImplTest.java
test_class.identifier: RestrictionProviderImplTest
test_class.interfaces: implements AccessControlConstants
test_class.superclass: extends AbstractSecurityTest
test_case.body: @Test
      public void testGetPatternFromRestrictions() throws Exception {
          Map<PropertyState, RestrictionPattern> map = newHashMap();
          map.put(PropertyStates.createProperty(REP_GLOB, "/*/jcr:content"), GlobPattern.create("/testPath", "/*/jcr:content"));
  
          List<String> ntNames = ImmutableList.of(JcrConstants.NT_FOLDER, JcrConstants.NT_LINKEDFILE);
          map.put(PropertyStates.createProperty(REP_NT_NAMES, ntNames, Type.NAMES), new NodeTypePattern(ntNames));
  
          List<String> prefixes = ImmutableList.of("rep", "jcr");
          map.put(PropertyStates.createProperty(REP_PREFIXES, prefixes, Type.STRINGS), new PrefixPattern(prefixes));
  
          List<String> itemNames = ImmutableList.of("abc", "jcr:primaryType");
          map.put(PropertyStates.createProperty(REP_ITEM_NAMES, itemNames, Type.NAMES), new ItemNamePattern(itemNames));
  
          Tree tree = TreeUtil.getOrAddChild(root.getTree("/"), "testPath", JcrConstants.NT_UNSTRUCTURED);
          Tree restrictions = TreeUtil.addChild(tree, REP_RESTRICTIONS, NT_REP_RESTRICTIONS);
  
          // test restrictions individually
          for (Map.Entry<PropertyState, RestrictionPattern> entry : map.entrySet()) {
              restrictions.setProperty(entry.getKey());
  
              RestrictionPattern pattern = provider.getPattern("/testPath", provider.readRestrictions("/testPath", tree));
              assertEquals(entry.getValue(), pattern);
              restrictions.removeProperty(entry.getKey().getName());
          }
  
          // test combination on multiple restrictions
          for (Map.Entry<PropertyState, RestrictionPattern> entry : map.entrySet()) {
              restrictions.setProperty(entry.getKey());
          }
          RestrictionPattern pattern = provider.getPattern("/testPath", provider.readRestrictions("/testPath", tree));
          assertTrue(pattern instanceof CompositePattern);
      }
test_case.class_method_signature: RestrictionProviderImplTest.testGetPatternFromRestrictions()
test_case.full_signature: @Test public void testGetPatternFromRestrictions()
test_case.identifier: testGetPatternFromRestrictions
test_case.invocations: newHashMap put createProperty create of put createProperty of put createProperty of put createProperty getOrAddChild getTree addChild entrySet setProperty getKey getPattern readRestrictions assertEquals getValue removeProperty getName getKey entrySet setProperty getKey getPattern readRestrictions assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetPatternFromRestrictions()
focal_class.declarator: log = LoggerFactory.getLogger(RestrictionProviderImpl.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(RestrictionProviderImpl.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: NUMBER_OF_DEFINITIONS = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int NUMBER_OF_DEFINITIONS = 3;
focal_class.type: int
focal_class.var_name: NUMBER_OF_DEFINITIONS
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/RestrictionProviderImpl.java
focal_class.identifier: RestrictionProviderImpl
focal_class.class_method_signature: RestrictionProviderImpl.RestrictionProviderImpl()
focal_class.full_signature: public  RestrictionProviderImpl()
focal_class.identifier: RestrictionProviderImpl
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  RestrictionProviderImpl()
focal_class.class_method_signature: RestrictionProviderImpl.supportedRestrictions()
focal_class.full_signature: private static Map<String, RestrictionDefinition> supportedRestrictions()
focal_class.identifier: supportedRestrictions
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: Map<String, RestrictionDefinition>
focal_class.signature: Map<String, RestrictionDefinition> supportedRestrictions()
focal_class.class_method_signature: RestrictionProviderImpl.getPattern(String oakPath, @NotNull Tree tree)
focal_class.full_signature: @NotNull @Override public RestrictionPattern getPattern(String oakPath, @NotNull Tree tree)
focal_class.identifier: getPattern
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (String oakPath, @NotNull Tree tree)
focal_class.return: RestrictionPattern
focal_class.signature: RestrictionPattern getPattern(String oakPath, @NotNull Tree tree)
focal_class.class_method_signature: RestrictionProviderImpl.getPattern(@Nullable String oakPath, @NotNull Set<Restriction> restrictions)
focal_class.full_signature: @NotNull @Override public RestrictionPattern getPattern(@Nullable String oakPath, @NotNull Set<Restriction> restrictions)
focal_class.identifier: getPattern
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@Nullable String oakPath, @NotNull Set<Restriction> restrictions)
focal_class.return: RestrictionPattern
focal_class.signature: RestrictionPattern getPattern(@Nullable String oakPath, @NotNull Set<Restriction> restrictions)
focal_class.class_method_signature: RestrictionProviderImpl.validateRestrictions(String oakPath, @NotNull Tree aceTree)
focal_class.full_signature: @Override public void validateRestrictions(String oakPath, @NotNull Tree aceTree)
focal_class.identifier: validateRestrictions
focal_class.modifiers: @Override public
focal_class.parameters: (String oakPath, @NotNull Tree aceTree)
focal_class.return: void
focal_class.signature: void validateRestrictions(String oakPath, @NotNull Tree aceTree)
focal_class.superclass: extends AbstractRestrictionProvider
focal_method.body: @NotNull
      @Override
      public RestrictionPattern getPattern(String oakPath, @NotNull Tree tree) {
          if (oakPath == null) {
              return RestrictionPattern.EMPTY;
          } else {
              List<RestrictionPattern> patterns = new ArrayList<>(NUMBER_OF_DEFINITIONS);
              PropertyState glob = tree.getProperty(REP_GLOB);
              if (glob != null) {
                  patterns.add(GlobPattern.create(oakPath, glob.getValue(Type.STRING)));
              }
              PropertyState ntNames = tree.getProperty(REP_NT_NAMES);
              if (ntNames != null) {
                  patterns.add(new NodeTypePattern(ntNames.getValue(Type.NAMES)));
              }
              PropertyState prefixes = tree.getProperty(REP_PREFIXES);
              if (prefixes != null) {
                  patterns.add(new PrefixPattern(prefixes.getValue(Type.STRINGS)));
              }
              PropertyState itemNames = tree.getProperty(REP_ITEM_NAMES);
              if (itemNames != null) {
                  patterns.add(new ItemNamePattern(itemNames.getValue(Type.NAMES)));
              }
  
              return CompositePattern.create(patterns);
          }
      }
focal_method.class_method_signature: RestrictionProviderImpl.getPattern(String oakPath, @NotNull Tree tree)
focal_method.full_signature: @NotNull @Override public RestrictionPattern getPattern(String oakPath, @NotNull Tree tree)
focal_method.identifier: getPattern
focal_method.invocations: getProperty add create getValue getProperty add getValue getProperty add getValue getProperty add getValue create
focal_method.modifiers: @NotNull @Override public
focal_method.parameters: (String oakPath, @NotNull Tree tree)
focal_method.return: RestrictionPattern
focal_method.signature: RestrictionPattern getPattern(String oakPath, @NotNull Tree tree)