|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.ldap.LDAPUrl
Encapsulates parameters of an LDAP URL query as defined in RFC2255. An LDAPUrl object can be passed to LDAPConnection.search to retrieve search results.
Sample Code: UrlSearch.java
LDAPConnection.search(java.lang.String, int, java.lang.String, java.lang.String[], boolean)
,
Serialized FormConstructor Summary | |
LDAPUrl()
This constructor was added to support default Serialization |
|
LDAPUrl(java.lang.String url)
Constructs a URL object with the specified string as the URL. |
|
LDAPUrl(java.lang.String host,
int port,
java.lang.String dn)
Constructs a URL object with the specified host, port, and DN. |
|
LDAPUrl(java.lang.String host,
int port,
java.lang.String dn,
java.lang.String[] attrNames,
int scope,
java.lang.String filter,
java.lang.String[] extensions)
Constructs an LDAP URL with all fields explicitly assigned, to specify an LDAP search operation. |
|
LDAPUrl(java.lang.String host,
int port,
java.lang.String dn,
java.lang.String[] attrNames,
int scope,
java.lang.String filter,
java.lang.String[] extensions,
boolean secure)
Constructs an LDAP URL with all fields explicitly assigned, including isSecure, to specify an LDAP search operation. |
Method Summary | |
java.lang.Object |
clone()
Returns a clone of this URL object. |
static java.lang.String |
decode(java.lang.String URLEncoded)
Decodes a URL-encoded string. |
static java.lang.String |
encode(java.lang.String toEncode)
Encodes an arbitrary string using the URL encoding rules. |
java.lang.String[] |
getAttributeArray()
Returns an array of attribute names specified in the URL. |
java.util.Enumeration |
getAttributes()
Returns an enumerator for the attribute names specified in the URL. |
java.lang.String |
getDN()
Returns the base distinguished name encapsulated in the URL. |
java.lang.String[] |
getExtensions()
Returns any LDAP URL extensions specified, or null if none are specified. |
java.lang.String |
getFilter()
Returns the search filter or null if none was specified. |
java.lang.String |
getHost()
Returns the name of the LDAP server in the URL. |
int |
getPort()
Returns the port number of the LDAP server in the URL. |
int |
getScope()
Returns the depth of search. |
boolean |
isSecure()
Returns true if the URL is of the type ldaps (LDAP over SSL, a predecessor to startTls) |
static java.lang.Object |
readDSML(java.io.InputStream input)
This method is used to deserialize the DSML encoded representation of this class. |
void |
readExternal(java.io.ObjectInput in)
Reads the serialized object from the underlying input stream. |
java.lang.String |
toString()
Returns a valid string representation of this LDAP URL. |
void |
writeDSML(java.io.OutputStream oout)
This method does DSML serialization of the instance. |
void |
writeExternal(java.io.ObjectOutput out)
Writes the object state to a stream in XML format |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LDAPUrl()
public LDAPUrl(java.lang.String url) throws java.net.MalformedURLException
url
- An LDAP URL string, e.g.
"ldap://ldap.example.com:80/dc=example,dc=com?cn,
sn?sub?(objectclass=inetOrgPerson)".
java.net.MalformedURLException
- The specified URL cannot be parsed.public LDAPUrl(java.lang.String host, int port, java.lang.String dn)
This form is used to create URL references to a particular object in the directory.
host
- Host identifier of LDAP server, or null for
"localhost".
port
- The port number for LDAP server (use
LDAPConnection.DEFAULT_PORT for default port).
dn
- Distinguished name of the base object of the search.public LDAPUrl(java.lang.String host, int port, java.lang.String dn, java.lang.String[] attrNames, int scope, java.lang.String filter, java.lang.String[] extensions)
host
- Host identifier of LDAP server, or null for
"localhost".
port
- The port number for LDAP server (use
LDAPConnection.DEFAULT_PORT for default port).
dn
- Distinguished name of the base object of the search.
attrNames
- Names or OIDs of attributes to retrieve. Passing a
null array signifies that all user attributes are to be
retrieved. Passing a value of "*" allows you to specify
that all user attributes as well as any specified
operational attributes are to be retrieved.
scope
- Depth of search (in DN namespace). Use one of
SCOPE_BASE, SCOPE_ONE, SCOPE_SUB from LDAPConnection.
filter
- The search filter specifying the search criteria.
extensions
- Extensions provide a mechanism to extend the
functionality of LDAP URLs. Currently no
LDAP URL extensions are defined. Each extension
specification is a type=value expression, and may
be null
or empty. The =value part may be
omitted. The expression may be prefixed with '!' if it
is mandatory for the evaluation of the URL.public LDAPUrl(java.lang.String host, int port, java.lang.String dn, java.lang.String[] attrNames, int scope, java.lang.String filter, java.lang.String[] extensions, boolean secure)
host
- Host identifier of LDAP server, or null for
"localhost".
port
- The port number for LDAP server (use
LDAPConnection.DEFAULT_PORT for default port).
dn
- Distinguished name of the base object of the search.
attrNames
- Names or OIDs of attributes to retrieve. Passing a
null array signifies that all user attributes are to be
retrieved. Passing a value of "*" allows you to specify
that all user attributes as well as any specified
operational attributes are to be retrieved.
scope
- Depth of search (in DN namespace). Use one of
SCOPE_BASE, SCOPE_ONE, SCOPE_SUB from LDAPConnection.
filter
- The search filter specifying the search criteria.
from LDAPConnection: SCOPE_BASE, SCOPE_ONE, SCOPE_SUB.
extensions
- Extensions provide a mechanism to extend the
functionality of LDAP URLs. Currently no
LDAP URL extensions are defined. Each extension
specification is a type=value expression, and may
be null
or empty. The =value part may be
omitted. The expression may be prefixed with '!' if it
is mandatory for the evaluation of the URL.
secure
- If true creates an LDAP URL of the ldaps typeMethod Detail |
public java.lang.Object clone()
public static java.lang.String decode(java.lang.String URLEncoded) throws java.net.MalformedURLException
Any occurences of %HH are decoded to the hex value represented. However, this method does NOT decode "+" into " ".
URLEncoded
- String to decode.
java.net.MalformedURLException
- The URL could not be parsed.public static java.lang.String encode(java.lang.String toEncode)
Any illegal characters are encoded as %HH.
toEncode
- The string to encode.
public java.lang.String[] getAttributeArray()
public java.util.Enumeration getAttributes()
public java.lang.String getDN()
public java.lang.String[] getExtensions()
public java.lang.String getFilter()
null
if none was specified.
public java.lang.String getHost()
public int getPort()
public int getScope()
public boolean isSecure()
public java.lang.String toString()
public void writeDSML(java.io.OutputStream oout) throws java.io.IOException
oout
- Outputstream where the serialzed data has to be written
java.io.IOException
- if write fails on OutputStreampublic static java.lang.Object readDSML(java.io.InputStream input) throws java.io.IOException
input
- InputStream for the DSML formatted data.
java.io.IOException
- when serialization fails.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The ObjectOutput stream where the Object in XML format
is being written to
java.io.IOException
- - If I/O errors occurpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The ObjectInput stream where the Serialized Object is being read from
java.io.IOException
- - If I/O errors occur
java.lang.ClassNotFoundException
- - If the class for an object being restored
cannot be found.
|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |