コード例 #1
0
 public bool Create(VirtualHost virtualHost, User user, Permission permission)
 {
     return(Client.Put(
                permission,
                "permissions/:vhost/:user", new { vhost = virtualHost.Name, user = user.Name })
            .Is(HttpStatusCode.NoContent));
 }
コード例 #2
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, ExchangeOptions options)
 {
     return(Client.Put(options, "exchanges/:vhost/:name", new
     {
         vhost = virtualHost.Name,
         exchange.Name,
     }).Is(HttpStatusCode.NoContent));
 }
コード例 #3
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, Queue queue, BindingOptions options)
 {
     return(Client.Post(options, "bindings/:vhost/e/:exchange/q/:queue", new
     {
         vhost = virtualHost.Name,
         exchange = exchange.Name,
         queue = queue.Name
     }).Is(HttpStatusCode.Created));
 }
コード例 #4
0
        public async Task <bool> CreateAsync(VirtualHost virtualHost)
        {
            var response = await httpClient.Execute(HttpMethod.Put,
                                                    "vhosts/{name}",
                                                    new Dictionary <string, string>
            {
                { "name", virtualHost.Name }
            });

            return(response.StatusCode == HttpStatusCode.NoContent);
        }
コード例 #5
0
        public async Task <bool> CreateAsync(VirtualHost virtualHost, Exchange exchange, Queue queue, BindingOptions options)
        {
            var response = await httpClient.Execute(
                HttpMethod.Post,
                "bindings/{vhost}/e/{exchange}/q/{queue}",
                new Dictionary <string, string> {
                { "vhost", virtualHost.Name }, { "exchange", exchange.Name }, { "queue", queue.Name }
            },
                options);

            return(response.StatusCode == HttpStatusCode.Created);
        }
コード例 #6
0
        public async Task <bool> CreateAsync(VirtualHost virtualHost, User user, Permission permission)
        {
            var response = await httpClient.Execute(
                HttpMethod.Put,
                "permissions/{vhost}/{user}",
                new Dictionary <string, string> {
                { "vhost", virtualHost.Name }, { "user", user.Name }
            },
                permission
                );

            return(response.StatusCode == HttpStatusCode.NoContent);
        }
コード例 #7
0
        public async Task <bool> CreateAsync(VirtualHost virtualHost, Exchange exchange, ExchangeOptions options)
        {
            var response = await httpClient.Execute(HttpMethod.Put,
                                                    "exchanges/{vhost}/{name}",
                                                    new Dictionary <string, string>
            {
                { "vhost", virtualHost.Name },
                { "name", exchange.Name }
            },
                                                    options);

            return(response.StatusCode == HttpStatusCode.NoContent);
        }
コード例 #8
0
        public IEnumerable <Message> Messages(VirtualHost virtualHost, Queue queue)
        {
            var options = new
            {
                vhost    = virtualHost.Name,
                name     = queue.Name,
                count    = "1",
                requeue  = "true",
                encoding = "auto",
                truncate = "50000"
            };

            return(Client.Post(options, "queues/:vhost/:queue/get", new
            {
                vhost = virtualHost.Name,
                queue = queue.Name
            }).OnOk().As <List <Message> >());
        }
コード例 #9
0
        public Task <IEnumerable <Message> > MessagesAsync(VirtualHost virtualHost, Queue queue)
        {
            var options = new
            {
                vhost    = virtualHost.Name,
                name     = queue.Name,
                count    = "1",
                requeue  = "true",
                encoding = "auto",
                truncate = "50000"
            };

            return(httpClient.ExecuteList <Message>(
                       HttpMethod.Post,
                       "queues/{vhost}/{queue}/get",
                       new Dictionary <string, string> {
                { "vhost", virtualHost.Name }, { "queue", queue.Name }
            },
                       options
                       ));
        }
コード例 #10
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, Queue queue)
 {
     return Create(virtualHost, exchange, queue, BindingOptions.Default);
 }
コード例 #11
0
 public IEnumerable <Message> Messages(VirtualHost virtualHost, Queue queue)
 {
     return(MessagesAsync(virtualHost, queue).Result);
 }
コード例 #12
0
 public bool Create(VirtualHost virtualHost)
 {
     return Client.Put("vhosts/:name", new { name = virtualHost.Name })
         .Is(HttpStatusCode.NoContent);
 }
コード例 #13
0
 public bool Create(VirtualHost virtualHost, Queue queue, QueueOptions options)
 {
     return(Client.Put(options, "queues/:vhost/:name", new { vhost = virtualHost.Name, queue.Name })
            .Is(HttpStatusCode.NoContent));
 }
コード例 #14
0
 public Task <bool> CreateAsync(VirtualHost virtualHost, Exchange exchange)
 {
     return(CreateAsync(virtualHost, exchange, ExchangeOptions.Default));
 }
コード例 #15
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, Queue queue, BindingOptions options)
 {
     return Client.Post(options, "bindings/:vhost/e/:exchange/q/:queue", new
     {
         vhost = virtualHost.Name,
         exchange = exchange.Name,
         queue = queue.Name
     }).Is(HttpStatusCode.Created);
 }
コード例 #16
0
        public IEnumerable<Message> Messages(VirtualHost virtualHost, Queue queue)
        {
            var options = new
            {
                vhost = virtualHost.Name,
                name = queue.Name,
                count = "1",
                requeue = "true",
                encoding = "auto",
                truncate = "50000"
            };

            return Client.Post(options, "queues/:vhost/:queue/get", new
            {
                vhost = virtualHost.Name,
                queue = queue.Name
            }).OnOk().As<List<Message>>();
        }
コード例 #17
0
 public bool Exists(VirtualHost virtualHost, Queue queue)
 {
     return Queues(virtualHost).Any(q => q.Name == queue.Name);
 }
