protected Set<GroupPrincipal> getACLs(String destinationBase, SearchControls constraints, String roleBase, String roleAttribute) { try { Set<GroupPrincipal> roles = new HashSet<GroupPrincipal>(); Set<String> acls = new HashSet<String>(); NamingEnumeration<?> results = context.search(destinationBase, roleBase, constraints); while (results.hasMore()) { SearchResult result = (SearchResult)results.next(); Attributes attrs = result.getAttributes(); if (attrs == null) { continue; } acls = addAttributeValues(roleAttribute, attrs, acls); } for (Iterator<String> iter = acls.iterator(); iter.hasNext();) { String roleName = iter.next(); LdapName ldapname = new LdapName(roleName); Rdn rdn = ldapname.getRdn(ldapname.size() - 1); LOG.debug("Found role: [" + rdn.getValue().toString() + "]"); roles.add(new GroupPrincipal(rdn.getValue().toString())); } return roles; } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } }
public Set<GroupPrincipal> getTempDestinationReadACLs() { try { context = open(); } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } SearchControls constraints = new SearchControls(); constraints.setReturningAttributes(new String[] {readAttribute}); return getACLs(tempSearchBase, constraints, readBase, readAttribute); }
public Set<GroupPrincipal> getAdminACLs(ActiveMQDestination destination) { if (destination.isComposite()) { return getCompositeACLs(destination, adminBase, adminAttribute); } return getACLs(destination, adminBase, adminAttribute); }
protected Set<GroupPrincipal> getACLs(ActiveMQDestination destination, String roleBase, String roleAttribute) { try { context = open(); } catch (NamingException e) { LOG.error(e.toString()); continue; acls = addAttributeValues(roleAttribute, attrs, acls);
protected Set<GroupPrincipal> getCompositeACLs(ActiveMQDestination destination, String roleBase, String roleAttribute) { ActiveMQDestination[] dests = destination.getCompositeDestinations(); Set<GroupPrincipal> acls = null; for (ActiveMQDestination dest : dests) { acls = DestinationMap.union(acls, getACLs(dest, roleBase, roleAttribute)); if (acls == null || acls.isEmpty()) { break; } } return acls; }
public Set<GroupPrincipal> getWriteACLs(ActiveMQDestination destination) { return getACLs(destination, writeBase, writeAttribute); }
public Set<GroupPrincipal> getTempDestinationWriteACLs() { try { context = open(); } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } SearchControls constraints = new SearchControls(); constraints.setReturningAttributes(new String[] {writeAttribute}); return getACLs(tempSearchBase, constraints, writeBase, writeAttribute); }
public Set<GroupPrincipal> getWriteACLs(ActiveMQDestination destination) { if (destination.isComposite()) { return getCompositeACLs(destination, writeBase, writeAttribute); } return getACLs(destination, writeBase, writeAttribute); }
public Set<GroupPrincipal> getReadACLs(ActiveMQDestination destination) { return getACLs(destination, readBase, readAttribute); }
protected Set<GroupPrincipal> getACLs(String destinationBase, SearchControls constraints, String roleBase, String roleAttribute) { try { Set<GroupPrincipal> roles = new HashSet<GroupPrincipal>(); Set<String> acls = new HashSet<String>(); NamingEnumeration<?> results = context.search(destinationBase, roleBase, constraints); while (results.hasMore()) { SearchResult result = (SearchResult)results.next(); Attributes attrs = result.getAttributes(); if (attrs == null) { continue; } acls = addAttributeValues(roleAttribute, attrs, acls); } for (Iterator<String> iter = acls.iterator(); iter.hasNext();) { String roleName = iter.next(); LdapName ldapname = new LdapName(roleName); Rdn rdn = ldapname.getRdn(ldapname.size() - 1); LOG.debug("Found role: [" + rdn.getValue().toString() + "]"); roles.add(new GroupPrincipal(rdn.getValue().toString())); } return roles; } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } }
public Set<GroupPrincipal> getTempDestinationAdminACLs() { try { context = open(); } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } SearchControls constraints = new SearchControls(); constraints.setReturningAttributes(new String[] {adminAttribute}); return getACLs(tempSearchBase, constraints, adminBase, adminAttribute); }
public Set<GroupPrincipal> getReadACLs(ActiveMQDestination destination) { if (destination.isComposite()) { return getCompositeACLs(destination, readBase, readAttribute); } return getACLs(destination, readBase, readAttribute); }
public Set<GroupPrincipal> getAdminACLs(ActiveMQDestination destination) { return getACLs(destination, adminBase, adminAttribute); }
protected Set<GroupPrincipal> getACLs(String destinationBase, SearchControls constraints, String roleBase, String roleAttribute) { try { Set<GroupPrincipal> roles = new HashSet<GroupPrincipal>(); Set<String> acls = new HashSet<String>(); NamingEnumeration<?> results = context.search(destinationBase, roleBase, constraints); while (results.hasMore()) { SearchResult result = (SearchResult)results.next(); Attributes attrs = result.getAttributes(); if (attrs == null) { continue; } acls = addAttributeValues(roleAttribute, attrs, acls); } for (Iterator<String> iter = acls.iterator(); iter.hasNext();) { String roleName = iter.next(); LdapName ldapname = new LdapName(roleName); Rdn rdn = ldapname.getRdn(ldapname.size() - 1); LOG.debug("Found role: [" + rdn.getValue().toString() + "]"); roles.add(new GroupPrincipal(rdn.getValue().toString())); } return roles; } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } }
public Set<GroupPrincipal> getReadACLs(ActiveMQDestination destination) { if (destination.isComposite()) { return getCompositeACLs(destination, readBase, readAttribute); } return getACLs(destination, readBase, readAttribute); }
protected Set<GroupPrincipal> getCompositeACLs(ActiveMQDestination destination, String roleBase, String roleAttribute) { ActiveMQDestination[] dests = destination.getCompositeDestinations(); Set<GroupPrincipal> acls = null; for (ActiveMQDestination dest : dests) { acls = DestinationMap.union(acls, getACLs(dest, roleBase, roleAttribute)); if (acls == null || acls.isEmpty()) { break; } } return acls; }
protected Set<GroupPrincipal> getACLs(String destinationBase, SearchControls constraints, String roleBase, String roleAttribute) { try { Set<GroupPrincipal> roles = new HashSet<GroupPrincipal>(); Set<String> acls = new HashSet<String>(); NamingEnumeration<?> results = context.search(destinationBase, roleBase, constraints); while (results.hasMore()) { SearchResult result = (SearchResult)results.next(); Attributes attrs = result.getAttributes(); if (attrs == null) { continue; } acls = addAttributeValues(roleAttribute, attrs, acls); } for (Iterator<String> iter = acls.iterator(); iter.hasNext();) { String roleName = iter.next(); LdapName ldapname = new LdapName(roleName); Rdn rdn = ldapname.getRdn(ldapname.size() - 1); LOG.debug("Found role: [" + rdn.getValue().toString() + "]"); roles.add(new GroupPrincipal(rdn.getValue().toString())); } return roles; } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } }
public Set<GroupPrincipal> getTempDestinationWriteACLs() { try { context = open(); } catch (NamingException e) { LOG.error(e.toString()); return new HashSet<GroupPrincipal>(); } SearchControls constraints = new SearchControls(); constraints.setReturningAttributes(new String[] {writeAttribute}); return getACLs(tempSearchBase, constraints, writeBase, writeAttribute); }
public Set<GroupPrincipal> getReadACLs(ActiveMQDestination destination) { if (destination.isComposite()) { return getCompositeACLs(destination, readBase, readAttribute); } return getACLs(destination, readBase, readAttribute); }