Package netscape.ldap

Examples of netscape.ldap.LDAPEntry



    public void importEntries( Enumeration entries )
  throws ImportExportException
    {
  LDAPEntry entry;

  if ( getImportDescriptor() == null )
      setImportDescriptor( new ImportDescriptor() );
  try {
      while ( entries.hasMoreElements() ) {
    entry = (LDAPEntry) entries.nextElement();
    importEntry( entry, getImportDescriptor().getPolicy( entry.getDN() ) );
      }
  } catch ( LDAPException except ) {
      throw new ImportExportException( except );
  }
    }
View Full Code Here


    public void run() {
        connect();
        LDAPSearchResults result = LDAPSearch();
        while (result.hasMoreElements() && connection.isConnected()) {
            byte[] arr = result.getResponseControls()[0].getValue();
            LDAPEntry entry = (LDAPEntry) result.nextElement();
            LDAPAttributeSet attrSet = entry.getAttributeSet();
            Enumeration attrs = attrSet.getAttributes();
            if (entry.getDN().contains("break")) {
                String message = "\n[Thread id: " + threadId + "] " + getDate() + " [BREAK]";
                if(!ldifFormat)
                  write(message);
                System.exit(0);
            } else if (entry.getDN().contains("stop")) {
                try {
                    connection.disconnect();
                    String message = "\n[Thread id: " + threadId + "] " + getDate() + "[STOP]";
                    if(!ldifFormat)
                      write(message);
                    System.exit(0);
                } catch (LDAPException ex) {
                    System.out.println("[Thread id: " + threadId + "]run :" + ex.getLDAPErrorMessage());
                }
            }
            String message = "[Thread id: " + threadId + "] " + getDate() + " [" + controlName(arr[4]) + "]";
           if(!ldifFormat)
             write("\n" + message);
           else
             write("\n");
            String dn = "dn: " + entry.getDN();
            write(dn);
            while (attrs.hasMoreElements()) {
                LDAPAttribute attr = (LDAPAttribute) attrs.nextElement();
                String name = attr.getName();
                Enumeration values = attr.getStringValues();
View Full Code Here

      basedn, LDAPConnection.SCOPE_SUB,
      userNameLDAP, filters, false);

      if(results.hasMoreElements()){
       
                LDAPEntry entry = results.next();               
                userLDAP = new LDAPUsuario();
                userLDAP.setUserId(userNameLDAP);
                userLDAP = obtenerDatosUsuario(filters, entry);               
            }     
     
View Full Code Here

        connection.connect(host,port);
            LDAPSearchResults searchResult = connection.search(basedn,
            LDAPConnection.SCOPE_SUB, userLDAP, null, false);

            while(searchResult.hasMoreElements()){
                LDAPEntry entry = searchResult.next();
                String dn = entry.getDN();
                connection.authenticate(dn, password);
                return connection.isAuthenticated();
            }
       
      }catch(LDAPReferralException e){
View Full Code Here

        try {
            final LDAPSearchResults results = connection.search(
                    this.searchBase, LDAPv2.SCOPE_SUB, this.searchFilter, null,
                    false);
            while (results.hasMoreElements()) {
                final LDAPEntry entry = results.next();
                this.getLog().info("Dumping: " + entry.getDN());
                writer.printEntry(entry);
            }
        } catch (LDAPException e) {
            final String message = "Error communicating with the LDAP directory";
            this.getLog().error(message, e);
View Full Code Here

    private void addEntry(final LDAPConnection connection,
                          final String entryDn,
                          final LDAPAttribute[] attributes) throws LDAPException {
        this.getLog().info("Add Entry: " + entryDn);
        final LDAPAttributeSet attributeSet = new LDAPAttributeSet(attributes);
        final LDAPEntry entry = new LDAPEntry(entryDn, attributeSet);
        connection.add(entry);
    }
View Full Code Here

TOP

Related Classes of netscape.ldap.LDAPEntry

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.