示例#1
0
        /// <summary>
        /// Sends a GetChannelMetadata message to a store with the specified URIs.
        /// </summary>
        /// <param name="uris">The list of URIs.</param>
        /// <returns>The sent message on success; <c>null</c> otherwise.</returns>
        public virtual EtpMessage <GetChannelMetadata> GetChannelMetadata(IDictionary <string, string> uris, IMessageHeaderExtension extension = null)
        {
            var body = new GetChannelMetadata
            {
                Uris = uris ?? new Dictionary <string, string>(),
            };

            return(SendRequest(body, extension: extension));
        }
示例#2
0
        /// <summary>
        /// Sends a GetChannelMetadata message to a producer with the specified URIs.
        /// </summary>
        /// <param name="uris">The list of URIs.</param>
        /// <returns>The message identifier.</returns>
        public virtual long GetChannelMetadata(IList <string> uris)
        {
            var header = CreateMessageHeader(Protocols.ChannelSubscribe, MessageTypes.ChannelSubscribe.GetChannelMetadata);

            var channelDescribe = new GetChannelMetadata
            {
                Uris = uris
            };

            return(Session.SendMessage(header, channelDescribe));
        }
        /// <summary>
        /// Handles the GetChannelMetadata message from a consumer.
        /// </summary>
        /// <param name="header">The message header.</param>
        /// <param name="getChannelMetadata">The GetChannelMetadata message.</param>
        protected virtual void HandleGetChannelMetadata(IMessageHeader header, GetChannelMetadata getChannelMetadata)
        {
            var args = Notify(OnGetChannelMetadata, header, getChannelMetadata, new List <ChannelMetadataRecord>());

            HandleGetChannelMetadata(args);

            if (!args.Cancel)
            {
                GetChannelMetadataResponse(header, args.Context);
            }
        }
示例#4
0
        /// <summary>
        /// Handles the GetChannelMetadata message from a consumer.
        /// </summary>
        /// <param name="header">The message header.</param>
        /// <param name="getChannelMetadata">The GetChannelMetadata message.</param>
        protected virtual void HandleGetChannelMetadata(IMessageHeader header, GetChannelMetadata getChannelMetadata)
        {
            var args     = Notify(OnGetChannelMetadata, header, getChannelMetadata);
            var metadata = new List <ChannelMetadataRecord>();
            var errors   = new List <ErrorInfo>();

            HandleGetChannelMetadata(args, metadata, errors);

            if (!args.Cancel)
            {
                GetChannelMetadataResponse(header, metadata, errors);
            }
        }