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

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


        // check if connection is opened
        IConnection[] connections = getConnections();
        for ( int i = 0; i < connections.length; i++ )
        {
            IConnection connection = connections[i];
            if ( !connection.isOpened() )
            {
                // monitor.reportError("Connection is closed");

                EventRegistry.suspendEventFireingInCurrentThread();
                try
                {
                    connection.open( monitor );
                }
                finally
                {
                    EventRegistry.resumeEventFireingInCurrentThread();
                }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public boolean performFinish()
    {
        final IConnection conn = cpw.getTestConnection();
        conn.setName( cpw.getName() );
        if ( conn != null )
        {
            BrowserCorePlugin.getDefault().getConnectionManager().addConnection( conn );
            if ( cpw.isOpenConnectionOnFinish() )
            {
View Full Code Here

     */
    public IConnection getConnection( String name )
    {
        for ( Iterator it = connectionList.iterator(); it.hasNext(); )
        {
            IConnection conn = ( IConnection ) it.next();
            if ( conn.getName().equals( name ) )
            {
                return conn;
            }
        }
        return null;
View Full Code Here

        Object[][] object = new Object[connectionList.size()][3];

        Iterator connectionIterator = connectionList.iterator();
        for ( int i = 0; connectionIterator.hasNext(); i++ )
        {
            IConnection conn = ( IConnection ) connectionIterator.next();
            ConnectionParameter connectionParameters = conn.getConnectionParameter();
            ISearch[] searches = conn.getSearchManager().getSearches();
            SearchParameter[] searchParameters = new SearchParameter[searches.length];
            for ( int k = 0; k < searches.length; k++ )
            {
                searchParameters[k] = searches[k].getSearchParameter();
            }
            IBookmark[] bookmarks = conn.getBookmarkManager().getBookmarks();
            BookmarkParameter[] bookmarkParameters = new BookmarkParameter[bookmarks.length];
            for ( int k = 0; k < bookmarks.length; k++ )
            {
                bookmarkParameters[k] = bookmarks[k].getBookmarkParameter();
            }
View Full Code Here

            {
                try
                {
                    for ( int i = 0; i < object.length; i++ )
                    {
                        IConnection conn = new Connection();

                        ConnectionParameter connectionParameters = ( ConnectionParameter ) object[i][0];
                        conn.setConnectionParameter( connectionParameters );

                        if ( object[i].length > 1 )
                        {
                            SearchParameter[] searchParameters = ( SearchParameter[] ) object[i][1];
                            for ( int k = 0; k < searchParameters.length; k++ )
                            {
                                ISearch search = new Search( conn, searchParameters[k] );
                                conn.getSearchManager().addSearch( search );
                            }
                        }

                        if ( object[i].length > 2 )
                        {
                            BookmarkParameter[] bookmarkParameters = ( BookmarkParameter[] ) object[i][2];
                            for ( int k = 0; k < bookmarkParameters.length; k++ )
                            {
                                IBookmark bookmark = new Bookmark( conn, bookmarkParameters[k] );
                                conn.getBookmarkManager().addBookmark( bookmark );
                            }
                        }

                        try
                        {
                            String schemaFilename = getSchemaCacheFileName( conn.getName() );
                            FileReader reader = new FileReader( schemaFilename );
                            Schema schema = new Schema();
                            schema.loadFromLdif( reader );
                            conn.setSchema( schema );
                        }
                        catch ( Exception e )
                        {
                        }
View Full Code Here

        int num = 0;
        for ( int i = 0; !monitor.isCanceled() && !monitor.errorsReported() && i < entriesToDelete.length; i++ )
        {

            IEntry entryToDelete = entriesToDelete[i];
            IConnection connection = entryToDelete.getConnection();

            // delete from directory
            // TODO: use TreeDelete Control, if available
            int errorStatusSize1 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
            num = deleteEntryRecursive( entryToDelete, false, num, monitor );
            int errorStatusSize2 = monitor.getErrorStatus( "" ).getChildren().length; //$NON-NLS-1$
            deletedEntriesSet.add( entryToDelete );

            if ( errorStatusSize1 == errorStatusSize2 )
            {
                // delete from parent
                entryToDelete.getParententry().deleteChild( entryToDelete );
                entriesToUpdateSet.add( entryToDelete.getParententry() );

                // delete from searches
                ISearch[] searches = connection.getSearchManager().getSearches();
                for ( int j = 0; j < searches.length; j++ )
                {
                    ISearch search = searches[j];
                    if ( search.getSearchResults() != null )
                    {
View Full Code Here

                                // parse referral URL
                                String referral = re.getReferrals()[r];
                                URL referralUrl = new URL( referral );

                                // get referral connection
                                IConnection referralConnection = referralHandler.getReferralConnection( referralUrl );
                                if ( referralConnection == null )
                                {
                                    // throw new
                                    // ConnectionException(BrowserCoreMessages.model__no_referral_connection);
                                    continue;
                                }

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

                                ( ( Connection ) referralConnection ).modifyHandler.applyModificationAndLog(
                                    records[i], monitor );
View Full Code Here

                    oldValue = oldLine.getValueAsString();
                }

                Schema schema = editor.getConnection() != null ? editor.getConnection().getSchema()
                    : Schema.DEFAULT_SCHEMA;
                IConnection dummyConnection = new DummyConnection( schema );

                IEntry dummyEntry = null;
                if ( containers[0] instanceof LdifContentRecord )
                {
                    dummyEntry = ModelConverter.ldifContentRecordToEntry( ( LdifContentRecord ) containers[0],
View Full Code Here

    {

        super.setEnabled( isEditableLineSelected() );

        // determine value editor
        IConnection connection = getConnection();
        String attributeDescription = getAttributeDescription();
        Object oldValue = getValue();

        if ( attributeDescription != null )
        {
            valueEditor = valueEditorManager.getCurrentValueEditor( connection.getSchema(), attributeDescription );
            Object rawValue = valueEditor.getRawValue( connection, oldValue );
            if ( !( valueEditor instanceof AbstractDialogValueEditor ) || rawValue == null )
            {
                IValueEditor[] vps = valueEditorManager.getAlternativeValueEditors( connection.getSchema(), attributeDescription );
                for ( int i = 0; i < vps.length
                    && ( !( valueEditor instanceof AbstractDialogValueEditor ) || rawValue == null ); i++ )
                {
                    valueEditor = vps[i];
                    rawValue = valueEditor.getRawValue( connection, oldValue );
View Full Code Here

            // parse referral URL
            String referral = getReferrals()[i];
            URL referralUrl = new URL( referral );

            // get referral connection
            IConnection referralConnection = referralHandler.getReferralConnection( referralUrl );
            if ( referralConnection == null )
            {
                // throw new
                // ConnectionException(BrowserCoreMessages.model__no_referral_connection);
                continue;
View Full Code Here

TOP

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

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.