test_class.declarator: PRINCIPAL = new PrincipalImpl("name")
test_class.modifier: private static final
test_class.original_string: private static final Principal PRINCIPAL = new PrincipalImpl("name");
test_class.type: Principal
test_class.var_name: PRINCIPAL
test_class.declarator: INVALID_PRIVILEGE_NAME = "invalid"
test_class.modifier: private static final
test_class.original_string: private static final String INVALID_PRIVILEGE_NAME = "invalid";
test_class.type: String
test_class.var_name: INVALID_PRIVILEGE_NAME
test_class.file: oak-authorization-principalbased/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/principalbased/impl/UtilsTest.java
test_class.identifier: UtilsTest
test_class.interfaces: implements Constants
test_case.body: @Test
      public void testCanHandle() throws Exception {
          for (int behavior : new int[] {ImportBehavior.ABORT, ImportBehavior.BESTEFFORT, ImportBehavior.IGNORE}) {
              assertTrue(Utils.canHandle(PRINCIPAL, mockFilter(true), behavior));
          }
      }
test_case.class_method_signature: UtilsTest.testCanHandle()
test_case.full_signature: @Test public void testCanHandle()
test_case.identifier: testCanHandle
test_case.invocations: assertTrue canHandle mockFilter
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCanHandle()
focal_class.declarator: log = LoggerFactory.getLogger(Utils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(Utils.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: oak-authorization-principalbased/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/principalbased/impl/Utils.java
focal_class.identifier: Utils
focal_class.interfaces: implements Constants
focal_class.class_method_signature: Utils.Utils()
focal_class.full_signature: private  Utils()
focal_class.identifier: Utils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  Utils()
focal_class.class_method_signature: Utils.isPrincipalPolicyTree(@NotNull Tree tree)
focal_class.full_signature: public static boolean isPrincipalPolicyTree(@NotNull Tree tree)
focal_class.identifier: isPrincipalPolicyTree
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: boolean
focal_class.signature: boolean isPrincipalPolicyTree(@NotNull Tree tree)
focal_class.class_method_signature: Utils.isPrincipalEntry(@NotNull Tree tree)
focal_class.full_signature: public static boolean isPrincipalEntry(@NotNull Tree tree)
focal_class.identifier: isPrincipalEntry
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: boolean
focal_class.signature: boolean isPrincipalEntry(@NotNull Tree tree)
focal_class.class_method_signature: Utils.canHandle(@NotNull Principal principal, @NotNull Filter filter, int importBehavior)
focal_class.full_signature: public static boolean canHandle(@NotNull Principal principal, @NotNull Filter filter, int importBehavior)
focal_class.identifier: canHandle
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Principal principal, @NotNull Filter filter, int importBehavior)
focal_class.return: boolean
focal_class.signature: boolean canHandle(@NotNull Principal principal, @NotNull Filter filter, int importBehavior)
focal_class.class_method_signature: Utils.privilegesFromOakNames(@NotNull Set<String> privilegeNames, @NotNull PrivilegeManager privilegeManager, @NotNull NamePathMapper namePathMapper)
focal_class.full_signature: public static Privilege[] privilegesFromOakNames(@NotNull Set<String> privilegeNames, @NotNull PrivilegeManager privilegeManager, @NotNull NamePathMapper namePathMapper)
focal_class.identifier: privilegesFromOakNames
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Set<String> privilegeNames, @NotNull PrivilegeManager privilegeManager, @NotNull NamePathMapper namePathMapper)
focal_class.return: Privilege[]
focal_class.signature: Privilege[] privilegesFromOakNames(@NotNull Set<String> privilegeNames, @NotNull PrivilegeManager privilegeManager, @NotNull NamePathMapper namePathMapper)
focal_class.class_method_signature: Utils.hasModAcPermission(@NotNull PermissionProvider permissionProvider, @NotNull String effectivePath)
focal_class.full_signature: public static boolean hasModAcPermission(@NotNull PermissionProvider permissionProvider, @NotNull String effectivePath)
focal_class.identifier: hasModAcPermission
focal_class.modifiers: public static
focal_class.parameters: (@NotNull PermissionProvider permissionProvider, @NotNull String effectivePath)
focal_class.return: boolean
focal_class.signature: boolean hasModAcPermission(@NotNull PermissionProvider permissionProvider, @NotNull String effectivePath)
focal_method.body: public static boolean canHandle(@NotNull Principal principal, @NotNull Filter filter, int importBehavior) throws AccessControlException {
          String name = principal.getName();
          if (Strings.isNullOrEmpty(name)) {
              throw new AccessControlException("Invalid principal " + name);
          }
  
          boolean canHandle = filter.canHandle(Collections.singleton(principal));
          switch (importBehavior) {
              case ImportBehavior.ABORT:
                  if (!canHandle) {
                      throw new AccessControlException("Unsupported principal " + name);
                  }
                  break;
              case ImportBehavior.IGNORE:
              case ImportBehavior.BESTEFFORT:
                  log.debug("Ignoring unsupported principal {}", name);
                  break;
              default:
                  throw new IllegalArgumentException("Unsupported import behavior " + importBehavior);
          }
          return canHandle;
      }
focal_method.class_method_signature: Utils.canHandle(@NotNull Principal principal, @NotNull Filter filter, int importBehavior)
focal_method.full_signature: public static boolean canHandle(@NotNull Principal principal, @NotNull Filter filter, int importBehavior)
focal_method.identifier: canHandle
focal_method.invocations: getName isNullOrEmpty canHandle singleton debug
focal_method.modifiers: public static
focal_method.parameters: (@NotNull Principal principal, @NotNull Filter filter, int importBehavior)
focal_method.return: boolean
focal_method.signature: boolean canHandle(@NotNull Principal principal, @NotNull Filter filter, int importBehavior)