Search in sources :

Example 26 with ResolveResult

use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.

the class GenericURLDirContext method search.

public NamingEnumeration<SearchResult> search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext) res.getResolvedObj();
    try {
        return ctx.search(res.getRemainingName(), filterExpr, filterArgs, cons);
    } finally {
        ctx.close();
    }
}
Also used : ResolveResult(javax.naming.spi.ResolveResult)

Example 27 with ResolveResult

use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.

the class GenericURLDirContext method bind.

public void bind(String name, Object obj, Attributes attrs) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext) res.getResolvedObj();
    try {
        ctx.bind(res.getRemainingName(), obj, attrs);
    } finally {
        ctx.close();
    }
}
Also used : ResolveResult(javax.naming.spi.ResolveResult)

Example 28 with ResolveResult

use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.

the class GenericURLDirContext method getAttributes.

public Attributes getAttributes(String name, String[] attrIds) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext) res.getResolvedObj();
    try {
        return ctx.getAttributes(res.getRemainingName(), attrIds);
    } finally {
        ctx.close();
    }
}
Also used : ResolveResult(javax.naming.spi.ResolveResult)

Example 29 with ResolveResult

use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.

the class ldapURLContext method searchUsingURL.

// Search using the LDAP URL in name.
// LDAP URL query components override the search argments.
private NamingEnumeration<SearchResult> searchUsingURL(String name) throws NamingException {
    LdapURL url = new LdapURL(name);
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext) res.getResolvedObj();
    try {
        return ctx.search(res.getRemainingName(), setFilterUsingURL(url), setSearchControlsUsingURL(url));
    } finally {
        ctx.close();
    }
}
Also used : LdapURL(com.sun.jndi.ldap.LdapURL) ResolveResult(javax.naming.spi.ResolveResult)

Example 30 with ResolveResult

use of javax.naming.spi.ResolveResult in project jdk8u_jdk by JetBrains.

the class GenericURLDirContext method search.

public NamingEnumeration<SearchResult> search(String name, String filter, SearchControls cons) throws NamingException {
    ResolveResult res = getRootURLContext(name, myEnv);
    DirContext ctx = (DirContext) res.getResolvedObj();
    try {
        return ctx.search(res.getRemainingName(), filter, cons);
    } finally {
        ctx.close();
    }
}
Also used : ResolveResult(javax.naming.spi.ResolveResult)

Aggregations

ResolveResult (javax.naming.spi.ResolveResult)31 CompositeName (javax.naming.CompositeName)2 Context (javax.naming.Context)2 Name (javax.naming.Name)2 Reference (javax.naming.Reference)2 LdapURL (com.sun.jndi.ldap.LdapURL)1 RegistryContext (com.sun.jndi.rmi.registry.RegistryContext)1 GenericURLContext (com.sun.jndi.toolkit.url.GenericURLContext)1 CannotProceedException (javax.naming.CannotProceedException)1 InitialContext (javax.naming.InitialContext)1 LinkRef (javax.naming.LinkRef)1 NameNotFoundException (javax.naming.NameNotFoundException)1 EventContext (javax.naming.event.EventContext)1 Resolver (javax.naming.spi.Resolver)1 ServiceName (org.jboss.msc.service.ServiceName)1 Test (org.junit.Test)1