1 | <?php |
||
2 | |||
3 | namespace Ola\RabbitMqAdminToolkitBundle; |
||
4 | |||
5 | use Ola\RabbitMqAdminToolkitBundle\Manager\ExchangeManager; |
||
6 | use Ola\RabbitMqAdminToolkitBundle\Manager\PermissionManager; |
||
7 | use Ola\RabbitMqAdminToolkitBundle\Manager\QueueManager; |
||
8 | use Ola\RabbitMqAdminToolkitBundle\Manager\VhostManager; |
||
9 | |||
10 | class VhostHandler |
||
11 | { |
||
12 | /** |
||
13 | * @var VhostManager |
||
14 | */ |
||
15 | private $vhostManager; |
||
16 | |||
17 | /** |
||
18 | * @var PermissionManager |
||
19 | */ |
||
20 | private $permissionManager; |
||
21 | |||
22 | /** |
||
23 | * @var ExchangeManager |
||
24 | */ |
||
25 | private $exchangeManager; |
||
26 | |||
27 | /** |
||
28 | * @var QueueManager |
||
29 | */ |
||
30 | private $queueManager; |
||
31 | |||
32 | 2 | public function __construct( |
|
33 | VhostManager $vhostManager, |
||
34 | PermissionManager $permissionManager, |
||
35 | ExchangeManager $exchangeManager, |
||
36 | QueueManager $queueManager |
||
37 | ) { |
||
38 | 2 | $this->permissionManager = $permissionManager; |
|
39 | 2 | $this->vhostManager = $vhostManager; |
|
40 | 2 | $this->exchangeManager = $exchangeManager; |
|
41 | 2 | $this->queueManager = $queueManager; |
|
42 | 2 | } |
|
43 | |||
44 | /** |
||
45 | * @param VhostConfiguration $configuration |
||
46 | */ |
||
47 | 1 | public function define(VhostConfiguration $configuration) |
|
48 | { |
||
49 | 1 | $this->vhostManager->define($configuration); |
|
50 | 1 | $this->permissionManager->define($configuration); |
|
51 | 1 | $this->exchangeManager->define($configuration); |
|
52 | 1 | $this->queueManager->define($configuration); |
|
53 | 1 | } |
|
54 | |||
55 | /** |
||
56 | * @param VhostConfiguration $configuration |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | 1 | public function exists(VhostConfiguration $configuration) |
|
61 | { |
||
62 | 1 | return $this->vhostManager->exists($configuration); |
|
63 | } |
||
64 | } |
||
65 |