/** * Creates a new {@code LDAPUrl} object from the provided string * representation. * * @param url The string representation of the LDAP URL to create. * * @throws MalformedURLException If the provided string cannot be parsed as * a valid LDAP URL. */ public LDAPUrl(final String url) throws MalformedURLException { try { ldapURL = new LDAPURL(url); } catch (LDAPException le) { debugException(le); throw new MalformedURLException(le.getMessage()); } }
/** * Retrieves the DN for this LDAP URL, if available. * * @return The DN for this LDAP URL, or {@code null} if it is not available. */ public String getDN() { if (ldapURL.baseDNProvided()) { return ldapURL.getBaseDN().toString(); } else { return null; } }
final LDAPURL referralURL = new LDAPURL(urlString); final String host = referralURL.getHost(); if (referralURL.baseDNProvided()) requestBaseDN = referralURL.getBaseDN().toString(); if (referralURL.scopeProvided()) requestScope = referralURL.getScope(); if (referralURL.filterProvided()) requestFilter = referralURL.getFilter();
final LDAPURL referralURL = new LDAPURL(urlString); final String host = referralURL.getHost(); if (referralURL.baseDNProvided()) addRequest = new AddRequest(referralURL.getBaseDN(), attributes, getControls());
final LDAPURL url = new LDAPURL(ref); final RDN[] refRDNs = url.getBaseDN().getRDNs(); final RDN[] newRefRDNs = new RDN[retainRDNs.length + refRDNs.length]; System.arraycopy(retainRDNs, 0, newRefRDNs, 0, retainRDNs.length); final DN newBaseDN = new DN(newRefRDNs); final LDAPURL newURL = new LDAPURL(url.getScheme(), url.getHost(), url.getPort(), newBaseDN, null, null, null); refList.add(newURL.toString());
try ldapURL = new LDAPURL(valueString); if (requireHost && (! ldapURL.hostProvided())) if (requirePort && (! ldapURL.portProvided())) if (requireBaseDN && (! ldapURL.baseDNProvided())) if (requireAttributes && (! ldapURL.attributesProvided())) if (requireScope && (! ldapURL.scopeProvided())) if (requireFilter && (! ldapURL.filterProvided()))
try url = new LDAPURL(line); url.getBaseDN().toString(), scope.getValue(), derefPolicy, sizeLimit.getValue(), timeLimitSeconds.getValue(), typesOnly.isPresent(), url.getFilter(), url.getAttributes()); final ResultCode rc = doSearch(pool, searchRequest, rateLimiter, searchControls);
final int portValue = decodeHostPort(hostPort, hostBuffer); if (portValue < 0) final int portValue = decodeHostPort(hostPort, hostBuffer); if (portValue < 0) filterProvided = false; baseDN = new DN(percentDecode(urlString.substring(slashPos+1))); baseDNProvided = (! baseDN.isNullDN()); return; baseDN = new DN(percentDecode(urlString.substring(slashPos+1, questionMarkPos))); baseDNProvided = (! baseDN.isNullDN()); filterProvided = false; attributes = decodeAttributes(urlString.substring(questionMarkPos+1)); attributesProvided = (attributes.length > 0); return; attributes = decodeAttributes(urlString.substring(questionMarkPos+1, questionMark2Pos)); attributesProvided = (attributes.length > 0); percentDecode(urlString.substring(questionMark3Pos+1)); if (filterStr.length() == 0)
/** * Retrieves the port number for this LDAP URL. * * @return The port number for this LDAP URL. */ public int getPort() { return ldapURL.getPort(); }
/** * Retrieves the address for this LDAP URL, if available. * * @return The address for this LDAP URL, or {@code null} if it is not * available. */ public String getHost() { return ldapURL.getHost(); }
/** * Retrieves the search scope for the LDAP URL. * * @return The search scope for the LDAP URL. */ public int getScope() { return ldapURL.getScope().intValue(); }
/** * Retrieves the filter for this LDAP URL. * * @return The filter for this LDAP URL. */ public String getFilter() { return ldapURL.getFilter().toString(); }
final LDAPURL referralURL = new LDAPURL(urlString); final String host = referralURL.getHost(); if (referralURL.baseDNProvided()) requestBaseDN = referralURL.getBaseDN().toString(); if (referralURL.scopeProvided()) requestScope = referralURL.getScope(); if (referralURL.filterProvided()) requestFilter = referralURL.getFilter();
final LDAPURL referralURL = new LDAPURL(urlString); final String host = referralURL.getHost(); if (referralURL.baseDNProvided()) deleteRequest = new DeleteRequest(referralURL.getBaseDN(), getControls());
final int portValue = decodeHostPort(hostPort, hostBuffer); if (portValue < 0) final int portValue = decodeHostPort(hostPort, hostBuffer); if (portValue < 0) filterProvided = false; baseDN = new DN(percentDecode(urlString.substring(slashPos+1))); baseDNProvided = (! baseDN.isNullDN()); return; baseDN = new DN(percentDecode(urlString.substring(slashPos+1, questionMarkPos))); baseDNProvided = (! baseDN.isNullDN()); filterProvided = false; attributes = decodeAttributes(urlString.substring(questionMarkPos+1)); attributesProvided = (attributes.length > 0); return; attributes = decodeAttributes(urlString.substring(questionMarkPos+1, questionMark2Pos)); attributesProvided = (attributes.length > 0); percentDecode(urlString.substring(questionMark3Pos+1)); if (filterStr.length() == 0)
final LDAPURL referralURL = new LDAPURL(urlString); final String host = referralURL.getHost(); if (referralURL.baseDNProvided()) requestBaseDN = referralURL.getBaseDN().toString(); if (referralURL.scopeProvided()) requestScope = referralURL.getScope(); if (referralURL.filterProvided()) requestFilter = referralURL.getFilter();
final LDAPURL referralURL = new LDAPURL(urlString); final String host = referralURL.getHost(); if (referralURL.baseDNProvided()) modifyRequest = new ModifyRequest(referralURL.getBaseDN(), modifications, getControls());