Package org.apache.directory.studio.connection.core

Examples of org.apache.directory.studio.connection.core.Connection


                    {
                        ReferralsInfo newReferralsInfo = handleReferralException( re, referralsInfo );
                        UrlAndDn urlAndDn = newReferralsInfo.getNext();
                        if ( urlAndDn != null )
                        {
                            Connection referralConnection = getReferralConnection( urlAndDn.getUrl(), monitor, this );
                            if ( referralConnection != null )
                            {
                                //                                String referralDn = url.getDn() != null && !url.getDn().isEmpty() ? url.getDn()
                                //                                    .getUpName() : dn;
                                // TODO: referral DN???
                                referralConnection.getJNDIConnectionWrapper().renameEntry( oldDn, newDn, deleteOldRdn,
                                    referralsHandlingMethod, controls, monitor, newReferralsInfo );
                            }
                        }
                    }
                    catch ( NamingException ne )
View Full Code Here


                    {
                        ReferralsInfo newReferralsInfo = handleReferralException( re, referralsInfo );
                        UrlAndDn urlAndDn = newReferralsInfo.getNext();
                        if ( urlAndDn != null )
                        {
                            Connection referralConnection = getReferralConnection( urlAndDn.getUrl(), monitor, this );
                            if ( referralConnection != null )
                            {
                                String referralDn = urlAndDn.getDn() != null && !urlAndDn.getDn().isEmpty() ? urlAndDn
                                    .getDn().getUpName() : dn;

                                referralConnection.getJNDIConnectionWrapper().createEntry( referralDn, attributes,
                                    referralsHandlingMethod, controls, monitor, newReferralsInfo );
                            }
                        }
                    }
                    catch ( NamingException ne )
View Full Code Here

                    {
                        ReferralsInfo newReferralsInfo = handleReferralException( re, referralsInfo );
                        UrlAndDn urlAndDn = newReferralsInfo.getNext();
                        if ( urlAndDn != null )
                        {
                            Connection referralConnection = getReferralConnection( urlAndDn.getUrl(), monitor, this );
                            if ( referralConnection != null )
                            {
                                String referralDn = urlAndDn.getDn() != null && !urlAndDn.getDn().isEmpty() ? urlAndDn
                                    .getDn().getUpName() : dn;

                                referralConnection.getJNDIConnectionWrapper().deleteEntry( referralDn,
                                    referralsHandlingMethod, controls, monitor, newReferralsInfo );
                            }
                        }
                    }
                    catch ( NamingException ne )
