Package org.apache.directory.ldap.client.api

Examples of org.apache.directory.ldap.client.api.LdapNetworkConnection.connect()


        @SuppressWarnings("unchecked")
        final Callable<Boolean> timeLimitedConnection = timeLimiter.newProxy(
                new Callable<Boolean>() {
                    @Override
                    public Boolean call() throws Exception {
                        return connection.connect();
                    }
                }, Callable.class,
                connectionTimeout, TimeUnit.MILLISECONDS);
        try {
            final Boolean connected = timeLimitedConnection.call();
View Full Code Here


                useSsl = true;
            }
           
            LdapNetworkConnection c = new LdapNetworkConnection( url.getHost(), url.getPort(), useSsl );
            c.setTimeOut( Long.MAX_VALUE );
            c.connect();
            c.bind( ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
            System.out.println( "connected to the server " + url );
            connections.add( c );
        }
    }
View Full Code Here

        LdapNetworkConnection connection = null;
        try
        {
            connection = new LdapNetworkConnection( tlsConfig );
            tlsConfig.setUseTls( true );
            connection.connect();

            connection.bind( "uid=admin,ou=system", "secret" );
            assertTrue( connection.isAuthenticated() );

            // try multiple binds with startTLS DIRAPI-173
View Full Code Here

    @Test
    public void testGetSupportedControlsWithStartTLS() throws Exception
    {
        LdapNetworkConnection connection = new LdapNetworkConnection( tlsConfig );
        tlsConfig.setUseTls( true );
        connection.connect();

        Dn dn = new Dn( "uid=admin,ou=system" );
        connection.bind( dn.getName(), "secret" );

        List<String> controlList = connection.getSupportedControls();
View Full Code Here

    public void testFailsStartTLSWhenSSLIsInUse() throws Exception
    {
        LdapNetworkConnection connection = new LdapNetworkConnection( tlsConfig );
        tlsConfig.setUseSsl( true );
        tlsConfig.setLdapPort( ldapServer.getPortSSL() );
        connection.connect();
        connection.startTls();
    }


    @Test(expected = InvalidConnectionException.class)
View Full Code Here

            connectionConfig.setLdapHost( delegateHost );
            connectionConfig.setLdapPort( delegatePort );
            connectionConfig.setTrustManagers( new NoVerificationTrustManager() );

            ldapConnection = new LdapNetworkConnection( connectionConfig );
            ldapConnection.connect();
            ldapConnection.startTls();
        }
        else if ( delegateSsl )
        {
            connectionConfig = new LdapConnectionConfig();
View Full Code Here

            connectionConfig.setUseSsl( true );
            connectionConfig.setLdapPort( delegatePort );
            connectionConfig.setTrustManagers( new NoVerificationTrustManager() );

            ldapConnection = new LdapNetworkConnection( connectionConfig );
            ldapConnection.connect();
        }
        else
        {
            connectionConfig = new LdapConnectionConfig();
            connectionConfig.setLdapHost( delegateHost );
View Full Code Here

            connectionConfig = new LdapConnectionConfig();
            connectionConfig.setLdapHost( delegateHost );
            connectionConfig.setLdapPort( delegatePort );

            ldapConnection = new LdapNetworkConnection( delegateHost, delegatePort );
            ldapConnection.connect();
        }

        ldapConnection.setTimeOut( 0L );

        try
View Full Code Here

    {
        LdapNetworkConnection connection = null;
        try
        {
            connection = new LdapNetworkConnection( tlsConfig );
            connection.connect();
            connection.startTls();
            connection.bind( "uid=admin,ou=system", "secret" );

            assertTrue( connection.isAuthenticated() );
View Full Code Here

    @Test
    public void testGetSupportedControlsWithStartTLS() throws Exception
    {
        LdapNetworkConnection connection = new LdapNetworkConnection( tlsConfig );
        connection.connect();
        connection.startTls();

        Dn dn = new Dn( "uid=admin,ou=system" );
        connection.bind( dn.getName(), "secret" );
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.