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