/** * Processes results from a directory query in the context of a given destination type and permission type. This * implementation should not be invoked concurrently. * * @param results * the results to process * @param destinationType * the type of the destination for which the directory results apply * @param permissionType * the type of the permission for which the directory results apply * * @throws Exception * if there is an error processing the results */ protected void processQueryResults(DefaultAuthorizationMap map, NamingEnumeration<SearchResult> results, DestinationType destinationType, PermissionType permissionType) throws Exception { while (results.hasMore()) { SearchResult result = results.next(); AuthorizationEntry entry = null; try { entry = getEntry(map, new LdapName(result.getNameInNamespace()), destinationType); } catch (Exception e) { LOG.error("Policy not applied! Error parsing authorization policy entry under {}", result.getNameInNamespace(), e); continue; } applyACL(entry, result, permissionType); } }
/** * Handler for removed policy entries in the directory. * * @param namingEvent * the removed entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectRemoved(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Removing object: {}", namingEvent.getOldBinding()); Binding result = namingEvent.getOldBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyAcl(entry, permissionType, new HashSet<Object>()); } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for object removal for removal of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object removal for removal of {}", result.getName(), e); } }
/** * Handler for new policy entries in the directory. * * @param namingEvent * the new entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectAdded(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Adding object: {}", namingEvent.getNewBinding()); SearchResult result = (SearchResult) namingEvent.getNewBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyACL(entry, result, permissionType); if (!(entry instanceof TempDestinationAuthorizationEntry)) { map.put(entry.getDestination(), entry); } } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for addition of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object addition for addition of {}", result.getName(), e); } }
/** * Processes results from a directory query in the context of a given destination type and permission type. This * implementation should not be invoked concurrently. * * @param results * the results to process * @param destinationType * the type of the destination for which the directory results apply * @param permissionType * the type of the permission for which the directory results apply * * @throws Exception * if there is an error processing the results */ protected void processQueryResults(DefaultAuthorizationMap map, NamingEnumeration<SearchResult> results, DestinationType destinationType, PermissionType permissionType) throws Exception { while (results.hasMore()) { SearchResult result = results.next(); AuthorizationEntry entry = null; try { entry = getEntry(map, new LdapName(result.getNameInNamespace()), destinationType); } catch (Exception e) { LOG.error("Policy not applied! Error parsing authorization policy entry under {}", result.getNameInNamespace(), e); continue; } applyACL(entry, result, permissionType); } }
/** * Processes results from a directory query in the context of a given destination type and permission type. This * implementation should not be invoked concurrently. * * @param results * the results to process * @param destinationType * the type of the destination for which the directory results apply * @param permissionType * the type of the permission for which the directory results apply * * @throws Exception * if there is an error processing the results */ protected void processQueryResults(DefaultAuthorizationMap map, NamingEnumeration<SearchResult> results, DestinationType destinationType, PermissionType permissionType) throws Exception { while (results.hasMore()) { SearchResult result = results.next(); AuthorizationEntry entry = null; try { entry = getEntry(map, new LdapName(result.getNameInNamespace()), destinationType); } catch (Exception e) { LOG.error("Policy not applied! Error parsing authorization policy entry under {}", result.getNameInNamespace(), e); continue; } applyACL(entry, result, permissionType); } }
/** * Processes results from a directory query in the context of a given destination type and permission type. This * implementation should not be invoked concurrently. * * @param results * the results to process * @param destinationType * the type of the destination for which the directory results apply * @param permissionType * the type of the permission for which the directory results apply * * @throws Exception * if there is an error processing the results */ protected void processQueryResults(DefaultAuthorizationMap map, NamingEnumeration<SearchResult> results, DestinationType destinationType, PermissionType permissionType) throws Exception { while (results.hasMore()) { SearchResult result = results.next(); AuthorizationEntry entry = null; try { entry = getEntry(map, new LdapName(result.getNameInNamespace()), destinationType); } catch (Exception e) { LOG.error("Policy not applied! Error parsing authorization policy entry under {}", result.getNameInNamespace(), e); continue; } applyACL(entry, result, permissionType); } }
/** * Handler for removed policy entries in the directory. * * @param namingEvent * the removed entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectRemoved(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Removing object: {}", namingEvent.getOldBinding()); Binding result = namingEvent.getOldBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyAcl(entry, permissionType, new HashSet<Object>()); } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for object removal for removal of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object removal for removal of {}", result.getName(), e); } }
/** * Handler for removed policy entries in the directory. * * @param namingEvent * the removed entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectRemoved(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Removing object: {}", namingEvent.getOldBinding()); Binding result = namingEvent.getOldBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyAcl(entry, permissionType, new HashSet<Object>()); } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for object removal for removal of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object removal for removal of {}", result.getName(), e); } }
/** * Handler for removed policy entries in the directory. * * @param namingEvent * the removed entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectRemoved(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Removing object: {}", namingEvent.getOldBinding()); Binding result = namingEvent.getOldBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyAcl(entry, permissionType, new HashSet<Object>()); } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for object removal for removal of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object removal for removal of {}", result.getName(), e); } }
/** * Handler for new policy entries in the directory. * * @param namingEvent * the new entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectAdded(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Adding object: {}", namingEvent.getNewBinding()); SearchResult result = (SearchResult) namingEvent.getNewBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyACL(entry, result, permissionType); if (!(entry instanceof TempDestinationAuthorizationEntry)) { map.put(entry.getDestination(), entry); } } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for addition of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object addition for addition of {}", result.getName(), e); } }
/** * Handler for new policy entries in the directory. * * @param namingEvent * the new entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectAdded(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Adding object: {}", namingEvent.getNewBinding()); SearchResult result = (SearchResult) namingEvent.getNewBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyACL(entry, result, permissionType); if (!(entry instanceof TempDestinationAuthorizationEntry)) { map.put(entry.getDestination(), entry); } } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for addition of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object addition for addition of {}", result.getName(), e); } }
/** * Handler for new policy entries in the directory. * * @param namingEvent * the new entry event that occurred * @param destinationType * the type of the destination to which the event applies * @param permissionType * the permission type to which the event applies */ public void objectAdded(NamingEvent namingEvent, DestinationType destinationType, PermissionType permissionType) { LOG.debug("Adding object: {}", namingEvent.getNewBinding()); SearchResult result = (SearchResult) namingEvent.getNewBinding(); try { DefaultAuthorizationMap map = this.map.get(); LdapName name = new LdapName(result.getName()); AuthorizationEntry entry = getEntry(map, name, destinationType); applyACL(entry, result, permissionType); if (!(entry instanceof TempDestinationAuthorizationEntry)) { map.put(entry.getDestination(), entry); } } catch (InvalidNameException e) { LOG.error("Policy not applied! Error parsing DN for addition of {}", result.getName(), e); } catch (Exception e) { LOG.error("Policy not applied! Error processing object addition for addition of {}", result.getName(), e); } }