@@ 11-32 (lines=22) @@ | ||
8 | use mcorten87\rabbitmq_api\objects\Url; |
|
9 | use mcorten87\rabbitmq_api\services\MqManagementConfig; |
|
10 | ||
11 | class JobDefinitionListVirtualHostMapper extends BaseMapper |
|
12 | { |
|
13 | ||
14 | /** |
|
15 | * @return Method |
|
16 | */ |
|
17 | protected function mapMethod() : Method |
|
18 | { |
|
19 | return new Method(Method::GET); |
|
20 | } |
|
21 | ||
22 | /** |
|
23 | * @param JobDefinitionListVirtualHost $job |
|
24 | * @return Url |
|
25 | */ |
|
26 | protected function mapUrl(JobBase $job) : Url |
|
27 | { |
|
28 | $url = sprintf('definitions'); |
|
29 | $url .= sprintf('/%1$s', urlencode((string)$job->getVirtualHost())); |
|
30 | return new Url($url); |
|
31 | } |
|
32 | } |
|
33 |
@@ 10-26 (lines=17) @@ | ||
7 | use mcorten87\rabbitmq_api\objects\Method; |
|
8 | use mcorten87\rabbitmq_api\objects\Url; |
|
9 | ||
10 | class JobExchangeListVirtualHostMapper extends BaseMapper |
|
11 | { |
|
12 | ||
13 | protected function mapMethod() : Method { |
|
14 | return new Method(Method::GET); |
|
15 | } |
|
16 | ||
17 | /** |
|
18 | * @param JobExchangeListVirtualHost $job |
|
19 | * @return Url |
|
20 | */ |
|
21 | protected function mapUrl(JobBase $job) : Url { |
|
22 | $url = 'exchanges'; |
|
23 | $url .= '/'.urlencode((string)$job->getVirtualHost()); |
|
24 | return new Url($url); |
|
25 | } |
|
26 | } |
|
27 |
@@ 10-28 (lines=19) @@ | ||
7 | use mcorten87\rabbitmq_api\objects\Method; |
|
8 | use mcorten87\rabbitmq_api\objects\Url; |
|
9 | ||
10 | class JobQueueListVirtualHostMapper extends BaseMapper |
|
11 | { |
|
12 | protected function mapMethod() : Method |
|
13 | { |
|
14 | return new Method(Method::GET); |
|
15 | } |
|
16 | ||
17 | /** |
|
18 | * @param JobQueueListVirtualHost $job |
|
19 | * @return Url |
|
20 | */ |
|
21 | protected function mapUrl(JobBase $job) : Url |
|
22 | { |
|
23 | $url = 'queues'; |
|
24 | $url .= '/'.urlencode((string)$job->getVirtualhost()); |
|
25 | ||
26 | return new Url($url); |
|
27 | } |
|
28 | } |
|
29 |
@@ 11-29 (lines=19) @@ | ||
8 | use mcorten87\rabbitmq_api\objects\Method; |
|
9 | use mcorten87\rabbitmq_api\objects\Url; |
|
10 | ||
11 | class JobUserDeleteMapper extends BaseMapper |
|
12 | { |
|
13 | protected function mapMethod() : Method |
|
14 | { |
|
15 | return new Method(Method::DELETE); |
|
16 | } |
|
17 | ||
18 | ||
19 | /** |
|
20 | * @param JobUserDelete $job |
|
21 | * @return Url |
|
22 | */ |
|
23 | protected function mapUrl(JobBase $job) : Url { |
|
24 | $url = 'users'; |
|
25 | $url .= '/'.urlencode((string)$job->getUser()); |
|
26 | ||
27 | return new Url($url); |
|
28 | } |
|
29 | } |
|
30 |
@@ 12-34 (lines=23) @@ | ||
9 | use mcorten87\rabbitmq_api\objects\Url; |
|
10 | use mcorten87\rabbitmq_api\services\MqManagementConfig; |
|
11 | ||
12 | class JobConnectionListVirtualHostMapper extends BaseMapper |
|
13 | { |
|
14 | ||
15 | /** |
|
16 | * @return Method |
|
17 | */ |
|
18 | protected function mapMethod() : Method |
|
19 | { |
|
20 | return new Method(Method::GET); |
|
21 | } |
|
22 | ||
23 | /** |
|
24 | * @param JobConnectionListVirtualHost $job |
|
25 | * @return Url |
|
26 | */ |
|
27 | protected function mapUrl(JobBase $job) : Url |
|
28 | { |
|
29 | $url = sprintf('vhosts'); |
|
30 | $url .= sprintf('/%1$s', urlencode((string)$job->getVirtualHost())); |
|
31 | $url .= '/connections'; |
|
32 | return new Url($url); |
|
33 | } |
|
34 | } |
|
35 |