Package javax.naming.directory

Examples of javax.naming.directory.InitialDirContext.lookup()


        InitialDirContext initialDirContext = new InitialDirContext(env);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        LdapContext context = (LdapContext) initialDirContext.lookup("");

        assertNull(context.getConnectControls());

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });
View Full Code Here


        InitialDirContext initialDirContext = new InitialDirContext(env);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        LdapContext context = (LdapContext) initialDirContext.lookup("");

        Control[] controls = context.getConnectControls();
        assertNotNull(controls);
        assertEquals(1, controls.length);
        Control c = controls[0];
View Full Code Here

        InitialDirContext initialDirContext = new InitialDirContext(env);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        LdapContext context = (LdapContext) initialDirContext.lookup("");

        assertNull(context.getConnectControls());

        server = new MockLdapServer(server);
        server.start();
View Full Code Here

        InitialDirContext initialDirContext = new InitialDirContext(env);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        LdapContext context = (LdapContext) initialDirContext.lookup("");

        Control[] controls = context.getConnectControls();
        assertNotNull(controls);
        assertEquals(1, controls.length);
        Control c = controls[0];
View Full Code Here

                new LdapMessage(LdapASN1Constant.OP_BIND_RESPONSE,
                        new BindResponse(), null),
                new LdapMessage(LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                        new EncodableLdapResult(), null) });

        initialDirContext.lookup("");

        preValue = initialDirContext.addToEnvironment(
                Context.SECURITY_AUTHENTICATION, "simple");
        assertFalse("simple".equals(preValue));
View Full Code Here

                new LdapMessage(LdapASN1Constant.OP_BIND_RESPONSE,
                        new BindResponse(), null),
                new LdapMessage(LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                        new EncodableLdapResult(), null) });

        initialDirContext.lookup("");

    }

    public void testReconnect() throws Exception {
        Control[] expected = new Control[] { new PagedResultsControl(10,
View Full Code Here

        Attribute attr = new BasicAttribute( "userPassword", newUserPassword );
        attributes.put( attr );
        attr = new BasicAttribute( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, newPrincipalName );
        attributes.put( attr );

        DirContext person = ( DirContext ) ctx.lookup( RDN );
        person.modifyAttributes( "", DirContext.REPLACE_ATTRIBUTE, attributes );

        // Read again from directory.
        person = ( DirContext ) ctx.lookup( RDN );
View Full Code Here

        DirContext person = ( DirContext ) ctx.lookup( RDN );
        person.modifyAttributes( "", DirContext.REPLACE_ATTRIBUTE, attributes );

        // Read again from directory.
        person = ( DirContext ) ctx.lookup( RDN );

        attributes = person.getAttributes( "" );

        byte[] userPassword = null;
View Full Code Here

        attr = new BasicAttribute( "userPassword", newUserPassword );
        attributes.put( attr );
        attr = new BasicAttribute( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, newPrincipalName );
        attributes.put( attr );

        person = ( DirContext ) ctx.lookup( RDN );
        person.modifyAttributes( "", DirContext.REPLACE_ATTRIBUTE, attributes );

        // Read again from directory.
        person = ( DirContext ) ctx.lookup( RDN );
View Full Code Here

        person = ( DirContext ) ctx.lookup( RDN );
        person.modifyAttributes( "", DirContext.REPLACE_ATTRIBUTE, attributes );

        // Read again from directory.
        person = ( DirContext ) ctx.lookup( RDN );

        attributes = person.getAttributes( "" );

        if ( attributes.get( "userPassword" ) != null )
        {
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.