Package javax.naming.ldap

Examples of javax.naming.ldap.InitialLdapContext.extendedOperation()


        getLdapServer().reloadSslContext();

        // create a new secure connection
        ctx = new InitialLdapContext( env, null );
        tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        tls.setHostnameVerifier( new HostnameVerifier()
        {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
View Full Code Here


        LOG.debug( "About to get initial context" );
        LdapContext ctx = new InitialLdapContext( env, null );

        // Start TLS
        LOG.debug( "About send startTls extended operation" );
        StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        LOG.debug( "Extended operation issued" );
        tls.setHostnameVerifier( new HostnameVerifier()
        {
            public boolean verify( String hostname, SSLSession session )
            {
View Full Code Here

            LOG.debug( "About to get initial context" );
            LdapContext ctx = new InitialLdapContext( env, null );

            // Start TLS
            LOG.debug( "About send startTls extended operation" );
            StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
            LOG.debug( "Extended operation issued" );
            tls.setHostnameVerifier( new HostnameVerifier()
            {
                public boolean verify( String hostname, SSLSession session )
                {
View Full Code Here

        env.put( "java.naming.provider.url", "ldap://localhost:" + getLdapServer().getPort() );
        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
        env.put( "java.naming.security.credentials", "secret" );
        env.put( "java.naming.security.authentication", "simple" );
        LdapContext ctx = new InitialLdapContext( env, null );
        StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        tls.setHostnameVerifier( new HostnameVerifier() {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
            }
View Full Code Here

        getLdapServer().reloadSslContext();
       
        // create a new secure connection
        ctx = new InitialLdapContext( env, null );
        tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        tls.setHostnameVerifier( new HostnameVerifier() {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
            }
View Full Code Here

        LOG.debug( "About to get initial context" );
        LdapContext ctx = new InitialLdapContext( env, null );

        // Start TLS
        LOG.debug( "About send startTls extended operation" );
        StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
        LOG.debug( "Extended operation issued" );
        tls.setHostnameVerifier( new HostnameVerifier() {
            public boolean verify( String hostname, SSLSession session )
            {
                return true;
View Full Code Here

            LOG.debug( "About to get initial context" );
            LdapContext ctx = new InitialLdapContext( env, null );
   
            // Start TLS
            LOG.debug( "About send startTls extended operation" );
            StartTlsResponse tls = ( StartTlsResponse ) ctx.extendedOperation( new StartTlsRequest() );
            LOG.debug( "Extended operation issued" );
            tls.setHostnameVerifier( new HostnameVerifier() {
                public boolean verify( String hostname, SSLSession session )
                {
                    return true;
View Full Code Here

    public void testExtendedOperation001() throws Exception {
        try {
            System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                           "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
            InitialLdapContext ilc = new InitialLdapContext();
            ilc.extendedOperation(null);
            fail("Should not nitialize a ldap context with null.");
        } catch (NullPointerException e) {}

    }
View Full Code Here

     */
    public void testExtendedOperation002() throws Exception {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                        "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
        InitialLdapContext x = new InitialLdapContext();
        StartTlsResponse f = (StartTlsResponse)x.extendedOperation(new StartTlsRequest());
        assertNotNull(f);
        x.close();
    }

    /**
 
View Full Code Here

  public void testDefaultConstructor() throws NamingException {
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
        "org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockLdapContextFactory");
    InitialLdapContext ctx = new InitialLdapContext();
    MyExtendedRequest extendedRequest = new MyExtendedRequest("request - 1");
    ctx.extendedOperation(extendedRequest);
    assertTrue(InvokeRecord.equals(null, extendedRequest));

  }

  public void testConstructor_Controls() throws 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.