Package com.sun.jndi.ldap

Examples of com.sun.jndi.ldap.LdapCtx


                Assert.assertSame(ldapContext1, ldapContext2);
            } else {
                Assert.assertNotSame(ldapContext1, ldapContext2);
            }
            LOGGER.info("acquired external LDAP context: " + ldapContext1.toString());
            LdapCtx c = (LdapCtx)ldapContext1.lookup("dc=jboss,dc=org");
            c = (LdapCtx)c.lookup("ou=People");
            Attributes attributes = c.getAttributes("uid=jduke");
            Assert.assertTrue(attributes.get("description").contains("awesome"));
            // resource injection
            LookupEjb ejb = (LookupEjb) ctx.lookup("java:module/LookupEjb");
            Assert.assertNotNull(ejb);
            c = ejb.getLdapCtx();
            Assert.assertNotNull(c);
            c = (LdapCtx)c.lookup("ou=People");
            attributes = c.getAttributes("uid=jduke");
            Assert.assertTrue(attributes.get("description").contains("awesome"));
        } finally {
            if (ctx != null) {
                ctx.close();
            }
View Full Code Here


    }

    static ResolveResult getUsingURLIgnoreRootDN(String url, Hashtable env)
            throws NamingException {
        LdapURL ldapUrl = new LdapURL(url);
        DirContext ctx = new LdapCtx("", ldapUrl.getHost(), ldapUrl.getPort(),
            env, ldapUrl.useSsl());
        String dn = (ldapUrl.getDN() != null ? ldapUrl.getDN() : "");

        // Represent DN as empty or single-component composite name.
        CompositeName remaining = new CompositeName();
View Full Code Here

TOP

Related Classes of com.sun.jndi.ldap.LdapCtx

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.