1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace mcorten87\rabbitmq_api\jobs; |
4
|
|
|
|
5
|
|
|
use mcorten87\rabbitmq_api\objects\DestinationType; |
6
|
|
|
use mcorten87\rabbitmq_api\objects\Exchange; |
7
|
|
|
use mcorten87\rabbitmq_api\objects\ExchangeName; |
8
|
|
|
use mcorten87\rabbitmq_api\objects\QueueName; |
9
|
|
|
use mcorten87\rabbitmq_api\objects\RoutingKey; |
10
|
|
|
use mcorten87\rabbitmq_api\objects\VirtualHost; |
11
|
|
|
|
12
|
|
|
class JobBindingCreateToQueue extends JobBase |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* @var VirtualHost |
16
|
|
|
*/ |
17
|
|
|
private $virtualHost; |
18
|
|
|
|
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var QueueName |
22
|
|
|
*/ |
23
|
|
|
private $queueName; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var ExchangeName |
27
|
|
|
*/ |
28
|
|
|
private $exchangeName; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var DestinationType |
32
|
|
|
*/ |
33
|
|
|
private $destinationType; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var RoutingKey |
37
|
|
|
*/ |
38
|
|
|
private $routingKey; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param RoutingKey $routingKey |
42
|
|
|
*/ |
43
|
|
|
public function setRoutingKey(RoutingKey $routingKey) |
44
|
|
|
{ |
45
|
|
|
$this->routingKey = $routingKey; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** @return VirtualHost */ |
49
|
|
|
public function getVirtualHost() : VirtualHost |
50
|
|
|
{ |
51
|
|
|
return $this->virtualHost; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return QueueName |
56
|
|
|
*/ |
57
|
|
|
public function getQueueName(): QueueName |
58
|
|
|
{ |
59
|
|
|
return $this->queueName; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return ExchangeName |
64
|
|
|
*/ |
65
|
|
|
public function getExchangeName() |
66
|
|
|
{ |
67
|
|
|
return $this->exchangeName; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return string |
72
|
|
|
*/ |
73
|
|
|
public function getDestinationType(): string |
74
|
|
|
{ |
75
|
|
|
return $this->destinationType; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return mixed |
80
|
|
|
*/ |
81
|
|
|
public function getRoutingKey() |
82
|
|
|
{ |
83
|
|
|
return $this->routingKey; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* JobExchangeCreate constructor. |
88
|
|
|
* @param VirtualHost $virtualHost |
89
|
|
|
* @param ExchangeName $exchangeName |
90
|
|
|
*/ |
91
|
|
|
public function __construct(VirtualHost $virtualHost, QueueName $queueName, ExchangeName $exchangeName) |
92
|
|
|
{ |
93
|
|
|
$this->virtualHost = $virtualHost; |
94
|
|
|
$this->queueName = $queueName; |
95
|
|
|
$this->exchangeName = $exchangeName; |
96
|
|
|
|
97
|
|
|
$this->destinationType = new DestinationType(DestinationType::EXCHANGE); |
98
|
|
|
$this->routingKey = new RoutingKey(''); |
99
|
|
|
} |
100
|
|
|
} |
101
|
|
|
|