src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java
Print this page
@@ -40,11 +40,11 @@
*/
final public class ldapURLContext
extends com.sun.jndi.toolkit.url.GenericURLDirContext {
- ldapURLContext(Hashtable env) {
+ ldapURLContext(Hashtable<?,?> env) {
super(env);
}
/**
* Resolves 'name' into a target context with remaining name.
@@ -54,11 +54,11 @@
* For example, with a LDAP URL "ldap://localhost:389/o=widget,c=us",
* this method resolves "ldap://localhost:389/" to the root LDAP
* context on the server 'localhost' on port 389,
* and returns as the remaining name "o=widget, c=us".
*/
- protected ResolveResult getRootURLContext(String name, Hashtable env)
+ protected ResolveResult getRootURLContext(String name, Hashtable<?,?> env)
throws NamingException {
return ldapURLContextFactory.getUsingURLIgnoreRootDN(name, env);
}
/**
@@ -169,35 +169,39 @@
} else {
super.rename(oldName, newName);
}
}
- public NamingEnumeration list(String name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(String name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
return super.list(name);
}
}
- public NamingEnumeration list(Name name) throws NamingException {
+ public NamingEnumeration<NameClassPair> list(Name name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
return super.list(name);
}
}
- public NamingEnumeration listBindings(String name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(String name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
throw new InvalidNameException(name);
} else {
return super.listBindings(name);
}
}
- public NamingEnumeration listBindings(Name name) throws NamingException {
+ public NamingEnumeration<Binding> listBindings(Name name)
+ throws NamingException {
if (LdapURL.hasQueryComponents(name.get(0))) {
throw new InvalidNameException(name.toString());
} else {
return super.listBindings(name);
}
@@ -445,11 +449,11 @@
return super.getSchemaClassDefinition(name);
}
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
Attributes matchingAttributes)
throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
return searchUsingURL(name);
@@ -457,11 +461,11 @@
return super.search(name, matchingAttributes);
}
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
Attributes matchingAttributes)
throws NamingException {
if (name.size() == 1) {
return search(name.get(0), matchingAttributes);
} else if (LdapURL.hasQueryComponents(name.get(0))) {
@@ -470,11 +474,11 @@
return super.search(name, matchingAttributes);
}
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
Attributes matchingAttributes,
String[] attributesToReturn)
throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
@@ -483,11 +487,11 @@
return super.search(name, matchingAttributes, attributesToReturn);
}
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
Attributes matchingAttributes,
String[] attributesToReturn)
throws NamingException {
if (name.size() == 1) {
@@ -498,11 +502,11 @@
return super.search(name, matchingAttributes, attributesToReturn);
}
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
String filter,
SearchControls cons)
throws NamingException {
if (LdapURL.hasQueryComponents(name)) {
@@ -511,11 +515,11 @@
return super.search(name, filter, cons);
}
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
String filter,
SearchControls cons)
throws NamingException {
if (name.size() == 1) {
@@ -526,11 +530,11 @@
return super.search(name, filter, cons);
}
}
// divert the search operation when the LDAP URL has query components
- public NamingEnumeration search(String name,
+ public NamingEnumeration<SearchResult> search(String name,
String filterExpr,
Object[] filterArgs,
SearchControls cons)
throws NamingException {
@@ -540,11 +544,11 @@
return super.search(name, filterExpr, filterArgs, cons);
}
}
// divert the search operation when name has a single component
- public NamingEnumeration search(Name name,
+ public NamingEnumeration<SearchResult> search(Name name,
String filterExpr,
Object[] filterArgs,
SearchControls cons)
throws NamingException {
@@ -557,11 +561,11 @@
}
}
// Search using the LDAP URL in name.
// LDAP URL query components override the search argments.
- private NamingEnumeration searchUsingURL(String name)
+ private NamingEnumeration<SearchResult> searchUsingURL(String name)
throws NamingException {
LdapURL url = new LdapURL(name);
ResolveResult res = getRootURLContext(name, myEnv);