Novell.Directory.Ldap.LdapConnection.rebuildRequest C# (CSharp) Méthode

rebuildRequest() private méthode

Builds a new request replacing dn, scope, and filter where approprate
LdapException A general exception which includes an error /// message and an Ldap error code. ///
private rebuildRequest ( LdapMessage msg, LdapUrl url, bool reference ) : LdapMessage
msg LdapMessage the original LdapMessage to build the new request from /// ///
url LdapUrl the referral url /// ///
reference bool
Résultat LdapMessage
        private LdapMessage rebuildRequest(LdapMessage msg, LdapUrl url, bool reference)
        {
            System.String dn = url.getDN(); // new base
            System.String filter = null;

            switch (msg.Type)
            {

                case LdapMessage.SEARCH_REQUEST:
                    if (reference)
                    {
                        filter = url.Filter;
                    }
                    break;
                    // We are allowed to get a referral for the following

                case LdapMessage.ADD_REQUEST:
                case LdapMessage.BIND_REQUEST:
                case LdapMessage.COMPARE_REQUEST:
                case LdapMessage.DEL_REQUEST:
                case LdapMessage.EXTENDED_REQUEST:
                case LdapMessage.MODIFY_RDN_REQUEST:
                case LdapMessage.MODIFY_REQUEST:
                    break;
                    // The following return no response

                case LdapMessage.ABANDON_REQUEST:
                case LdapMessage.UNBIND_REQUEST:
                default:
                    throw new LdapLocalException(ExceptionMessages.IMPROPER_REFERRAL, new System.Object[]{msg.Type}, LdapException.LOCAL_ERROR);
            }

            return msg.Clone(dn, filter, reference);
        }