Java 8 ManageReferralControl - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ManageReferralControl class.

This code example shows how to use the following methods:
            String referral = ( String ) re.getReferralInfo();
            assertEquals( "ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system??base", referral );
        } 
 
        ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
            { new ManageReferralControl() } );
 
        // Now let's move the entry 
        ctx.rename( "c=america,ou=Countries,ou=system", "c=USA,ou=Countries,ou=system" );
 
        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
 
        ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
            {} ); 
 
        try 
        { 
            ctx.search( "c=usa,ou=Countries,ou=system", "(cn=alex karasulu)", controls );
            fail( "Should fail here throwing a ReferralException" ); 
        } 
3
CodeRank
This code example shows how to use the following methods:
            String referral = ( String ) re.getReferralInfo();
            assertEquals( "ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system??base", referral );
        } 
 
        ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
            { new ManageReferralControl() } );
 
        // Now let's move the entry 
        ctx.rename( "c=america,ou=Countries,ou=system", "c=america,ou=system" );
 
        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
 
        ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
            {} ); 
 
        try 
        { 
            ctx.search( "c=america,ou=system", "(cn=alex karasulu)", controls );
            fail( "Should fail here throwing a ReferralException" ); 
        } 
3
CodeRank
This code example shows how to use the following methods:
            String referral = ( String ) re.getReferralInfo();
            assertEquals( "ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system??base", referral );
        } 
 
        ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
            { new ManageReferralControl() } );
 
        // Now let's move the entry 
        ctx.rename( "c=america,ou=Countries,ou=system", "c=us,ou=system" );
 
        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
 
        ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
            {} ); 
 
        try 
        { 
            NamingEnumeration<SearchResult> results = ctx.search( "c=us,ou=system", "(cn=alex karasulu)", controls );
 
            results.next();
3
CodeRank
See Code Examples for Java 8 ManageReferralControl Methods: