@RolesAllowed("system") public Experimenter findExperimenter(String username) { PersonContextMapper mapper = getPersonContextMapper(); return mapUserName(username, mapper); }
@RolesAllowed("system") public Experimenter searchByDN(String dns) { DistinguishedName dn = new DistinguishedName(dns); return (Experimenter) ldap.lookup(dn, getPersonContextMapper()); }
@RolesAllowed("system") public String findDN(String username) { PersonContextMapper mapper = getPersonContextMapper(); return mapper.getDn(findExperimenter(username)); }
@SuppressWarnings("unchecked") @RolesAllowed("system") public List<Experimenter> searchAll() { return ldap.search(DistinguishedName.EMPTY_PATH, config.getUserFilter() .encode(), getPersonContextMapper()); }
@SuppressWarnings("unchecked") @RolesAllowed("system") public List<Experimenter> searchByAttribute(String dns, String attr, String value) { DistinguishedName dn; if (dns == null) { dn = DistinguishedName.EMPTY_PATH; } else { dn = new DistinguishedName(dns); } if (attr != null && !attr.equals("") && value != null && !value.equals("")) { AndFilter filter = new AndFilter(); filter.and(config.getUserFilter()); filter.and(new EqualsFilter(attr, value)); return ldap.search(dn, filter.encode(), getPersonContextMapper()); } else { return Collections.emptyList(); } }
@RolesAllowed("system") @SuppressWarnings("unchecked") public List<Experimenter> searchByAttributes(String dn, String[] attributes, String[] values) { if (attributes.length != values.length) { return Collections.emptyList(); } AndFilter filter = new AndFilter(); for (int i = 0; i < attributes.length; i++) { filter.and(new EqualsFilter(attributes[i], values[i])); } return ldap.search(new DistinguishedName(dn), filter.encode(), getPersonContextMapper()); }
"omeName", username); Experimenter ldapExp = findExperimenter(username); String ldapDN = getPersonContextMapper().getDn(ldapExp); DistinguishedName dn = new DistinguishedName(ldapDN); GroupLoader loader = new GroupLoader(username, dn);
String ldapDn = getPersonContextMapper().getDn(exp); DistinguishedName dn = new DistinguishedName(ldapDn);