Exemplo n.º 1
0
        public Task <Channel> GetChannelAsync(string channelName, GetRatesCriteria ratesCriteria = null,
                                              CancellationToken cancellationToken = default(CancellationToken))
        {
            Ensure.ArgumentNotNull(channelName, nameof(channelName));

            return(GetAsync <Channel>($"channels/{channelName}", ratesCriteria?.ToQueryParameters(), cancellationToken));
        }
Exemplo n.º 2
0
        public Task <Exchange> GetExchangeAsync(string exchangeName, Vhost vhost, GetRatesCriteria ratesCriteria = null,
                                                CancellationToken cancellationToken = default(CancellationToken))
        {
            Ensure.ArgumentNotNull(exchangeName, nameof(exchangeName));
            Ensure.ArgumentNotNull(vhost, nameof(vhost));

            return(GetAsync <Exchange>($"exchanges/{SanitiseVhostName(vhost.Name)}/{exchangeName}", ratesCriteria?.ToQueryParameters(), cancellationToken));
        }
Exemplo n.º 3
0
        public Task <Queue> GetQueueAsync(string queueName, Vhost vhost, GetLengthsCriteria lengthsCriteria = null,
                                          GetRatesCriteria ratesCriteria = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            Ensure.ArgumentNotNull(queueName, nameof(queueName));
            Ensure.ArgumentNotNull(vhost, nameof(vhost));

            return(GetAsync <Queue>($"queues/{SanitiseVhostName(vhost.Name)}/{SanitiseName(queueName)}",
                                    cancellationToken, lengthsCriteria, ratesCriteria));
        }
Exemplo n.º 4
0
        public Task <Overview> GetOverviewAsync(GetLengthsCriteria lengthsCriteria = null,
                                                GetRatesCriteria ratesCriteria     = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            var queryParameters = MergeQueryParameters(
                lengthsCriteria?.ToQueryParameters(),
                ratesCriteria?.ToQueryParameters()
                );

            return(GetAsync <Overview>("overview", queryParameters, cancellationToken));
        }
        /// <summary>
        ///     Various random bits of information that describe the whole system.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="lengthsCriteria">Criteria for getting samples of queue length data</param>
        /// <param name="ratesCriteria">Criteria for getting samples of rate data</param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public static Overview GetOverview(
            [NotNull] this IManagementClient source,
            GetLengthsCriteria lengthsCriteria  = null,
            GetRatesCriteria ratesCriteria      = null,
            CancellationToken cancellationToken = default
            )
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(source.GetOverviewAsync(lengthsCriteria, ratesCriteria, cancellationToken)
                   .GetAwaiter()
                   .GetResult());
        }
        /// <summary>
        ///     Gets the channel. This returns more detail, including consumers than the GetChannels method.
        /// </summary>
        /// <param name="source"></param>
        /// <returns>The channel.</returns>
        /// <param name="channelName">Channel name.</param>
        /// <param name="ratesCriteria">Criteria for getting samples of rate data</param>
        /// <param name="cancellationToken"></param>
        public static Channel GetChannel(
            [NotNull] this IManagementClient source,
            string channelName,
            GetRatesCriteria ratesCriteria      = null,
            CancellationToken cancellationToken = default
            )
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(source.GetChannelAsync(channelName, ratesCriteria, cancellationToken)
                   .GetAwaiter()
                   .GetResult());
        }
        /// <summary>
        ///     Get an individual exchange by name
        /// </summary>
        /// <param name="source"></param>
        /// <param name="exchangeName">The name of the exchange</param>
        /// <param name="vhost">The virtual host that contains the exchange</param>
        /// <param name="ratesCriteria">Criteria for getting samples of rate data</param>
        /// <param name="cancellationToken"></param>
        /// <returns>The exchange</returns>
        public static Exchange GetExchange(
            [NotNull] this IManagementClient source,
            string exchangeName,
            [NotNull] Vhost vhost,
            GetRatesCriteria ratesCriteria      = null,
            CancellationToken cancellationToken = default
            )
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(source.GetExchangeAsync(exchangeName, vhost, ratesCriteria, cancellationToken)
                   .GetAwaiter()
                   .GetResult());
        }
Exemplo n.º 8
0
 public Task <Overview> GetOverviewAsync(GetLengthsCriteria lengthsCriteria = null,
                                         GetRatesCriteria ratesCriteria     = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(GetAsync <Overview>("overview", cancellationToken, lengthsCriteria, ratesCriteria));
 }
 public Queue GetQueue(string queueName, Vhost vhost, GetLengthsCriteria lengthsCriteria = null, GetRatesCriteria ratesCriteria = null)
 {
     return(Get <Queue>(string.Format("queues/{0}/{1}",
                                      SanitiseVhostName(vhost.Name), SanitiseName(queueName)), lengthsCriteria, ratesCriteria));
 }
 public Exchange GetExchange(string exchangeName, Vhost vhost, GetRatesCriteria ratesCriteria = null)
 {
     return(Get <Exchange>(string.Format("exchanges/{0}/{1}",
                                         SanitiseVhostName(vhost.Name), exchangeName), ratesCriteria));
 }
 public Channel GetChannel(string channelName, GetRatesCriteria ratesCriteria = null)
 {
     return(Get <Channel> (string.Format("channels/{0}", channelName), ratesCriteria));
 }
 public Overview GetOverview(GetLengthsCriteria lengthsCriteria = null, GetRatesCriteria ratesCriteria = null)
 {
     return(Get <Overview>("overview", lengthsCriteria, ratesCriteria));
 }