Package javax.naming.ldap

Examples of javax.naming.ldap.ManageReferralControl


        // ManageDsaIT control
        Control[] controls = null;
        if ( entry.isReferral() )
        {
            controls = new Control[]
                { new ManageReferralControl( false ) };
        }

        if ( browserConnection.getConnection() != null )
        {
            browserConnection.getConnection().getConnectionWrapper()
View Full Code Here


            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 );
View Full Code Here

            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 );
View Full Code Here

            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 );
View Full Code Here

   * ManageReferralControl, wich has no enter parameters.<p>
   * <p>The expected result is a non null and critical instance of this class.<p>
   */
  public void testManageReferralControl() {
   
    ManageReferralControl mrf=new ManageReferralControl();
    assertNotNull(mrf);
    assertTrue(mrf.isCritical());
   
  }
View Full Code Here

   * parameter, the criticality of the object. The enter parameter in this case is true.<p>
   * <p>The expected result is an object with the mention criticality.<p>
   */
  public void testManageReferralControlBoolean001() {

    ManageReferralControl mrc = new ManageReferralControl(true);
    assertNotNull(mrc);
    assertTrue(mrc.isCritical());
   
  }
View Full Code Here

   * parameter, the criticality of the object. The enter parameter is false.<p>
   * <p>The expected result is an object with the mention criticality.<p>
   */
  public void testManageReferralControlBoolean002() {

    ManageReferralControl mrc = new ManageReferralControl(false);
    assertNotNull(mrc);
    assertFalse(mrc.isCritical());
   
  }
View Full Code Here

   * <p>Here we are testing the ID of this object. The expected ID is the
   * String : "2.16.840.1.113730.3.4.2."<p>
   */
  public void testGetID(){
   
    ManageReferralControl mrc = new ManageReferralControl();
    assertEquals("2.16.840.1.113730.3.4.2",mrc.getID());
  }
View Full Code Here

   * Test for the class javax.naming.ldap.ManageReferralControl
   *
   */
  public void testManageReferralControl(){
   
    ManageReferralControl mrc=new ManageReferralControl();
    ManageReferralControl mrc2=null;
    try{
      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(mrc);
      out.close();
      ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
      mrc2 = (ManageReferralControl) in.readObject();
      in.close();
      assertEquals(mrc.getID(),mrc2.getID());
    }catch (Exception e) {
      fail("Failed with:"+e);
    }
  }
View Full Code Here

        if ( referralsHandlingMethod == ReferralHandlingMethod.MANAGE )
        {
            if ( currentControls == null )
            {
                localControls = new Control[]
                    { new ManageReferralControl( false ) };
            }
            else
            {
                boolean manageDsaItControlAlreadyContained = false;
                for ( Control control : currentControls )
                {
                    if ( ManageReferralControl.OID.equals( control.getID() ) )
                    {
                        manageDsaItControlAlreadyContained = true;
                        break;
                    }
                }
                if ( !manageDsaItControlAlreadyContained )
                {
                    localControls = new Control[currentControls.length + 1];
                    System.arraycopy( currentControls, 0, localControls, 0, currentControls.length );
                    localControls[localControls.length - 1] = new ManageReferralControl( false );
                }
            }
        }
        return localControls;
    }
View Full Code Here

TOP

Related Classes of javax.naming.ldap.ManageReferralControl

Copyright © 2018 www.massapicom. 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.