Package org.apache.directory.api.ldap.model.url

Examples of org.apache.directory.api.ldap.model.url.LdapUrl


        ConnectionParameterPage[] connectionParameterPages = ConnectionParameterPageManager
            .getConnectionParameterPages();
        for ( Connection connection : connections )
        {
            ConnectionParameter parameter = connection.getConnectionParameter();
            LdapUrl ldapUrl = new LdapUrl();
            ldapUrl.setDn( Dn.EMPTY_DN );
            for ( ConnectionParameterPage connectionParameterPage : connectionParameterPages )
            {
                connectionParameterPage.mergeParametersToLdapURL( parameter, ldapUrl );
            }
            sb.append( ldapUrl.toString() );
            sb.append( ConnectionCoreConstants.LINE_SEPARATOR );
        }
        return sb.toString();
    }
View Full Code Here


                line = line.trim();
                if ( StringUtils.isNotEmpty( line ) )
                {
                    try
                    {
                        LdapUrl ldapUrl = new LdapUrl( line );
                        ConnectionParameter parameter = new ConnectionParameter();
                        for ( ConnectionParameterPage connectionParameterPage : connectionParameterPages )
                        {
                            connectionParameterPage.mergeLdapUrlToParameters( ldapUrl, parameter );
                        }
View Full Code Here

     *
     * @return the LDAP URL
     */
    public LdapUrl getUrl()
    {
        LdapUrl url = new LdapUrl();
        url.setHost( getHost() );
        url.setPort( getPort() );
        return url;
    }
View Full Code Here

     * @param entry the entry
     * @return the LDAP URL
     */
    public static LdapUrl getLdapURL( IBrowserConnection browserConnection )
    {
        LdapUrl url = new LdapUrl();
        if ( browserConnection.getConnection() != null )
        {
            if ( browserConnection.getConnection().getEncryptionMethod() == EncryptionMethod.LDAPS )
            {
                url.setScheme( LdapUrl.LDAPS_SCHEME );
            }
            else
            {
                url.setScheme( LdapUrl.LDAP_SCHEME );
            }
            url.setHost( browserConnection.getConnection().getHost() );
            url.setPort( browserConnection.getConnection().getPort() );
        }
        return url;
    }
View Full Code Here

     * @param entry the entry
     * @return the LDAP URL
     */
    public static LdapUrl getLdapURL( IEntry entry )
    {
        LdapUrl url = getLdapURL( entry.getBrowserConnection() );
        url.setDn( entry.getDn() );
        return url;
    }
View Full Code Here

     * @param search the search
     * @return the LDAP URL
     */
    public static LdapUrl getLdapURL( ISearch search )
    {
        LdapUrl url = getLdapURL( search.getBrowserConnection() );
        url.setDn( search.getSearchBase() );
        if ( search.getReturningAttributes() != null )
        {
            url.setAttributes( Arrays.asList( search.getReturningAttributes() ) );
        }
        url.setScope( search.getScope().getScope() );
        url.setFilter( search.getFilter() );
        return url;
    }
View Full Code Here

        {
            Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager().getConnections();
            for ( int i = 0; i < connections.length; i++ )
            {
                Connection connection = connections[i];
                LdapUrl connectionUrl = connection.getUrl();
                String normalizedConnectionUrl = Utils.getSimpleNormalizedUrl( connectionUrl );
                for ( String url : referralUrls )
                {
                    try
                    {
                        if ( url != null
                            && Utils.getSimpleNormalizedUrl( new LdapUrl( url ) ).equals( normalizedConnectionUrl ) )
                        {
                            mainWidget.getViewer().reveal( connection );
                            mainWidget.getViewer().setSelection( new StructuredSelection( connection ), true );
                            break;
                        }
View Full Code Here

            {
                for ( Iterator<Value<?>> iterator = refAttribute.iterator(); iterator.hasNext(); )
                {
                    Value<?> value = ( Value<?> ) iterator.next();

                    srr.addSearchResultReference( new LdapUrl( ( String ) value.getValue() ) );
                }
            }

            return srr;
        }
View Full Code Here

                    // iterate through the search result
                    while ( !monitor.isCanceled() && enumeration != null && enumeration.hasMore() )
                    {
                        StudioSearchResult sr = ( StudioSearchResult ) enumeration.next();
                        boolean isContinuedSearchResult = sr.isContinuedSearchResult();
                        LdapUrl searchContinuationUrl = sr.getSearchContinuationUrl();

                        if ( searchContinuationUrl == null )
                        {
                            Dn dn = JNDIUtils.getDn( sr );
                            IEntry entry = null;
View Full Code Here

        try
        {
            // check cache
            for ( String url : referralUrls )
            {
                String normalizedUrl = Utils.getSimpleNormalizedUrl( new LdapUrl( url ) );

                if ( referralUrlToReferralConnectionCache.containsKey( normalizedUrl ) )
                {
                    // check if referral connection exists in connection manager
                    Connection referralConnection = referralUrlToReferralConnectionCache.get( normalizedUrl );
                    Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager()
                        .getConnections();
                    for ( int i = 0; i < connections.length; i++ )
                    {
                        Connection connection = connections[i];
                        if ( referralConnection == connection )
                        {
                            return referralConnection;
                        }
                    }

                    // referral connection doesn't exist in connection manager, remove it from cache
                    referralUrlToReferralConnectionCache.remove( normalizedUrl );
                }
            }

            // open dialog
            PlatformUI.getWorkbench().getDisplay().syncExec( new Runnable()
            {
                public void run()
                {
                    SelectReferralConnectionDialog dialog = new SelectReferralConnectionDialog( PlatformUI
                        .getWorkbench()
                        .getDisplay().getActiveShell(), referralUrls );
                    if ( dialog.open() == SelectReferralConnectionDialog.OK )
                    {
                        Connection connection = dialog.getReferralConnection();
                        referralConnections[0] = connection;
                    }
                }
            } );

            // put to cache
            if ( referralConnections[0] != null )
            {
                for ( String url : referralUrls )
                {
                    String normalizedUrl = Utils.getSimpleNormalizedUrl( new LdapUrl( url ) );
                    referralUrlToReferralConnectionCache.put( normalizedUrl, referralConnections[0] );
                }
            }
        }
        catch ( LdapURLEncodingException e )
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.url.LdapUrl

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.