コード例 #18
0
 public IEnumerable<Queue> Queues(VirtualHost virtualHost)
 {
     return Client.Get("queues/:vhost", new { vhost = virtualHost.Name }).OnOk().As<List<Queue>>();
 }
コード例 #19
0
 public IEnumerable<Exchange> Exchanges(VirtualHost virtualHost)
 {
     return Client.Get("exchanges/:vhost", new { vhost = virtualHost.Name }).OnOk().As<List<Exchange>>();
 }
コード例 #20
0
 public bool Create(VirtualHost virtualHost, Exchange exchange)
 {
     return Create(virtualHost, exchange, ExchangeOptions.Default);
 }
コード例 #21
0
 public bool Create(VirtualHost virtualHost, Queue queue, QueueOptions options)
 {
     return Client.Put(options, "queues/:vhost/:name", new { vhost = virtualHost.Name, queue.Name })
         .Is(HttpStatusCode.NoContent);
 }
コード例 #22
0
 public bool Create(VirtualHost virtualHost, Queue queue)
 {
     return Create(virtualHost, queue, QueueOptions.Default);
 }
コード例 #23
0
 public Task <IEnumerable <Queue> > QueuesAsync(VirtualHost virtualHost)
 {
     return(httpClient.ExecuteList <Queue>("queues/{vhost}", new Dictionary <string, string> {
         { "vhost", virtualHost.Name }
     }));
 }
コード例 #24
0
 public bool Exists(VirtualHost virtualHost, Queue queue)
 {
     return(Queues(virtualHost).Any(q => q.Name == queue.Name));
 }
コード例 #25
0
 public Task <IEnumerable <Permissions> > PermissionsAsync(VirtualHost virtualHost)
 {
     return(httpClient.ExecuteList <Permissions>("vhosts/{name}/permissions", new Dictionary <string, string> {
         { "name", virtualHost.Name }
     }));
 }
コード例 #26
0
 public bool Exists(VirtualHost virtualHost, Exchange exchange)
 {
     return Exchanges(virtualHost).Any(e => e.Name == exchange.Name);
 }
コード例 #27
0
 public Task <bool> CreateAsync(VirtualHost virtualHost, Queue queue)
 {
     return(CreateAsync(virtualHost, queue, QueueOptions.Default));
 }
コード例 #28
0
 public IEnumerable <Queue> Queues(VirtualHost virtualHost)
 {
     return(Client.Get("queues/:vhost", new { vhost = virtualHost.Name }).OnOk().As <List <Queue> >());
 }
コード例 #29
0
 public bool Create(VirtualHost virtualHost, User user, Permission permission)
 {
     return Client.Put(
         permission,
         "permissions/:vhost/:user", new { vhost = virtualHost.Name, user = user.Name })
     .Is(HttpStatusCode.NoContent);
 }
コード例 #30
0
 public bool Create(VirtualHost virtualHost)
 {
     return(Client.Put("vhosts/:name", new { name = virtualHost.Name })
            .Is(HttpStatusCode.NoContent));
 }
コード例 #31
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, Queue queue)
 {
     return(Create(virtualHost, exchange, queue, BindingOptions.Default));
 }
コード例 #32
0
 public IEnumerable<Permissions> Permissions(VirtualHost virtualHost)
 {
     return Client.Get("vhosts/:name/permissions", new { virtualHost.Name })
         .OnOk()
         .As<List<Permissions>>();
 }
コード例 #33
0
 public bool Create(VirtualHost virtualHost, User user, Permission permission)
 {
     return(CreateAsync(virtualHost, user, permission).Result);
 }
コード例 #34
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, Queue queue)
 {
     return(CreateAsync(virtualHost, exchange, queue).Result);
 }
コード例 #35
0
 public bool Exists(VirtualHost virtualHost, Exchange exchange)
 {
     return(Exchanges(virtualHost).Any(e => e.Name == exchange.Name));
 }
コード例 #36
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, Queue queue, BindingOptions options)
 {
     return(CreateAsync(virtualHost, exchange, queue, options).Result);
 }
コード例 #37
0
 public IEnumerable <Exchange> Exchanges(VirtualHost virtualHost)
 {
     return(Client.Get("exchanges/:vhost", new { vhost = virtualHost.Name }).OnOk().As <List <Exchange> >());
 }
コード例 #38
0
 public bool Exists(VirtualHost virtualHost, Queue queue)
 {
     return(ExistsAsync(virtualHost, queue).Result);
 }
コード例 #39
0
 public IEnumerable <Permissions> Permissions(VirtualHost virtualHost)
 {
     return(Client.Get("vhosts/:name/permissions", new { virtualHost.Name })
            .OnOk()
            .As <List <Permissions> >());
 }
コード例 #40
0
 public bool Exists(VirtualHost virtualHost, Exchange exchange)
 {
     return(ExistsAsync(virtualHost, exchange).Result);
 }
コード例 #41
0
 public bool Create(VirtualHost virtualHost, Queue queue)
 {
     return(Create(virtualHost, queue, QueueOptions.Default));
 }
コード例 #42
0
 public bool Delete(VirtualHost virtualHost)
 {
     return(DeleteAsync(virtualHost).Result);
 }
コード例 #43
0
 public bool Create(VirtualHost virtualHost, Exchange exchange)
 {
     return(Create(virtualHost, exchange, ExchangeOptions.Default));
 }
コード例 #44
0
 public bool Create(VirtualHost virtualHost, Exchange exchange, ExchangeOptions options)
 {
     return Client.Put(options, "exchanges/:vhost/:name", new
     {
         vhost = virtualHost.Name,
         exchange.Name,
     }).Is(HttpStatusCode.NoContent);
 }