Exemple #1
0
        /// <summary>
        /// Sends a ChannelsClosed message to a customer as a notification.
        /// </summary>
        /// <param name="channelIds">The IDs of the closed channels.</param>
        /// <param name="reason">The human readable reason why the channels were closed.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelsClosed> NotificationChannelsClosed(IDictionary <string, long> channelIds, string reason, IMessageHeaderExtension extension = null)
        {
            var body = new ChannelsClosed
            {
                Id     = channelIds ?? new Dictionary <string, long>(),
                Reason = reason ?? string.Empty,
            };

            return(SendNotification(body, extension: extension, isMultiPart: true, isFinalPart: true));
        }
Exemple #2
0
        /// <summary>
        /// Sends a ChannelsClosed message to a customer in response to a CloseChannels message.
        /// </summary>
        /// <param name="correlatedHeader">The message header that the messages to send are correlated with.</param>
        /// <param name="channelIds">The channel IDs.</param>
        /// <param name="reason">The human readable reason why the channels were closed.</param>
        /// <param name="isFinalPart">Whether or not this is the final part of a multi-part message.</param>
        /// <param name="extension">The message header extension.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <ChannelsClosed> ResponseChannelsClosed(IMessageHeader correlatedHeader, IDictionary <string, long> channelIds, string reason, bool isFinalPart = true, IMessageHeaderExtension extension = null)
        {
            var body = new ChannelsClosed
            {
                Id     = channelIds ?? new Dictionary <string, long>(),
                Reason = reason ?? string.Empty,
            };

            return(SendResponse(body, correlatedHeader, extension: extension, isMultiPart: true, isFinalPart: isFinalPart));
        }