1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
namespace ApiClients\Client\RabbitMQ\Management\Resource; |
4
|
|
|
|
5
|
|
|
use ApiClients\Foundation\Hydrator\Annotations\EmptyResource; |
6
|
|
|
use ApiClients\Foundation\Hydrator\Annotations\Nested; |
7
|
|
|
use ApiClients\Foundation\Resource\AbstractResource; |
8
|
|
|
use DateTime; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @Nested( |
12
|
|
|
* message_stats="MessageStats", |
13
|
|
|
* messages_details="Details", |
14
|
|
|
* messages_ready_details="Details", |
15
|
|
|
* messages_unacknowledged_details="Details", |
16
|
|
|
* backing_queue_status="Queue\BackingQueueStatus" |
17
|
|
|
* ) |
18
|
|
|
* @EmptyResource("EmptyQueue") |
19
|
|
|
*/ |
20
|
|
|
abstract class Queue extends AbstractResource implements QueueInterface |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @var int |
24
|
|
|
*/ |
25
|
|
|
protected $memory; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var MessageStats |
29
|
|
|
*/ |
30
|
|
|
protected $message_stats; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var int |
34
|
|
|
*/ |
35
|
|
|
protected $messages; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var Details |
39
|
|
|
*/ |
40
|
|
|
protected $messages_details; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var int |
44
|
|
|
*/ |
45
|
|
|
protected $messages_ready; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var Details |
49
|
|
|
*/ |
50
|
|
|
protected $messages_ready_details; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var int |
54
|
|
|
*/ |
55
|
|
|
protected $messages_unacknowledged; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var Details |
59
|
|
|
*/ |
60
|
|
|
protected $messages_unacknowledged_details; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var DateTime |
64
|
|
|
*/ |
65
|
|
|
protected $idle_since; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var mixed |
69
|
|
|
*/ |
70
|
|
|
protected $consumer_utilisation; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @var mixed |
74
|
|
|
*/ |
75
|
|
|
protected $policy; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var mixed |
79
|
|
|
*/ |
80
|
|
|
protected $exclusive_consumer_tag; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @var int |
84
|
|
|
*/ |
85
|
|
|
protected $consumers; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @var mixed |
89
|
|
|
*/ |
90
|
|
|
protected $recoverable_slaves; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @var string |
94
|
|
|
*/ |
95
|
|
|
protected $state; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @var int |
99
|
|
|
*/ |
100
|
|
|
protected $messages_ram; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @var int |
104
|
|
|
*/ |
105
|
|
|
protected $messages_ready_ram; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @var int |
109
|
|
|
*/ |
110
|
|
|
protected $messages_unacknowledged_ram; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @var int |
114
|
|
|
*/ |
115
|
|
|
protected $messages_persistent; |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @var int |
119
|
|
|
*/ |
120
|
|
|
protected $message_bytes; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @var int |
124
|
|
|
*/ |
125
|
|
|
protected $message_bytes_ready; |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @var int |
129
|
|
|
*/ |
130
|
|
|
protected $message_bytes_unacknowledged; |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @var int |
134
|
|
|
*/ |
135
|
|
|
protected $message_bytes_ram; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @var int |
139
|
|
|
*/ |
140
|
|
|
protected $message_bytes_persistent; |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @var DateTime |
144
|
|
|
*/ |
145
|
|
|
protected $head_message_timestamp; |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @var int |
149
|
|
|
*/ |
150
|
|
|
protected $disk_reads; |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* @var int |
154
|
|
|
*/ |
155
|
|
|
protected $disk_writes; |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @var Queue\BackingQueueStatus |
159
|
|
|
*/ |
160
|
|
|
protected $backing_queue_status; |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @var string |
164
|
|
|
*/ |
165
|
|
|
protected $name; |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @var string |
169
|
|
|
*/ |
170
|
|
|
protected $vhost; |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @var bool |
174
|
|
|
*/ |
175
|
|
|
protected $durable; |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* @var bool |
179
|
|
|
*/ |
180
|
|
|
protected $auto_delete; |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* @var bool |
184
|
|
|
*/ |
185
|
|
|
protected $exclusive; |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @var array |
189
|
|
|
*/ |
190
|
|
|
protected $arguments; |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @var string |
194
|
|
|
*/ |
195
|
|
|
protected $node; |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* @return int |
199
|
|
|
*/ |
200
|
|
|
public function memory() : int |
201
|
|
|
{ |
202
|
|
|
return $this->memory; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* @return MessageStats |
207
|
|
|
*/ |
208
|
|
|
public function messageStats() : MessageStats |
209
|
|
|
{ |
210
|
|
|
return $this->message_stats; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* @return int |
215
|
|
|
*/ |
216
|
|
|
public function messages() : int |
217
|
|
|
{ |
218
|
|
|
return $this->messages; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* @return Details |
223
|
|
|
*/ |
224
|
|
|
public function messagesDetails() : Details |
225
|
|
|
{ |
226
|
|
|
return $this->messages_details; |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* @return int |
231
|
|
|
*/ |
232
|
|
|
public function messagesReady() : int |
233
|
|
|
{ |
234
|
|
|
return $this->messages_ready; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* @return Details |
239
|
|
|
*/ |
240
|
|
|
public function messagesReadyDetails() : Details |
241
|
|
|
{ |
242
|
|
|
return $this->messages_ready_details; |
243
|
|
|
} |
244
|
|
|
|
245
|
|
|
/** |
246
|
|
|
* @return int |
247
|
|
|
*/ |
248
|
|
|
public function messagesUnacknowledged() : int |
249
|
|
|
{ |
250
|
|
|
return $this->messages_unacknowledged; |
251
|
|
|
} |
252
|
|
|
|
253
|
|
|
/** |
254
|
|
|
* @return Details |
255
|
|
|
*/ |
256
|
|
|
public function messagesUnacknowledgedDetails() : Details |
257
|
|
|
{ |
258
|
|
|
return $this->messages_unacknowledged_details; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* @return DateTime |
263
|
|
|
*/ |
264
|
|
|
public function idleSince() : DateTime |
265
|
|
|
{ |
266
|
|
|
return $this->idle_since; |
267
|
|
|
} |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* @return mixed |
271
|
|
|
*/ |
272
|
|
|
public function consumerUtilisation() : mixed |
273
|
|
|
{ |
274
|
|
|
return $this->consumer_utilisation; |
275
|
|
|
} |
276
|
|
|
|
277
|
|
|
/** |
278
|
|
|
* @return mixed |
279
|
|
|
*/ |
280
|
|
|
public function policy() : mixed |
281
|
|
|
{ |
282
|
|
|
return $this->policy; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
/** |
286
|
|
|
* @return mixed |
287
|
|
|
*/ |
288
|
|
|
public function exclusiveConsumerTag() : mixed |
289
|
|
|
{ |
290
|
|
|
return $this->exclusive_consumer_tag; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* @return int |
295
|
|
|
*/ |
296
|
|
|
public function consumers() : int |
297
|
|
|
{ |
298
|
|
|
return $this->consumers; |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* @return mixed |
303
|
|
|
*/ |
304
|
|
|
public function recoverableSlaves() : mixed |
305
|
|
|
{ |
306
|
|
|
return $this->recoverable_slaves; |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* @return string |
311
|
|
|
*/ |
312
|
|
|
public function state() : string |
313
|
|
|
{ |
314
|
|
|
return $this->state; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* @return int |
319
|
|
|
*/ |
320
|
|
|
public function messagesRam() : int |
321
|
|
|
{ |
322
|
|
|
return $this->messages_ram; |
323
|
|
|
} |
324
|
|
|
|
325
|
|
|
/** |
326
|
|
|
* @return int |
327
|
|
|
*/ |
328
|
|
|
public function messagesReadyRam() : int |
329
|
|
|
{ |
330
|
|
|
return $this->messages_ready_ram; |
331
|
|
|
} |
332
|
|
|
|
333
|
|
|
/** |
334
|
|
|
* @return int |
335
|
|
|
*/ |
336
|
|
|
public function messagesUnacknowledgedRam() : int |
337
|
|
|
{ |
338
|
|
|
return $this->messages_unacknowledged_ram; |
339
|
|
|
} |
340
|
|
|
|
341
|
|
|
/** |
342
|
|
|
* @return int |
343
|
|
|
*/ |
344
|
|
|
public function messagesPersistent() : int |
345
|
|
|
{ |
346
|
|
|
return $this->messages_persistent; |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
/** |
350
|
|
|
* @return int |
351
|
|
|
*/ |
352
|
|
|
public function messageBytes() : int |
353
|
|
|
{ |
354
|
|
|
return $this->message_bytes; |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
/** |
358
|
|
|
* @return int |
359
|
|
|
*/ |
360
|
|
|
public function messageBytesReady() : int |
361
|
|
|
{ |
362
|
|
|
return $this->message_bytes_ready; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* @return int |
367
|
|
|
*/ |
368
|
|
|
public function messageBytesUnacknowledged() : int |
369
|
|
|
{ |
370
|
|
|
return $this->message_bytes_unacknowledged; |
371
|
|
|
} |
372
|
|
|
|
373
|
|
|
/** |
374
|
|
|
* @return int |
375
|
|
|
*/ |
376
|
|
|
public function messageBytesRam() : int |
377
|
|
|
{ |
378
|
|
|
return $this->message_bytes_ram; |
379
|
|
|
} |
380
|
|
|
|
381
|
|
|
/** |
382
|
|
|
* @return int |
383
|
|
|
*/ |
384
|
|
|
public function messageBytesPersistent() : int |
385
|
|
|
{ |
386
|
|
|
return $this->message_bytes_persistent; |
387
|
|
|
} |
388
|
|
|
|
389
|
|
|
/** |
390
|
|
|
* @return DateTime |
391
|
|
|
*/ |
392
|
|
|
public function headMessageTimestamp() : DateTime |
393
|
|
|
{ |
394
|
|
|
return $this->head_message_timestamp; |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
/** |
398
|
|
|
* @return int |
399
|
|
|
*/ |
400
|
|
|
public function diskReads() : int |
401
|
|
|
{ |
402
|
|
|
return $this->disk_reads; |
403
|
|
|
} |
404
|
|
|
|
405
|
|
|
/** |
406
|
|
|
* @return int |
407
|
|
|
*/ |
408
|
|
|
public function diskWrites() : int |
409
|
|
|
{ |
410
|
|
|
return $this->disk_writes; |
411
|
|
|
} |
412
|
|
|
|
413
|
|
|
/** |
414
|
|
|
* @return Queue\BackingQueueStatus |
415
|
|
|
*/ |
416
|
|
|
public function backingQueueStatus() : Queue\BackingQueueStatus |
417
|
|
|
{ |
418
|
|
|
return $this->backing_queue_status; |
419
|
|
|
} |
420
|
|
|
|
421
|
|
|
/** |
422
|
|
|
* @return string |
423
|
|
|
*/ |
424
|
|
|
public function name() : string |
425
|
|
|
{ |
426
|
|
|
return $this->name; |
427
|
|
|
} |
428
|
|
|
|
429
|
|
|
/** |
430
|
|
|
* @return string |
431
|
|
|
*/ |
432
|
|
|
public function vhost() : string |
433
|
|
|
{ |
434
|
|
|
return $this->vhost; |
435
|
|
|
} |
436
|
|
|
|
437
|
|
|
/** |
438
|
|
|
* @return bool |
439
|
|
|
*/ |
440
|
|
|
public function durable() : bool |
441
|
|
|
{ |
442
|
|
|
return $this->durable; |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
/** |
446
|
|
|
* @return bool |
447
|
|
|
*/ |
448
|
|
|
public function autoDelete() : bool |
449
|
|
|
{ |
450
|
|
|
return $this->auto_delete; |
451
|
|
|
} |
452
|
|
|
|
453
|
|
|
/** |
454
|
|
|
* @return bool |
455
|
|
|
*/ |
456
|
|
|
public function exclusive() : bool |
457
|
|
|
{ |
458
|
|
|
return $this->exclusive; |
459
|
|
|
} |
460
|
|
|
|
461
|
|
|
/** |
462
|
|
|
* @return array |
463
|
|
|
*/ |
464
|
|
|
public function arguments() : array |
465
|
|
|
{ |
466
|
|
|
return $this->arguments; |
467
|
|
|
} |
468
|
|
|
|
469
|
|
|
/** |
470
|
|
|
* @return string |
471
|
|
|
*/ |
472
|
|
|
public function node() : string |
473
|
|
|
{ |
474
|
|
|
return $this->node; |
475
|
|
|
} |
476
|
|
|
} |
477
|
|
|
|