Package org.apache.sentry.provider.common

Examples of org.apache.sentry.provider.common.GroupMappingService


          ServerConfig.SENTRY_STORE_GROUP_MAPPING_DEFAULT);
      String authResoruce = conf
          .get(ServerConfig.SENTRY_STORE_GROUP_MAPPING_RESOURCE);

      // load the group mapping provider class
      GroupMappingService groupMappingService;
      try {
        Constructor<?> constrctor = Class.forName(groupMapping).getDeclaredConstructor(
            Configuration.class, String.class);
        constrctor.setAccessible(true);
        groupMappingService = (GroupMappingService) constrctor.newInstance(new Object[] { conf,
            authResoruce });
      } catch (NoSuchMethodException e) {
        throw new SentryUserException("Unable to instantiate group mapping", e);
      } catch (SecurityException e) {
        throw new SentryUserException("Unable to instantiate group mapping", e);
      } catch (ClassNotFoundException e) {
        throw new SentryUserException("Unable to instantiate group mapping", e);
      } catch (InstantiationException e) {
        throw new SentryUserException("Unable to instantiate group mapping", e);
      } catch (IllegalAccessException e) {
        throw new SentryUserException("Unable to instantiate group mapping", e);
      } catch (IllegalArgumentException e) {
        throw new SentryUserException("Unable to instantiate group mapping", e);
      } catch (InvocationTargetException e) {
        throw new SentryUserException("Unable to instantiate group mapping", e);
      }
      return groupMappingService.getGroups(userName);
  }
View Full Code Here


  };

  @Test
  public void testResourceAuthorizationProvider() {
    final Set<String> set = Sets.newHashSet("a", "b", "c");
    GroupMappingService mappingService = new GroupMappingService() {
      @Override
      public Set<String> getGroups(String user) { return set; }
    };
    PolicyEngine policyEngine = new PolicyEngine() {
      @Override
View Full Code Here

TOP

Related Classes of org.apache.sentry.provider.common.GroupMappingService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.