Package javax.naming.ldap

Examples of javax.naming.ldap.LdapContext.lookup()


    public void testLdapClassLoaderWithClassLoadedAtDefaultSearchSubtree() throws Exception
    {
        LdapContext root = getRootContext( service );

        // get default naming context to work on
        ServerLdapContext defaultContext = ( ServerLdapContext ) root.lookup( "ou=system" );

        // create an extensible object for holding custom config data
        Attributes classLoaderDefaultSearchContextConfig = new BasicAttributes( true );
        Attribute objectClass = new BasicAttribute( "objectClass" );
        objectClass.add( "top" );
View Full Code Here


         {
            try
            {
               try
               {
                  ctx.lookup(membershipTypeDN);
               }
               catch (NameNotFoundException e)
               {
                  Date now = new Date();
                  mt.setCreatedDate(now);
View Full Code Here

         {
            try
            {
               try
               {
                  ctx.lookup(profileDN);
               }
               catch (NameNotFoundException e)
               {
                  if (broadcast)
                     preSave(profile, true);
View Full Code Here

        // delete success
        ctx.destroySubcontext( "ou=computers,uid=akarasulu,ou=users,ou=system" );

        try
        {
            ctx.lookup( "ou=computers,uid=akarasulu,ou=users,ou=system" );
            fail( "Should never get here." );
        }
        catch ( NameNotFoundException e )
        {
        }
View Full Code Here

        Attributes attrs = new BasicAttributes( "objectClass", "person", true );
        attrs.put( "sn", "foo" );
        attrs.put( "cn", "foo bar" );
        ctx.createSubcontext( "cn=foo bar,ou=system", attrs );
        assertNotNull( ctx.lookup( "cn=foo bar,ou=system" ) );

        // -------------------------------------------------------------------
        // do modify and confirm
        // -------------------------------------------------------------------
View Full Code Here

       
        assertTrue( sc.getDn().toString().contains( "+" ) );

        try
        {
           Object obj = sysRoot.lookup( "cn=John\\+Doe" );
           assertNotNull( obj );
        }
        catch( Exception e )
        {
            fail( e.getMessage() );
View Full Code Here

         */
        sysRoot.destroySubcontext( "ou=testing00" );

        try
        {
            sysRoot.lookup( "ou=testing00" );
            fail( "ou=testing00, ou=system should not exist" );
        }
        catch ( Exception e )
        {
            assertTrue( e instanceof NamingException );
View Full Code Here

         */
        sysRoot.destroySubcontext( "ou=subtest,ou=testing01" );

        try
        {
            sysRoot.lookup( "ou=subtest,ou=testing01" );
            fail( "ou=subtest,ou=testing01,ou=system should not exist" );
        }
        catch ( NamingException e )
        {
            assertTrue( e instanceof NamingException );
View Full Code Here

         */
        sysRoot.destroySubcontext( "ou=testing01" );

        try
        {
            sysRoot.lookup( "ou=testing01" );
            fail( "ou=testing01, ou=system should not exist" );
        }
        catch ( NamingException e )
        {
            assertTrue( e instanceof NamingException );
View Full Code Here

         */
        sysRoot.destroySubcontext( "ou=testing02" );

        try
        {
            sysRoot.lookup( "ou=testing02" );
            fail( "ou=testing02, ou=system should not exist" );
        }
        catch ( NamingException e )
        {
            assertTrue( e instanceof NamingException );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.