Package netscape.ldap

Examples of netscape.ldap.LDAPSearchResults


        try
        {
            // Use the netscape API as JNDI cannot be used to do a search without
            // first binding.
            LDAPUrl url = new LDAPUrl( "localhost", ldapServer.getPort(), "", new String[]{"vendorName"}, 0, "(ObjectClass=*)" );
            LDAPSearchResults results = LDAPConnection.search( url );

            if ( results.hasMoreElements() )
            {
                LDAPEntry entry = results.next();

                LDAPAttribute vendorName = entry.getAttribute( "vendorName" );

                if ( vendorName != null )
                {
View Full Code Here


        {
            // Use the netscape API as JNDI cannot be used to do a search without
            // first binding.
            LDAPUrl url = new LDAPUrl( "localhost", getLdapServer().getPort(), "", new String[]
                { "vendorName" }, 0, "(ObjectClass=*)" );
            LDAPSearchResults results = LDAPConnection.search( url );

            if ( results.hasMoreElements() )
            {
                LDAPEntry entry = results.next();

                LDAPAttribute vendorName = entry.getAttribute( "vendorName" );

                if ( vendorName != null )
                {
View Full Code Here

        {
            // Use the netscape API as JNDI cannot be used to do a search without
            // first binding.
            LDAPUrl url = new LDAPUrl( "localhost", getLdapServer().getPort(), "", new String[]
                { "vendorName" }, 0, "(ObjectClass=*)" );
            LDAPSearchResults results = LDAPConnection.search( url );

            if ( results.hasMoreElements() )
            {
                LDAPEntry entry = results.next();

                LDAPAttribute vendorName = entry.getAttribute( "vendorName" );

                if ( vendorName != null )
                {
View Full Code Here

        {
            // Use the netscape API as JNDI cannot be used to do a search without
            // first binding.
            LDAPUrl url = new LDAPUrl( "localhost", getLdapServer().getPort(), "", new String[]
                { "vendorName" }, 0, "(ObjectClass=*)" );
            LDAPSearchResults results = LDAPConnection.search( url );

            if ( results.hasMoreElements() )
            {
                LDAPEntry entry = results.next();

                LDAPAttribute vendorName = entry.getAttribute( "vendorName" );

                if ( vendorName != null )
                {
View Full Code Here

        {
            // Use the netscape API as JNDI cannot be used to do a search without
            // first binding.
            LDAPUrl url = new LDAPUrl( "localhost", getLdapServer().getPort(), "", new String[]
                { "vendorName" }, 0, "(ObjectClass=*)" );
            LDAPSearchResults results = LDAPConnection.search( url );

            if ( results.hasMoreElements() )
            {
                LDAPEntry entry = results.next();

                LDAPAttribute vendorName = entry.getAttribute( "vendorName" );

                if ( vendorName != null )
                {
View Full Code Here

    /**
     * LDAP Search
     * @return LDAPSearchResults
     */
    public LDAPSearchResults LDAPSearch() {
        LDAPSearchResults res = null;
        try {
            LDAPPersistSearchControl persistCtrl = PSearchControl();
            LDAPSearchConstraints cons = connection.getSearchConstraints();
            cons.setBatchSize(1);
            cons.setServerControls(persistCtrl);
View Full Code Here

    /**
     * run thread methode
     */
    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)
View Full Code Here

    try {
     
      connection.connect(host,port);
            String[] filters = LDAPConstants.attrs;
           
      LDAPSearchResults results = connection.search(
      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

   
    try{
     
      String userLDAP = uid+ username;
        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();
            }
       
View Full Code Here

     * @throws MojoExecutionException If an error occurred generating the output file content.
     */
    private void dump(final LDAPConnection connection, final LDAPWriter writer)
            throws MojoExecutionException {
        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";
View Full Code Here

TOP

Related Classes of netscape.ldap.LDAPSearchResults

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.