Package org.apache.directory.studio.common.core.jobs

Examples of org.apache.directory.studio.common.core.jobs.StudioProgressMonitor


            // Getting the browser connection associated with the connection
            IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
                .getBrowserConnection( input.getConnection() );

            // Creating a StudioProgressMonitor to run the LDIF with
            StudioProgressMonitor studioProgressMonitor = new StudioProgressMonitor( new NullProgressMonitor() );

            // Updating the configuration with the resulting LDIF
            ExecuteLdifRunnable.executeLdif( browserConnection, modificationsLdif.toString(), true, true,
                studioProgressMonitor );

            // Checking if there were errors during the execution of the LDIF
            if ( studioProgressMonitor.errorsReported() )
            {
                throw new Exception(
                    Messages.getString( "ServerConfigurationEditorUtils.ChangesCouldNotBeSavedToConnection" ) ); //$NON-NLS-1$
            }
            else
View Full Code Here


        final StudioProgressMonitor[] spm = new StudioProgressMonitor[1];
        IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress()
        {
            public void run( IProgressMonitor monitor ) throws InterruptedException
            {
                spm[0] = new StudioProgressMonitor( monitor );

                // ensure that connections are opened
                Connection[] connections = runnable.getConnections();
                if ( connections != null )
                {
View Full Code Here

                }
            }
        }

        // try to init entries
        StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
        for ( IEntry entry : rootDseEntries.values() )
        {
            initBaseEntry( entry, dummyMonitor );
        }
View Full Code Here

            // Getting the browser connection associated with the connection
            IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
                .getBrowserConnection( input.getConnection() );

            // Creating a StudioProgressMonitor to run the LDIF with
            StudioProgressMonitor studioProgressMonitor = new StudioProgressMonitor( new NullProgressMonitor() );

            // Updating the configuration with the resulting LDIF
            ExecuteLdifRunnable.executeLdif( browserConnection, modificationsLdif.toString(), true, true,
                studioProgressMonitor );

            // Checking if there were errors during the execution of the LDIF
            if ( studioProgressMonitor.errorsReported() )
            {
                throw new Exception( Messages.getString("ServerConfigurationEditorUtils.ChangesCouldNotBeSavedToConnection") ); //$NON-NLS-1$
            }
            else
            {
View Full Code Here

     * @return the created entry
     */
    private static IEntry createAndCacheEntry( IBrowserConnection browserConnection, Dn dn,
        StudioProgressMonitor monitor )
    {
        StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
        IEntry entry = null;

        // build tree to parent
        LinkedList<Dn> parentDnList = new LinkedList<Dn>();
        Dn parentDn = dn;
        while ( parentDn != null && browserConnection.getEntryFromCache( parentDn ) == null )
        {
            parentDnList.addFirst( parentDn );
            parentDn = parentDn.getParent();
        }

        for ( Dn aDn : parentDnList )
        {
            parentDn = aDn.getParent();
            if ( parentDn == null )
            {
                // only the root DSE has a null parent
                entry = browserConnection.getRootDSE();
            }
            else if ( !parentDn.isEmpty() && browserConnection.getEntryFromCache( parentDn ) != null )
            {
                // a normal entry has a parent but the parent isn't the rootDSE
                IEntry parentEntry = browserConnection.getEntryFromCache( parentDn );
                entry = new Entry( parentEntry, aDn.getRdn() );
                entry.setDirectoryEntry( true );
                parentEntry.addChild( entry );
                parentEntry.setChildrenInitialized( true );
                parentEntry.setHasMoreChildren( true );
                parentEntry.setHasChildrenHint( true );
                browserConnection.cacheEntry( entry );
            }
            else
            {
                // we have a base Dn, check if the entry really exists in LDAP
                // this is to avoid that a node "dc=com" is created for "dc=example,dc=com" context entry
                SearchParameter searchParameter = new SearchParameter();
                searchParameter.setSearchBase( aDn );
                searchParameter.setFilter( null );
                searchParameter.setReturningAttributes( ISearch.NO_ATTRIBUTES );
                searchParameter.setScope( SearchScope.OBJECT );
                searchParameter.setCountLimit( 1 );
                searchParameter.setTimeLimit( 0 );
                searchParameter.setAliasesDereferencingMethod( browserConnection.getAliasesDereferencingMethod() );
                searchParameter.setReferralsHandlingMethod( browserConnection.getReferralsHandlingMethod() );
                searchParameter.setInitHasChildrenFlag( true );
                dummyMonitor.reset();
                StudioNamingEnumeration enumeration = search( browserConnection, searchParameter, dummyMonitor );
                try
                {
                    if ( enumeration != null && enumeration.hasMore() )
                    {
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.common.core.jobs.StudioProgressMonitor

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.