예제 #1
0
        private static LdapMessage GetResponse(RfcLdapMessage item)
        {
            switch (item.Type)
            {
            case LdapOperation.SearchResponse:
                return(new LdapSearchResult(item));

            case LdapOperation.SearchResultReference:
                return(new LdapSearchResultReference(item));

            default:
                return(new LdapResponse(item));
            }
        }
예제 #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="LdapMessage" /> class.
        ///     Creates an LdapMessage when sending a protocol operation and sends
        ///     some optional controls with the message.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="op">The operation type of message.</param>
        /// <param name="controls">The controls to use with the operation.</param>
        /// <seealso cref="Type"></seealso>
        internal LdapMessage(LdapOperation type, IRfcRequest op, LdapControl[] controls = null)
        {
            // Get a unique number for this request message
            _messageType = type;
            RfcControls asn1Ctrls = null;

            if (controls != null)
            {
                // Move LdapControls into an RFC 2251 Controls object.
                asn1Ctrls = new RfcControls();

                foreach (var t in controls)
                {
                    asn1Ctrls.Add(t.Asn1Object);
                }
            }

            // create RFC 2251 LdapMessage
            Message = new RfcLdapMessage(op, asn1Ctrls);
        }
예제 #3
0
 internal LdapSearchResult(RfcLdapMessage message)
     : base(message)
 {
 }
예제 #4
0
 internal LdapResponse(RfcLdapMessage message)
     : base(message)
 {
 }
예제 #5
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LdapSearchResultReference" /> class.
 ///     Constructs an LdapSearchResultReference object.
 /// </summary>
 /// <param name="message">The LdapMessage with a search reference.</param>
 internal LdapSearchResultReference(RfcLdapMessage message)
     : base(message)
 {
 }
예제 #6
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LdapMessage" /> class.
 ///     Creates an Rfc 2251 LdapMessage when the libraries receive a response
 ///     from a command.
 /// </summary>
 /// <param name="message">A response message.</param>
 internal LdapMessage(RfcLdapMessage message)
 {
     Message = message;
 }