|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.ldap.model.url.LdapUrl
public class LdapUrl
Decodes a LdapUrl, and checks that it complies with the RFC 2255. The grammar is the following :
ldapurl = scheme "://" [hostport] ["/"
[dn ["?" [attributes] ["?" [scope]
["?" [filter] ["?" extensions]]]]]]
scheme = "ldap"
attributes = attrdesc *("," attrdesc)
scope = "base" / "one" / "sub"
dn = Dn
hostport = hostport from Section 5 of RFC 1738
attrdesc = AttributeDescription from Section 4.1.5 of RFC 2251
filter = filter from Section 4 of RFC 2254
extensions = extension *("," extension)
extension = ["!"] extype ["=" exvalue]
extype = token / xtoken
exvalue = LDAPString
token = oid from section 4.1 of RFC 2252
xtoken = ("X-" / "x-") token
| Nested Class Summary | |
|---|---|
static class |
LdapUrl.Extension
An inner bean to hold extension information. |
| Field Summary | |
|---|---|
static LdapUrl |
EMPTY_URL
A null LdapUrl |
static String |
LDAP_SCHEME
The constant for "ldap://" scheme. |
static String |
LDAPS_SCHEME
The constant for "ldaps://" scheme. |
| Constructor Summary | |
|---|---|
LdapUrl()
Construct an empty LdapUrl |
|
LdapUrl(String string)
Create a new LdapUrl from a String after having parsed it. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
List<String> |
getAttributes()
|
byte[] |
getBytesCopy()
|
byte[] |
getBytesReference()
|
Dn |
getDn()
|
LdapUrl.Extension |
getExtension(String type)
Gets the extension. |
List<LdapUrl.Extension> |
getExtensions()
|
String |
getExtensionValue(String type)
Gets the extension value. |
String |
getFilter()
|
String |
getHost()
|
int |
getNbBytes()
|
int |
getPort()
|
String |
getScheme()
|
SearchScope |
getScope()
Returns the scope, one of SearchScope.OBJECT,
SearchScope.ONELEVEL or SearchScope.SUBTREE. |
String |
getString()
|
int |
hashCode()
|
void |
setAttributes(List<String> attributes)
Sets the attributes, null removes all existing attributes. |
void |
setDn(Dn dn)
Sets the dn. |
void |
setFilter(String filter)
Sets the filter. |
void |
setForceScopeRendering(boolean forceScopeRendering)
If set to true forces the toString method to render the scope regardless of optional nature. |
void |
setHost(String host)
Sets the host. |
void |
setPort(int port)
Sets the port. |
void |
setScheme(String scheme)
Sets the scheme. |
void |
setScope(int scope)
Sets the scope. |
void |
setScope(SearchScope scope)
Sets the scope. |
String |
toString()
Get a string representation of a LdapUrl. |
static String |
urlEncode(String url,
boolean doubleEncode)
Encode a String to avoid special characters. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String LDAPS_SCHEME
public static final String LDAP_SCHEME
public static final LdapUrl EMPTY_URL
| Constructor Detail |
|---|
public LdapUrl()
public LdapUrl(String string)
throws LdapURLEncodingException
string - TheString that contains the LdapUrl
LdapURLEncodingException - If the String does not comply with RFC 2255| Method Detail |
|---|
public static String urlEncode(String url,
boolean doubleEncode)
url - The String to encodedoubleEncode - Set if we need to encode the comma
public String toString()
toString in class ObjectforceScopeRenderingpublic List<String> getAttributes()
public Dn getDn()
public List<LdapUrl.Extension> getExtensions()
public LdapUrl.Extension getExtension(String type)
type - the extension type, case-insensitive
public String getExtensionValue(String type)
type - the extension type, case-insensitive
public String getFilter()
public String getHost()
public int getPort()
public SearchScope getScope()
SearchScope.OBJECT,
SearchScope.ONELEVEL or SearchScope.SUBTREE.
public String getScheme()
public int getNbBytes()
public byte[] getBytesReference()
public byte[] getBytesCopy()
public String getString()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic void setScheme(String scheme)
scheme - the new schemepublic void setHost(String host)
host - the new hostpublic void setPort(int port)
port - the new portpublic void setDn(Dn dn)
dn - the new dnpublic void setAttributes(List<String> attributes)
attributes - the new attributespublic void setScope(int scope)
SearchScope.OBJECT,
SearchScope.ONELEVEL or SearchScope.SUBTREE,
otherwise SearchScope.OBJECT is assumed as default.
scope - the new scopepublic void setScope(SearchScope scope)
SearchScope.OBJECT,
SearchScope.ONELEVEL or SearchScope.SUBTREE,
otherwise SearchScope.OBJECT is assumed as default.
scope - the new scopepublic void setFilter(String filter)
filter - the new filterpublic void setForceScopeRendering(boolean forceScopeRendering)
forceScopeRendering - the forceScopeRendering to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||