Package org.apache.directory.ldapstudio.browser.core.model

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearch


            IEntry parent = ( IEntry ) it.next();
            EventRegistry.fireEntryUpdated( new ChildrenInitializedEvent( parent ), this );
        }
        for ( Iterator it = searchesToUpdateSet.iterator(); it.hasNext(); )
        {
            ISearch search = ( ISearch ) it.next();
            EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search, SearchUpdateEvent.SEARCH_PERFORMED ), this );
        }
    }
View Full Code Here


            {
                return entry;
            }

            // search in directory
            ISearch search = new Search( null, connection, dn, null, ISearch.NO_ATTRIBUTES, ISearch.SCOPE_OBJECT, 1, 0,
                IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, true, true, null );
            this.search( search, monitor );
            ISearchResult[] srs = search.getSearchResults();
            if ( srs.length > 0 )
            {
                return srs[0].getEntry();
            }
            else
View Full Code Here

                            ReferralException re = ( ReferralException ) ce;
                            ISearch[] referralSearches = re.getReferralSearches();
                            for ( int i = 0; i < referralSearches.length; i++ )
                            {
                                ISearch referralSearch = referralSearches[i];

                                // open connection
                                if ( !referralSearch.getConnection().isOpened() )
                                {
                                    referralSearch.getConnection().open( monitor );
                                }

                                referralSearch.getConnection().search( referralSearch, monitor );

                                ISearchResult[] referralSearchResults = referralSearch.getSearchResults();
                                for ( int j = 0; referralSearchResults != null && j < referralSearchResults.length; j++ )
                                {
                                    ISearchResult referralSearchResult = referralSearchResults[j];
                                    referralSearchResult.setSearch( search );
                                    searchResultList.add( referralSearchResult );
View Full Code Here

                // move in searches
                ISearch[] searches = connection.getSearchManager().getSearches();
                for ( int j = 0; j < searches.length; j++ )
                {
                    ISearch search = searches[j];
                    if ( search.getSearchResults() != null )
                    {
                        ISearchResult[] searchResults = search.getSearchResults();
                        for ( int k = 0; k < searchResults.length; k++ )
                        {
                            ISearchResult result = searchResults[k];
                            if ( oldEntry.equals( result.getEntry() ) )
                            {
                                ISearchResult[] newsrs = new ISearchResult[searchResults.length - 1];
                                System.arraycopy( searchResults, 0, newsrs, 0, k );
                                System.arraycopy( searchResults, k + 1, newsrs, k, searchResults.length - k - 1 );
                                search.setSearchResults( newsrs );
                                searchResults = newsrs;
                                k--;
                                searchesToUpdateSet.add( search );
                            }
                        }
View Full Code Here

                EventRegistry.fireEntryUpdated( new EntryMovedEvent( oldEntries[i], newEntries[i] ), this );
            }
        }
        for ( Iterator it = searchesToUpdateSet.iterator(); it.hasNext(); )
        {
            ISearch search = ( ISearch ) it.next();
            EventRegistry.fireSearchUpdated( new SearchUpdateEvent( search, SearchUpdateEvent.SEARCH_PERFORMED ), this );
        }
    }
View Full Code Here

                        sp.setFilter( ISearch.FILTER_TRUE );
                        sp.setScope( ISearch.SCOPE_OBJECT );
                        sp.setReturningAttributes( new String[]
                            { IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
                                IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP, } );
                        ISearch search = new Search( this, sp );
                        // ISearch search = new Search(null, this, new
                        // DN(this.rootDSE.getAttribute("subschemaSubentry").getStringValue()),
                        // ISearch.FILTER_TRUE,
                        // new String[] {
                        // IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
                        // IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP },
                        // ISearch.SCOPE_OBJECT, 0, 0);
                        this.search( search, monitor );
                        ISearchResult[] results = search.getSearchResults();

                        if ( results != null && results.length == 1 )
                        {
                            String schemaTimestamp = results[0]
                                .getAttribute( IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP ) != null ? results[0]
View Full Code Here

    {
        this.rootDSE = new RootDSE( this );
        this.cacheEntry( this.rootDSE );

        // First get ALL attributes
        ISearch search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, null, ISearch.SCOPE_OBJECT, 0, 0,
            IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
        this.search( search, monitor );

        // Second get well-known root DSE attributes
        search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, ROOT_DSE_ATTRIBUTES, ISearch.SCOPE_OBJECT, 0,
View Full Code Here

        monitor.beginTask( " ", searches.length + 1 ); //$NON-NLS-1$
        monitor.reportProgress( " " ); //$NON-NLS-1$

        for ( int pi = 0; pi < searches.length; pi++ )
        {
            ISearch search = searches[pi];

            monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__search_task, new String[]
                { search.getName() } ) );
            monitor.worked( 1 );

            if ( search.getConnection() != null && search.getConnection().isOpened() )
            {

                // // clear search result attributes
                // if(search.getSearchResults() != null) {
                // ISearchResult[] srs = search.getSearchResults();
                // for (int s = 0; s < srs.length; s++) {
                // IEntry entry = srs[s].getEntry();
                // entry.setAttributesInitialized(false, entry.getConnection());
                // }
                // }

                search.getConnection().search( search, monitor );
            }
        }
    }
View Full Code Here

                    ReferralException re = ( ReferralException ) ce;
                    ISearch[] referralSearches = re.getReferralSearches();
                    for ( int i = 0; i < referralSearches.length; i++ )
                    {
                        ISearch referralSearch = referralSearches[i];

                        // open connection
                        if ( !referralSearch.getConnection().isOpened() )
                        {
                            referralSearch.getConnection().open( monitor );
                        }

                        // export recursive
                        export( referralSearch.getConnection(), referralSearch.getSearchParameter(), bufferedWriter,
                            count, monitor, attributes, attributeDelimiter, valueDelimiter, quoteCharacter,
                            lineSeparator, binaryEncoding, exportDn );
                    }
                }
            }
View Full Code Here

        // update state
        String url = "";
        boolean enabled = true;
        if ( input != null && input instanceof ISearch )
        {
            ISearch search = ( ISearch ) input;

            if ( filteredAndSortedElements.length < elements.length )
            {
                url += filteredAndSortedElements.length + " of ";
            }

            if ( search.getSearchResults() == null )
            {
                url += "Search not performed  -  ";
                enabled = false;
            }
            else if ( search.getSearchResults().length == 1 )
            {
                url += search.getSearchResults().length + " Result  -  ";
            }
            else
            {
                url += search.getSearchResults().length + " Results  -  ";
            }

            // url += search.getURL();
            url += "Search Base: " + search.getSearchBase().toString() + "  -  ";
            url += "Filter: " + search.getFilter();

            boolean showDn = BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
                BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN )
                || search.getReturningAttributes().length == 0;
            this.configuration.getFilter().inputChanged( search, showDn );
            this.configuration.getSorter().inputChanged( search, showDn );
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.ISearch

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.