Package netscape.ldap

Examples of netscape.ldap.LDAPConnection.connect()


  LDAPConnection ld = new LDAPConnection();
  int i = 0;
  StringBuffer sb = new StringBuffer();
  try {
      ld.connect(host, LDAPv2.DEFAULT_PORT, auth, password);

      String dn = hr.get("dn");
      if (dn != null) {
    LDAPEntry entry = ld.read(dn, attrs);
View Full Code Here


        try {
            String dn = hr.get("dn");
      if ( hr.get("verify") != null ) {
              ld = new LDAPConnection();
              /* Connect to server */
               ld.connect( host, LDAPv2.DEFAULT_PORT );
              /* Authenticate to the server */
              ld.authenticate( 3, dn, password );
        return;
      }
            ld.connect(host, LDAPv2.DEFAULT_PORT, auth, password);
View Full Code Here

               ld.connect( host, LDAPv2.DEFAULT_PORT );
              /* Authenticate to the server */
              ld.authenticate( 3, dn, password );
        return;
      }
            ld.connect(host, LDAPv2.DEFAULT_PORT, auth, password);
     


            if (hr.get("search") != null) {
                String base = hr.get("base", null);
View Full Code Here

        int port = Integer.parseInt( System.getProperty( testServer + ".port", Integer.toString( DEFAULT_PORT ) ) );
        LOG.debug( testServer + ".port = " + port );

        LDAPConnection conn = new LDAPConnection();
        conn.connect( 3, host, port, admin, password );
        return conn;
    }


    public static LDAPConnection getWiredConnection( LdapServer ldapServer, String principalDn, String password )
View Full Code Here

    public static LDAPConnection getWiredConnection( LdapServer ldapServer, String principalDn, String password )
        throws Exception
    {
        LDAPConnection conn = new LDAPConnection();
        conn.connect( 3, "localhost", ldapServer.getPort(), principalDn, password );
        return conn;
    }


    public static LdapConnection getClientApiConnection( LdapServer ldapServer ) throws Exception
View Full Code Here

        // Attempt to establish a connection to the directory server.
        try
        {
            outputMessages.add( "Attempting to establish a connection to " + host + ":" + port + "...." );
            conn.connect( host, port );
            outputMessages.add( "Connected successfully." );
            outputMessages.add( "" );
        }
        catch ( Exception e )
        {
View Full Code Here

    @Test
    public void testCompareWithoutAuthentication() throws LDAPException
    {
        getLdapServer().getDirectoryService().setAllowAnonymousAccess( false );
        LDAPConnection conn = new LDAPConnection();
        conn.connect( "localhost", getLdapServer().getPort() );
        LDAPAttribute attr = new LDAPAttribute( "uid", "admin" );

        try
        {
            conn.compare( "uid=admin,ou=system", attr );
View Full Code Here

        LDAPConnection conn = null;

        try
        {
            conn = new LDAPConnection();
            conn.connect( 100, "localhost", getLdapServer().getPort(), "uid=admin,ou=system", "secret" );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
            assertEquals( "statuscode", LDAPException.PROTOCOL_ERROR, e.getLDAPResultCode() );
View Full Code Here

        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        conn.setConstraints( constraints );

        try
        {
            conn.connect( 3, "localhost", getLdapServer().getPort(),
                "uid=akarasuluref,ou=users,ou=system", "secret", constraints );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
View Full Code Here

            assertEquals( "statuscode", LDAPException.INVALID_CREDENTIALS, e.getLDAPResultCode() );
        }

        try
        {
            conn.connect( 3, "localhost", getLdapServer().getPort(),
                "uid=akarasuluref,ou=users,ou=system", "secret" );
            fail( "try to connect with illegal version number should fail" );
        }
        catch ( LDAPException e )
        {
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.