View Full Code Here

     *
     * @return the referral connection
     */
    static Connection getReferralConnection( LdapURL url, StudioProgressMonitor monitor, Object source )
    {
        Connection referralConnection = null;
        IReferralHandler referralHandler = ConnectionCorePlugin.getDefault().getReferralHandler();
        if ( referralHandler != null )
        {
            referralConnection = referralHandler.getReferralConnection( url );

            if ( referralConnection != null && !referralConnection.getJNDIConnectionWrapper().isConnected() )
            {
                referralConnection.getJNDIConnectionWrapper().connect( monitor );
                referralConnection.getJNDIConnectionWrapper().bind( monitor );
                for ( IConnectionListener listener : ConnectionCorePlugin.getDefault().getConnectionListeners() )
                {
                    listener.connectionOpened( referralConnection, monitor );
                }
                ConnectionEventRegistry.fireConnectionOpened( referralConnection, source );
View Full Code Here

                        {
                            StudioSearchResult ssr = ( StudioSearchResult ) sr;

                            isReferral = ssr.isReferral();

                            Connection connection = ssr.getConnection();
                            IBrowserConnection bc = BrowserCorePlugin.getDefault().getConnectionManager()
                                .getBrowserConnection( connection );
                            if ( bc != null )
                            {
                                resultBrowserConnection = bc;
View Full Code Here

     * @return a test connection
     */
    private Connection getTestConnection()
    {
        ConnectionParameter cp = connectionParameterPageModifyListener.getTestConnectionParameters();
        Connection conn = new Connection( cp );
        return conn;
    }
View Full Code Here

        fetchBaseDnsButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                Connection connection = getTestConnection();
                IBrowserConnection browserConnection = new BrowserConnection( connection );

                FetchBaseDNsRunnable runnable = new FetchBaseDNsRunnable( browserConnection );
                IStatus status = RunnableContextRunner.execute( runnable, runnableContext, true );
                if ( status.isOK() )
View Full Code Here

        // ensure connection was created
        ConnectionManager connectionManager = ConnectionCorePlugin.getDefault().getConnectionManager();
        assertNotNull( connectionManager.getConnections() );
        assertEquals( 1, connectionManager.getConnections().length );
        Connection connection = connectionManager.getConnections()[0];
        assertEquals( "NewConnectionWizardTest", connection.getName() );
        assertEquals( "localhost", connection.getHost() );
        assertEquals( ldapServer.getPort(), connection.getPort() );
        assertEquals( AuthenticationMethod.SIMPLE, connection.getAuthMethod() );
        assertEquals( "uid=admin,ou=system", connection.getBindPrincipal() );
        assertEquals( "secret", connection.getBindPassword() );

        // ensure connection is visible in Connections view
        assertEquals( 1, connectionsViewBot.getConnectionCount() );

        // close connection
View Full Code Here

        connectionParameter.setPort( port );
        connectionParameter.setEncryptionMethod( EncryptionMethod.NONE );
        connectionParameter.setAuthMethod( AuthenticationMethod.SIMPLE );
        connectionParameter.setBindPrincipal( "uid=admin,ou=system" );
        connectionParameter.setBindPassword( "secret" );
        Connection connection = new Connection( connectionParameter );
        connectionManager.addConnection( connection );

        ConnectionFolderManager connectionFolderManager = ConnectionCorePlugin.getDefault()
            .getConnectionFolderManager();
        ConnectionFolder rootConnectionFolder = connectionFolderManager.getRootConnectionFolder();
        rootConnectionFolder.addConnectionId( connection.getId() );

        selectConnection( name );
        StudioConnectionJob job = new StudioConnectionJob( new OpenConnectionsRunnable( connection ) );
        job.execute();
        job.join();
View Full Code Here

                    referralsInfo = JNDIConnectionWrapper.handleReferralException( re, referralsInfo );
                    UrlAndDn urlAndDn = referralsInfo.getNext();
                    if ( urlAndDn != null )
                    {
                        LdapURL url = urlAndDn.getUrl();
                        Connection referralConnection = JNDIConnectionWrapper
                            .getReferralConnection( url, monitor, this );
                        if ( referralConnection != null )
                        {
                            String referralSearchBase = url.getDn() != null && !url.getDn().isEmpty() ? url.getDn()
                                .getUpName() : searchBase;
                            String referralFilter = url.getFilter() != null && url.getFilter().length() == 0 ? url
                                .getFilter() : filter;
                            SearchControls referralSearchControls = new SearchControls();
                            referralSearchControls.setSearchScope( url.getScope() > -1 ? url.getScope()
                                : searchControls.getSearchScope() );
                            referralSearchControls.setReturningAttributes( url.getAttributes() != null
                                && url.getAttributes().size() > 0 ? url.getAttributes().toArray(
                                new String[url.getAttributes().size()] ) : searchControls.getReturningAttributes() );
                            referralSearchControls.setCountLimit( searchControls.getCountLimit() );
                            referralSearchControls.setTimeLimit( searchControls.getTimeLimit() );
                            referralSearchControls.setDerefLinkFlag( searchControls.getDerefLinkFlag() );
                            referralSearchControls.setReturningObjFlag( searchControls.getReturningObjFlag() );

                            delegate = referralConnection.getJNDIConnectionWrapper().search( referralSearchBase,
                                referralFilter, referralSearchControls, aliasesDereferencingMethod,
                                referralsHandlingMethod, controls, monitor, referralsInfo );
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.connection.core.Connection

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.