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);
}