public class Handler
extends java.net.URLStreamHandler
For using this Handler it has to be registered within the java.net
URL framework. Regsitration can be performed in three different ways:
java.protocol.handler.pkgs
system property:
System.getProperties().put("java.protocol.handler.pkgs", "iaik.x509.net");
LdapURLStreamHandlerFactory
for this handler:
URL.setURLStreamHandlerFactory(new LdapURLStreamHandlerFactory());
URL u = new URL(null, "ldap://...", new iaik.x509.net.ldap.Handler());In this case the handler will be used for the one particular URL object only. Thus you may have to create all your ldap URLs in this way. Also note that you do not need to create a new Handler object each time, you can use the same for all URLs.
LdapURLConnection
,
LdapURLStreamHandlerFactory
Constructor and Description |
---|
Handler()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getDefaultPort()
Returns the default port (389) for LDAP urls.
|
protected java.net.URLConnection |
openConnection(java.net.URL url)
Creates an LdapURLConnection object to be used for connecting to the ldap
server specified by the given
URL argument. |
protected java.net.URLConnection openConnection(java.net.URL url) throws java.io.IOException
URL
argument.
This method is used by the java.net
URL framework
and typically will not be called immediately by an application.openConnection
in class java.net.URLStreamHandler
url
- the URL to which to connect toLdapURLConnection
object for the given URL
.java.io.IOException
- if an I/O error occurs while creating the LdapURLConnectionprotected int getDefaultPort()
getDefaultPort
in class java.net.URLStreamHandler