Package org.apache.directory.shared.ldap.message.internal

Examples of org.apache.directory.shared.ldap.message.internal.InternalSearchResponseReference


        boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaITControl.CONTROL_OID );

        if ( ( ref != null ) && ! hasManageDsaItControl )
        {
            // The entry is a referral.
            InternalSearchResponseReference respRef;
            respRef = new SearchResponseReferenceImpl( req.getMessageId() );
            respRef.setReferral( new ReferralImpl() );
           
            for ( Value<?> val : ref )
            {
                String url = val.getString();
               
                if ( ! url.startsWith( "ldap" ) )
                {
                    respRef.getReferral().addLdapUrl( url );
                }
               
                LdapURL ldapUrl = new LdapURL();
                ldapUrl.setForceScopeRendering( true );
                try
                {
                    ldapUrl.parse( url.toCharArray() );
                }
                catch ( LdapURLEncodingException e )
                {
                    LOG.error( I18n.err( I18n.ERR_165, url, entry ) );
                }

                switch( req.getScope() )
                {
                    case SUBTREE:
                        ldapUrl.setScope( SearchScope.SUBTREE.getScope() );
                        break;
                       
                    case ONELEVEL: // one level here is object level on remote server
                        ldapUrl.setScope( SearchScope.OBJECT.getScope() );
                        break;
                       
                    default:
                        throw new IllegalStateException( I18n.err( I18n.ERR_686 ) );
                }
               
                respRef.getReferral().addLdapUrl( ldapUrl.toString() );
            }
           
            return respRef;
        }
        else
View Full Code Here


        boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaITControl.CONTROL_OID );

        if ( ( ref != null ) && ! hasManageDsaItControl )
        {
            // The entry is a referral.
            InternalSearchResponseReference respRef;
            respRef = new SearchResponseReferenceImpl( req.getMessageId() );
            respRef.setReferral( new ReferralImpl() );
           
            for ( Value<?> val : ref )
            {
                String url = val.getString();
               
                if ( ! url.startsWith( "ldap" ) )
                {
                    respRef.getReferral().addLdapUrl( url );
                }
               
                LdapURL ldapUrl = new LdapURL();
                ldapUrl.setForceScopeRendering( true );
                try
                {
                    ldapUrl.parse( url.toCharArray() );
                }
                catch ( LdapURLEncodingException e )
                {
                    LOG.error( I18n.err( I18n.ERR_165, url, entry ) );
                }

                switch( req.getScope() )
                {
                    case SUBTREE:
                        ldapUrl.setScope( SearchScope.SUBTREE.getScope() );
                        break;
                       
                    case ONELEVEL: // one level here is object level on remote server
                        ldapUrl.setScope( SearchScope.OBJECT.getScope() );
                        break;
                       
                    default:
                        throw new IllegalStateException( I18n.err( I18n.ERR_686 ) );
                }
               
                respRef.getReferral().addLdapUrl( ldapUrl.toString() );
            }
           
            return respRef;
        }
        else
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.message.internal.InternalSearchResponseReference

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.