Package javax.naming.directory

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


        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


        // Modify password.
        attributes = new BasicAttributes( true );
        attr = new BasicAttribute( "userPassword", newUserPassword );
        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

        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 testAddToEnvironment_binaryAttributeProp() throws Exception {
        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
View Full Code Here

        Connection connection = null;
        try {
            InitialDirContext ctx = LocationFactory.getInitialContextFactory(connectivityProps);
            connection = LocationFactory.getConnection(connectivityProps, ctx);
            session = LocationFactory.getSession(connection);
            Destination dest = (Destination) ctx.lookup(connectivityProps.getDestinationName());
            String selector = connectivityProps.getProperty("Jms.MessageSelector");
            if (dest instanceof Queue) {
                testConnectionToQueue(session, (Queue) dest, selector);
            }
            else {
View Full Code Here

    try {
      InitialDirContext ctx = LocationFactory.getInitialContextFactory(connectivityProps);
      connection = LocationFactory.getConnection(connectivityProps, ctx);
      session = LocationFactory.getSession(connection);

      Destination dest = (Destination) ctx.lookup(connectivityProps.getDestinationName());

      consumer = session.createConsumer(dest, connectivityProps.getProperty("Jms.MessageSelector") );

      Message inMessage = null;
      do {
View Full Code Here

    try {
      InitialDirContext ctx = LocationFactory.getInitialContextFactory(msgToSend.locationProps);
      connection = LocationFactory.getConnection(msgToSend.locationProps, ctx);
      session = LocationFactory.getSession(connection);
     
      Destination dest = (Destination) ctx.lookup(msgToSend.locationProps.getDestinationName());
        producer = session.createProducer(dest);
 
      TextMessage msg = session.createTextMessage();
      String s = KongaIoUtils.read(new File(msgToSend.payloadPath));
      msg.setText(s);
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.