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

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


                    ByteArrayInputStream in = new ByteArrayInputStream( buffer );
                    DataInputStream readIn = new DataInputStream( in );

                    do
                    {
                        IConnection connection = null;
                        if ( readIn.available() > 1 )
                        {
                            int size = readIn.readInt();
                            byte[] connectionName = new byte[size];
                            readIn.read( connectionName );
                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                                new String( connectionName ) );
                        }

                        IEntry entry = null;
                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] dn = new byte[size];
                            readIn.read( dn );
                            entry = connection.getEntryFromCache( new DN( new String( dn ) ) );
                        }
                        else
                        {
                            return null;
                        }
View Full Code Here


                }

                List<ISearch> searchList = new ArrayList<ISearch>();
                try
                {
                    IConnection connection = null;
                    ByteArrayInputStream in = new ByteArrayInputStream( buffer );
                    DataInputStream readIn = new DataInputStream( in );

                    do
                    {
                        if ( readIn.available() > 1 )
                        {
                            int size = readIn.readInt();
                            byte[] connectionName = new byte[size];
                            readIn.read( connectionName );
                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                                new String( connectionName ) );
                        }

                        ISearch search = null;
                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] searchName = new byte[size];
                            readIn.read( searchName );
                            search = connection.getSearchManager().getSearch( new String( searchName ) );
                        }
                        else
                        {
                            return null;
                        }
View Full Code Here

            }
        } );

        if ( this.initialConnection != null )
        {
            IConnection connection = this.initialConnection;
            this.mainWidget.getViewer().reveal( connection );
            this.mainWidget.getViewer().setSelection( new StructuredSelection( connection ), true );
        }

        applyDialogFont( composite );
View Full Code Here

     */
    public String getText( Object obj )
    {
        if ( obj instanceof IConnection )
        {
            IConnection conn = ( IConnection ) obj;
            if ( conn.getEncryptionMethod() == IConnection.ENCYRPTION_LDAPS )
            {
                return conn.getName() + " (LDAPS)";
            }
            else if ( conn.getEncryptionMethod() == IConnection.ENCYRPTION_STARTTLS )
            {
                return conn.getName() + " (StartTLS)";
            }
            else
            {
                return conn.getName();
            }
        }
        else if ( obj != null )
        {
            return obj.toString();
View Full Code Here

     */
    public Image getImage( Object obj )
    {
        if ( obj instanceof IConnection )
        {
            IConnection conn = ( IConnection ) obj;
            return conn.isOpened() ? BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_CONNECTION_CONNECTED )
                : BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_CONNECTION_DISCONNECTED );
        }
        else
        {
            return null;
View Full Code Here

            searchNameText.setText( search.getName() );
        }

        if ( search.getConnection() != null )
        {
            IConnection connection = search.getConnection();
            DN searchBase = search.getSearchBase();

            if ( connectionWidget != null )
            {
                connectionWidget.setConnection( connection );
View Full Code Here

    {

        // check cache
        if ( referralUrlToReferralConnectionCache.containsKey( referralUrl ) )
        {
            IConnection referralConnection = ( IConnection ) referralUrlToReferralConnectionCache.get( referralUrl );
            if ( referralConnection != null )
            {
                IConnection[] connections = BrowserCorePlugin.getDefault().getConnectionManager().getConnections();
                for ( int i = 0; i < connections.length; i++ )
                {
                    IConnection connection = connections[i];
                    if ( referralConnection == connection )
                    {
                        return referralConnection;
                    }
                }
            }
        }

        referralUrlToReferralConnectionCache.remove( referralUrl );

        // open dialog
        final IConnection[] referralConnection = new IConnection[1];
        PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
        {
            public void run()
            {
                SelectReferralConnectionDialog dialog = new SelectReferralConnectionDialog( PlatformUI.getWorkbench()
                    .getDisplay().getActiveShell(), referralUrl );
                if ( dialog.open() == SelectReferralConnectionDialog.OK )
                {
                    IConnection connection = dialog.getReferralConnection();
                    referralUrlToReferralConnectionCache.put( referralUrl, connection );
                    referralConnection[0] = connection;
                }
            }
        } );
View Full Code Here

                exampleSearch.setFilter( filter.toString() );
            }

            else if ( obj instanceof IConnection )
            {
                IConnection connection = ( IConnection ) obj;
                exampleSearch.setConnection( connection );
                if ( connection.getRootDSE().getChildrenCount() > 0 )
                {
                    exampleSearch.setSearchBase( connection.getRootDSE().getChildren()[0].getDn() );
                }
                else
                {
                    exampleSearch.setSearchBase( connection.getRootDSE().getDn() );
                }
            }
            else if ( obj instanceof BrowserCategory )
            {
                BrowserCategory cat = ( BrowserCategory ) obj;
View Full Code Here

        if ( this.referralUrl != null )
        {
            IConnection[] connections = BrowserCorePlugin.getDefault().getConnectionManager().getConnections();
            for ( int i = 0; i < connections.length; i++ )
            {
                IConnection connection = connections[i];
                URL connectionUrl = connection.getUrl();
                if ( connectionUrl != null && referralUrl.toString().startsWith( connectionUrl.toString() ) )
                {
                    this.mainWidget.getViewer().reveal( connection );
                    this.mainWidget.getViewer().setSelection( new StructuredSelection( connection ), true );
                }
View Full Code Here

                }

                List<IEntry> entryList = new ArrayList<IEntry>();
                try
                {
                    IConnection connection = null;
                    ByteArrayInputStream in = new ByteArrayInputStream( buffer );
                    DataInputStream readIn = new DataInputStream( in );

                    do
                    {
                        if ( readIn.available() > 1 )
                        {
                            int size = readIn.readInt();
                            byte[] connectionName = new byte[size];
                            readIn.read( connectionName );
                            connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                                new String( connectionName ) );
                        }

                        IEntry entry = null;
                        if ( readIn.available() > 1 && connection != null )
                        {
                            int size = readIn.readInt();
                            byte[] dn = new byte[size];
                            readIn.read( dn );
                            entry = connection.getEntryFromCache( new DN( new String( dn ) ) );
                        }
                        else
                        {
                            return null;
                        }
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.