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