-
Notifications
You must be signed in to change notification settings - Fork 912
/
ActiveMQServerControlUsingCoreTest.java
1701 lines (1479 loc) · 102 KB
/
ActiveMQServerControlUsingCoreTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.tests.integration.management;
import java.util.Map;
import org.apache.activemq.artemis.api.core.ActiveMQAddressDoesNotExistException;
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
import org.apache.activemq.artemis.api.core.management.Parameter;
import org.apache.activemq.artemis.api.core.management.ResourceNames;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@RunWith(Parameterized.class)
public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTest {
public ActiveMQServerControlUsingCoreTest(boolean legacyCreateQueue) {
super(legacyCreateQueue);
}
// ActiveMQServerControlTest overrides --------------------------
// the core messaging proxy doesn't work when the server is stopped so we cant run these 2 tests
@Override
public void testScaleDownWithOutConnector() throws Exception {
}
@Override
public void testScaleDownWithConnector() throws Exception {
}
@Override
protected ActiveMQServerControl createManagementControl() throws Exception {
return new ActiveMQServerControl() {
@Override
public String listBrokerConnections() {
try {
return (String) proxy.invokeOperation("listBrokerConnections");
} catch (Throwable throwable) {
throwable.printStackTrace();
return null;
}
}
@Override
public void startBrokerConnection(String name) throws Exception {
proxy.invokeOperation("startBrokerConnection", name);
}
@Override
public void stopBrokerConnection(String name) throws Exception {
proxy.invokeOperation("stopBrokerConnection", name);
}
@Override
public String updateAddress(String name, String routingTypes) throws Exception {
return (String) proxy.invokeOperation("updateAddress", name, routingTypes);
}
public void updateDuplicateIdCache(String address, Object[] ids) {
}
@Override
public void scaleDown(String connector) throws Exception {
throw new UnsupportedOperationException();
}
private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.BROKER);
@Override
public boolean isSharedStore() {
return (Boolean) proxy.retrieveAttributeValue("sharedStore");
}
@Override
public boolean closeConnectionsForAddress(final String ipAddress) throws Exception {
return (Boolean) proxy.invokeOperation("closeConnectionsForAddress", ipAddress);
}
@Override
public boolean closeConsumerConnectionsForAddress(final String address) throws Exception {
return (Boolean) proxy.invokeOperation("closeConsumerConnectionsForAddress", address);
}
@Override
public boolean closeConnectionsForUser(final String userName) throws Exception {
return (Boolean) proxy.invokeOperation("closeConnectionsForUser", userName);
}
@Override
public boolean closeConnectionWithID(String ID) throws Exception {
return (Boolean) proxy.invokeOperation("closeConnectionWithID", ID);
}
@Override
public boolean closeSessionWithID(String connectionID, String ID) throws Exception {
return (Boolean) proxy.invokeOperation("closeSessionWithID", connectionID, ID);
}
@Override
public boolean closeConsumerWithID(String sessionID, String ID) throws Exception {
return (Boolean) proxy.invokeOperation("closeConsumerWithID", sessionID, ID);
}
@Override
public boolean commitPreparedTransaction(final String transactionAsBase64) throws Exception {
return (Boolean) proxy.invokeOperation("commitPreparedTransaction", transactionAsBase64);
}
@Override
public void createQueue(final String address, final String name) throws Exception {
proxy.invokeOperation("createQueue", address, name);
}
@Override
public boolean isActive() {
return (Boolean) proxy.retrieveAttributeValue("active");
}
@Override
public String createQueue(String address,
String routingType,
String name,
String filterStr,
boolean durable,
int maxConsumers,
boolean purgeOnNoConsumers,
boolean autoCreateAddress) throws Exception {
return (String) proxy.invokeOperation("createQueue", address, routingType, name, filterStr, durable, maxConsumers, purgeOnNoConsumers, autoCreateAddress);
}
@Override
public String createQueue(String queueConfiguration) throws Exception {
return (String) proxy.invokeOperation("createQueue", queueConfiguration);
}
@Override
public String createQueue(String queueConfiguration, boolean ignoreIfExists) throws Exception {
return (String) proxy.invokeOperation("createQueue", queueConfiguration, ignoreIfExists);
}
@Override
public String updateQueue(String queueConfiguration) throws Exception {
return (String) proxy.invokeOperation("updateQueue", queueConfiguration);
}
@Override
public String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name,
@Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType,
@Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers,
@Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean purgeOnNoConsumers) throws Exception {
return (String) proxy.invokeOperation("updateQueue", name, routingType, maxConsumers, purgeOnNoConsumers);
}
@Override
public String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name,
@Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType,
@Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers,
@Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean purgeOnNoConsumers,
@Parameter(name = "exclusive", desc = "If the queue should route exclusively to one consumer") Boolean exclusive)
throws Exception {
return (String) proxy.invokeOperation("updateQueue", name, routingType, maxConsumers, purgeOnNoConsumers, exclusive);
}
@Override
public String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name,
@Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType,
@Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers,
@Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean purgeOnNoConsumers,
@Parameter(name = "exclusive", desc = "If the queue should route exclusively to one consumer") Boolean exclusive,
@Parameter(name = "user", desc = "The user associated with this queue") String user)
throws Exception {
return (String) proxy.invokeOperation("updateQueue", name, routingType, maxConsumers, purgeOnNoConsumers, exclusive, user);
}
@Override
public String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name,
@Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType,
@Parameter(name = "filter", desc = "The filter to use on the queue") String filter,
@Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers,
@Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean purgeOnNoConsumers,
@Parameter(name = "exclusive", desc = "If the queue should route exclusively to one consumer") Boolean exclusive,
@Parameter(name = "groupRebalance", desc = "If the queue should rebalance groups when a consumer is added") Boolean groupRebalance,
@Parameter(name = "groupBuckets", desc = "Number of buckets that should be used for message groups, -1 (default) is unlimited, and groups by raw key instead") Integer groupBuckets,
@Parameter(name = "nonDestructive", desc = "If the queue should be nonDestructive") Boolean nonDestructive,
@Parameter(name = "consumersBeforeDispatch", desc = "Number of consumers needed before dispatch can start") Integer consumersBeforeDispatch,
@Parameter(name = "delayBeforeDispatch", desc = "Delay to wait before dispatching if number of consumers before dispatch is not met") Long delayBeforeDispatch,
@Parameter(name = "user", desc = "The user associated with this queue") String user) throws Exception {
return (String) proxy.invokeOperation("updateQueue", name, routingType, filter, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, user);
}
@Override
public String updateQueue(String name, String routingType, String filter, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean groupRebalance, Integer groupBuckets, String groupFirstKey, Boolean nonDestructive, Integer consumersBeforeDispatch, Long delayBeforeDispatch, String user) throws Exception {
return (String) proxy.invokeOperation("updateQueue", name, routingType, filter, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, groupFirstKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, user);
}
@Override
public String updateQueue(String name, String routingType, String filter, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean groupRebalance, Integer groupBuckets, String groupFirstKey, Boolean nonDestructive, Integer consumersBeforeDispatch, Long delayBeforeDispatch, String user, Long ringSize) throws Exception {
return (String) proxy.invokeOperation("updateQueue", name, routingType, filter, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, groupFirstKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, user, ringSize);
}
@Override
public void deleteAddress(@Parameter(name = "name", desc = "The name of the address") String name) throws Exception {
proxy.invokeOperation("deleteAddress", name);
}
@Override
public void deleteAddress(@Parameter(name = "name", desc = "The name of the address") String name, @Parameter(name = "force", desc = "Force everything out!") boolean force) throws Exception {
proxy.invokeOperation("deleteAddress", name, force);
}
@Override
public void createQueue(final String address,
final String name,
final String filter,
final boolean durable) throws Exception {
proxy.invokeOperation("createQueue", address, name, filter, durable);
}
@Override
public void createQueue(String address, String name, String routingType) throws Exception {
proxy.invokeOperation("createQueue", address, name, routingType);
}
@Override
public void createQueue(String address, String name, boolean durable, String routingType) throws Exception {
proxy.invokeOperation("createQueue", address, name, durable, routingType);
}
@Override
public void createQueue(String address,String name, String filter, boolean durable, String routingType) throws Exception {
proxy.invokeOperation("createQueue", address, name, filter, durable, routingType);
}
@Override
public String createQueue(String address, String routingType, String name, String filter, boolean durable, int maxConsumers, boolean purgeOnNoConsumers, boolean exclusive, boolean groupRebalance, int groupBuckets, boolean lastValue, String lastValueKey, boolean nonDestructive, int consumersBeforeDispatch, long delayBeforeDispatch, boolean autoCreateAddress) throws Exception {
return (String) proxy.invokeOperation("createQueue", address, routingType, name, filter, durable, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, lastValue, lastValueKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, autoCreateAddress);
}
@Override
public String createQueue(String address, String routingType, String name, String filter, boolean durable, int maxConsumers, boolean purgeOnNoConsumers, boolean exclusive, boolean groupRebalance, int groupBuckets, boolean lastValue, String lastValueKey, boolean nonDestructive, int consumersBeforeDispatch, long delayBeforeDispatch, boolean autoDelete, long autoDeleteDelay, long autoDeleteMessageCount, boolean autoCreateAddress) throws Exception {
return (String) proxy.invokeOperation("createQueue", address, routingType, name, filter, durable, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, lastValue, lastValueKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, autoDelete, autoDeleteDelay, autoDeleteMessageCount, autoCreateAddress);
}
@Override
public String createQueue(String address, String routingType, String name, String filter, boolean durable, int maxConsumers, boolean purgeOnNoConsumers, boolean exclusive, boolean groupRebalance, int groupBuckets, String groupFirstKey, boolean lastValue, String lastValueKey, boolean nonDestructive, int consumersBeforeDispatch, long delayBeforeDispatch, boolean autoDelete, long autoDeleteDelay, long autoDeleteMessageCount, boolean autoCreateAddress) throws Exception {
return (String) proxy.invokeOperation("createQueue", address, routingType, name, filter, durable, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, groupFirstKey, lastValue, lastValueKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, autoDelete, autoDeleteDelay, autoDeleteMessageCount, autoCreateAddress);
}
@Override
public String createQueue(String address, String routingType, String name, String filter, boolean durable, int maxConsumers, boolean purgeOnNoConsumers, boolean exclusive, boolean groupRebalance, int groupBuckets, String groupFirstKey, boolean lastValue, String lastValueKey, boolean nonDestructive, int consumersBeforeDispatch, long delayBeforeDispatch, boolean autoDelete, long autoDeleteDelay, long autoDeleteMessageCount, boolean autoCreateAddress, long ringSize) throws Exception {
return (String) proxy.invokeOperation("createQueue", address, routingType, name, filter, durable, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, groupFirstKey, lastValue, lastValueKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, autoDelete, autoDeleteDelay, autoDeleteMessageCount, autoCreateAddress, ringSize);
}
@Override
public void createQueue(final String address, final String name, final boolean durable) throws Exception {
proxy.invokeOperation("createQueue", address, name, durable);
}
@Override
public void deployQueue(final String address,
final String name,
final String filter,
final boolean durable) throws Exception {
proxy.invokeOperation("deployQueue", address, name, filter, durable);
}
@Override
public void deployQueue(final String address, final String name, final String filterString) throws Exception {
proxy.invokeOperation("deployQueue", address, name);
}
@Override
public void destroyQueue(final String name) throws Exception {
proxy.invokeOperation("destroyQueue", name);
}
@Override
public void destroyQueue(final String name, final boolean removeConsumers) throws Exception {
proxy.invokeOperation("destroyQueue", name, removeConsumers);
}
@Override
public void destroyQueue(String name,
boolean removeConsumers,
boolean autoDeleteAddress) throws Exception {
proxy.invokeOperation("destroyQueue", name, removeConsumers, autoDeleteAddress);
}
@Override
public void disableMessageCounters() throws Exception {
proxy.invokeOperation("disableMessageCounters");
}
@Override
public void enableMessageCounters() throws Exception {
proxy.invokeOperation("enableMessageCounters");
}
@Override
public String getBindingsDirectory() {
return (String) proxy.retrieveAttributeValue("bindingsDirectory");
}
@Override
public int getConnectionCount() {
return (Integer) proxy.retrieveAttributeValue("connectionCount", Integer.class);
}
@Override
public long getTotalConnectionCount() {
return (Long) proxy.retrieveAttributeValue("totalConnectionCount", Long.class);
}
@Override
public long getTotalMessageCount() {
return (Long) proxy.retrieveAttributeValue("totalMessageCount", Long.class);
}
@Override
public long getTotalMessagesAdded() {
return (Long) proxy.retrieveAttributeValue("totalMessagesAdded", Long.class);
}
@Override
public long getTotalMessagesAcknowledged() {
return (Long) proxy.retrieveAttributeValue("totalMessagesAcknowledged", Long.class);
}
@Override
public long getTotalConsumerCount() {
return (Long) proxy.retrieveAttributeValue("totalConsumerCount", Long.class);
}
@Override
public long getConnectionTTLOverride() {
return (Long) proxy.retrieveAttributeValue("connectionTTLOverride", Long.class);
}
@Override
public Object[] getConnectors() throws Exception {
return (Object[]) proxy.retrieveAttributeValue("connectors");
}
@Override
public String getConnectorsAsJSON() throws Exception {
return (String) proxy.retrieveAttributeValue("connectorsAsJSON");
}
@Override
public Object[] getAcceptors() throws Exception {
return (Object[]) proxy.retrieveAttributeValue("acceptors");
}
@Override
public String getAcceptorsAsJSON() throws Exception {
return (String) proxy.retrieveAttributeValue("acceptorsAsJSON");
}
@Override
public int getAddressCount() {
return (Integer) proxy.retrieveAttributeValue("addressCount", Integer.class);
}
@Override
public String[] getAddressNames() {
return (String[]) proxy.retrieveAttributeValue("addressNames", String.class);
}
@Override
public int getQueueCount() {
return (Integer) proxy.retrieveAttributeValue("queueCount", Integer.class);
}
@Override
public String[] getQueueNames() {
return (String[]) proxy.retrieveAttributeValue("queueNames", String.class);
}
@Override
public String[] getQueueNames(String routingType) {
try {
return (String[]) proxy.invokeOperation(String.class, "getQueueNames", routingType);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public String[] getClusterConnectionNames() {
try {
return (String[]) proxy.invokeOperation(String.class, "getClusterConnectionNames");
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public void addUser(String username,
String password,
String role,
boolean plaintext) throws Exception {
proxy.invokeOperation("addUser", username, password, role, plaintext);
}
@Override
public String listUser(String username) throws Exception {
return (String) proxy.invokeOperation("listUser", username, String.class);
}
@Override
public void removeUser(String username) throws Exception {
proxy.invokeOperation("removeUser", username);
}
@Override
public void resetUser(String username, String password, String roles) throws Exception {
proxy.invokeOperation("resetUser", username, password, roles);
}
@Override
public void resetUser(String username, String password, String roles, boolean plaintext) throws Exception {
proxy.invokeOperation("resetUser", username, password, roles, plaintext);
}
@Override
public void reloadConfigurationFile() throws Exception {
proxy.invokeOperation("reloadConfigurationFile");
}
@Override
public String getUptime() {
return null;
}
@Override
public long getUptimeMillis() {
return 0;
}
@Override
public boolean isReplicaSync() {
return false;
}
@Override
public int getIDCacheSize() {
return (Integer) proxy.retrieveAttributeValue("IDCacheSize", Integer.class);
}
public String[] getInterceptorClassNames() {
return (String[]) proxy.retrieveAttributeValue("incomingInterceptorClassNames", String.class);
}
@Override
public String[] getIncomingInterceptorClassNames() {
return (String[]) proxy.retrieveAttributeValue("incomingInterceptorClassNames", String.class);
}
@Override
public String[] getOutgoingInterceptorClassNames() {
return (String[]) proxy.retrieveAttributeValue("outgoingInterceptorClassNames", String.class);
}
@Override
public String getJournalDirectory() {
return (String) proxy.retrieveAttributeValue("journalDirectory");
}
@Override
public int getJournalFileSize() {
return (Integer) proxy.retrieveAttributeValue("journalFileSize", Integer.class);
}
@Override
public int getJournalMaxIO() {
return (Integer) proxy.retrieveAttributeValue("journalMaxIO", Integer.class);
}
@Override
public int getJournalMinFiles() {
return (Integer) proxy.retrieveAttributeValue("journalMinFiles", Integer.class);
}
@Override
public String getJournalType() {
return (String) proxy.retrieveAttributeValue("journalType");
}
@Override
public String getLargeMessagesDirectory() {
return (String) proxy.retrieveAttributeValue("largeMessagesDirectory");
}
@Override
public String getNodeID() {
return (String) proxy.retrieveAttributeValue("nodeID");
}
@Override
public long getActivationSequence() {
return (Long) proxy.retrieveAttributeValue("activationSequence");
}
@Override
public String getManagementAddress() {
return (String) proxy.retrieveAttributeValue("managementAddress");
}
@Override
public String getManagementNotificationAddress() {
return (String) proxy.retrieveAttributeValue("managementNotificationAddress");
}
@Override
public int getMessageCounterMaxDayCount() {
return (Integer) proxy.retrieveAttributeValue("messageCounterMaxDayCount", Integer.class);
}
@Override
public long getMessageCounterSamplePeriod() {
return (Long) proxy.retrieveAttributeValue("messageCounterSamplePeriod", Long.class);
}
@Override
public long getMessageExpiryScanPeriod() {
return (Long) proxy.retrieveAttributeValue("messageExpiryScanPeriod", Long.class);
}
@Override
public long getMessageExpiryThreadPriority() {
return (Long) proxy.retrieveAttributeValue("messageExpiryThreadPriority", Long.class);
}
@Override
public String getPagingDirectory() {
return (String) proxy.retrieveAttributeValue("pagingDirectory");
}
@Override
public int getScheduledThreadPoolMaxSize() {
return (Integer) proxy.retrieveAttributeValue("scheduledThreadPoolMaxSize", Integer.class);
}
@Override
public int getThreadPoolMaxSize() {
return (Integer) proxy.retrieveAttributeValue("threadPoolMaxSize", Integer.class);
}
@Override
public long getSecurityInvalidationInterval() {
return (Long) proxy.retrieveAttributeValue("securityInvalidationInterval", Long.class);
}
@Override
public long getTransactionTimeout() {
return (Long) proxy.retrieveAttributeValue("transactionTimeout", Long.class);
}
@Override
public long getTransactionTimeoutScanPeriod() {
return (Long) proxy.retrieveAttributeValue("transactionTimeoutScanPeriod", Long.class);
}
@Override
public String getName() {
return (String) proxy.retrieveAttributeValue("name");
}
@Override
public String getVersion() {
return proxy.retrieveAttributeValue("version").toString();
}
@Override
public boolean isBackup() {
return (Boolean) proxy.retrieveAttributeValue("backup");
}
@Override
public boolean isClustered() {
return (Boolean) proxy.retrieveAttributeValue("clustered");
}
@Override
public boolean isCreateBindingsDir() {
return (Boolean) proxy.retrieveAttributeValue("createBindingsDir");
}
@Override
public boolean isCreateJournalDir() {
return (Boolean) proxy.retrieveAttributeValue("createJournalDir");
}
@Override
public boolean isJournalSyncNonTransactional() {
return (Boolean) proxy.retrieveAttributeValue("journalSyncNonTransactional");
}
@Override
public boolean isJournalSyncTransactional() {
return (Boolean) proxy.retrieveAttributeValue("journalSyncTransactional");
}
@Override
public void setFailoverOnServerShutdown(boolean failoverOnServerShutdown) throws Exception {
proxy.invokeOperation("setFailoverOnServerShutdown", failoverOnServerShutdown);
}
@Override
public boolean isFailoverOnServerShutdown() {
return (Boolean) proxy.retrieveAttributeValue("failoverOnServerShutdown");
}
public void setScaleDown(boolean scaleDown) throws Exception {
proxy.invokeOperation("setEnabled", scaleDown);
}
public boolean isScaleDown() {
return (Boolean) proxy.retrieveAttributeValue("scaleDown");
}
@Override
public boolean isMessageCounterEnabled() {
return (Boolean) proxy.retrieveAttributeValue("messageCounterEnabled");
}
@Override
public boolean isPersistDeliveryCountBeforeDelivery() {
return (Boolean) proxy.retrieveAttributeValue("persistDeliveryCountBeforeDelivery");
}
@Override
public boolean isAsyncConnectionExecutionEnabled() {
return (Boolean) proxy.retrieveAttributeValue("asyncConnectionExecutionEnabled");
}
@Override
public boolean isPersistIDCache() {
return (Boolean) proxy.retrieveAttributeValue("persistIDCache");
}
@Override
public boolean isSecurityEnabled() {
return (Boolean) proxy.retrieveAttributeValue("securityEnabled");
}
@Override
public boolean isStarted() {
return (Boolean) proxy.retrieveAttributeValue("started");
}
@Override
public boolean isWildcardRoutingEnabled() {
return (Boolean) proxy.retrieveAttributeValue("wildcardRoutingEnabled");
}
@Override
public String[] listConnectionIDs() throws Exception {
return (String[]) proxy.invokeOperation("listConnectionIDs");
}
@Override
public String[] listPreparedTransactions() throws Exception {
return (String[]) proxy.invokeOperation("listPreparedTransactions");
}
@Override
public String listPreparedTransactionDetailsAsJSON() throws Exception {
return (String) proxy.invokeOperation("listPreparedTransactionDetailsAsJSON");
}
@Override
public String listPreparedTransactionDetailsAsHTML() throws Exception {
return (String) proxy.invokeOperation("listPreparedTransactionDetailsAsHTML");
}
@Override
public String[] listHeuristicCommittedTransactions() throws Exception {
return (String[]) proxy.invokeOperation("listHeuristicCommittedTransactions");
}
@Override
public String[] listHeuristicRolledBackTransactions() throws Exception {
return (String[]) proxy.invokeOperation("listHeuristicRolledBackTransactions");
}
@Override
public String[] listRemoteAddresses() throws Exception {
return (String[]) proxy.invokeOperation("listRemoteAddresses");
}
@Override
public String[] listRemoteAddresses(final String ipAddress) throws Exception {
return (String[]) proxy.invokeOperation("listRemoteAddresses", ipAddress);
}
@Override
public String[] listSessions(final String connectionID) throws Exception {
return (String[]) proxy.invokeOperation("listSessions", connectionID);
}
@Override
public void resetAllMessageCounterHistories() throws Exception {
proxy.invokeOperation("resetAllMessageCounterHistories");
}
@Override
public void resetAllMessageCounters() throws Exception {
proxy.invokeOperation("resetAllMessageCounters");
}
@Override
public boolean rollbackPreparedTransaction(final String transactionAsBase64) throws Exception {
return (Boolean) proxy.invokeOperation("rollbackPreparedTransaction", transactionAsBase64);
}
public void sendQueueInfoToQueue(final String queueName, final String address) throws Exception {
proxy.invokeOperation("sendQueueInfoToQueue", queueName, address);
}
@Override
public void setMessageCounterMaxDayCount(final int count) throws Exception {
proxy.invokeOperation("setMessageCounterMaxDayCount", count);
}
@Override
public void setMessageCounterSamplePeriod(final long newPeriod) throws Exception {
proxy.invokeOperation("setMessageCounterSamplePeriod", newPeriod);
}
@Override
public int getJournalBufferSize() {
return (Integer) proxy.retrieveAttributeValue("JournalBufferSize", Integer.class);
}
@Override
public int getJournalPoolFiles() {
return (Integer) proxy.retrieveAttributeValue("JournalPoolFiles", Integer.class);
}
@Override
public int getJournalBufferTimeout() {
return (Integer) proxy.retrieveAttributeValue("JournalBufferTimeout", Integer.class);
}
@Override
public int getJournalCompactMinFiles() {
return (Integer) proxy.retrieveAttributeValue("JournalCompactMinFiles", Integer.class);
}
@Override
public int getJournalCompactPercentage() {
return (Integer) proxy.retrieveAttributeValue("JournalCompactPercentage", Integer.class);
}
@Override
public boolean isPersistenceEnabled() {
return (Boolean) proxy.retrieveAttributeValue("PersistenceEnabled");
}
@Override
public int getDiskScanPeriod() {
return (Integer) proxy.retrieveAttributeValue("DiskScanPeriod", Integer.class);
}
@Override
public int getMaxDiskUsage() {
return (Integer) proxy.retrieveAttributeValue("MaxDiskUsage", Integer.class);
}
@Override
public long getGlobalMaxSize() {
return (Long) proxy.retrieveAttributeValue("GlobalMaxSize", Long.class);
}
@Override
public long getAddressMemoryUsage() {
try {
return (Long) proxy.invokeOperation("getAddressMemoryUsage");
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
@Override
public int getAddressMemoryUsagePercentage() {
try {
return (Integer) proxy.invokeOperation(Integer.TYPE, "getAddressMemoryUsagePercentage");
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
@Override
public long getAuthenticationCacheSize() {
return (Long) proxy.retrieveAttributeValue("AuthenticationCacheSize", Long.class);
}
@Override
public long getAuthorizationCacheSize() {
return (Long) proxy.retrieveAttributeValue("AuthorizationCacheSize", Long.class);
}
@Override
public double getDiskStoreUsage() {
try {
return (Double) proxy.invokeOperation("getDiskStoreUsage");
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
@Override
public String getHAPolicy() {
return null;
}
@Override
public boolean freezeReplication() {
return false;
}
@Override
public String createAddress(String name, String routingTypes) throws Exception {
return (String) proxy.invokeOperation("createAddress", name, routingTypes);
}
@Override
public void addSecuritySettings(String addressMatch,
String sendRoles,
String consumeRoles,
String createDurableQueueRoles,
String deleteDurableQueueRoles,
String createNonDurableQueueRoles,
String deleteNonDurableQueueRoles,
String manageRoles) throws Exception {
proxy.invokeOperation("addSecuritySettings", addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles);
}
@Override
public void addSecuritySettings(String addressMatch,
String sendRoles,
String consumeRoles,
String createDurableQueueRoles,
String deleteDurableQueueRoles,
String createNonDurableQueueRoles,
String deleteNonDurableQueueRoles,
String manageRoles,
String browseRoles) throws Exception {
proxy.invokeOperation("addSecuritySettings", addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles);
}
@Override
public void addSecuritySettings(String addressMatch,
String sendRoles,
String consumeRoles,
String createDurableQueueRoles,
String deleteDurableQueueRoles,
String createNonDurableQueueRoles,
String deleteNonDurableQueueRoles,
String manageRoles,
String browseRoles,
String createAddress,
String deleteAddress) throws Exception {
proxy.invokeOperation("addSecuritySettings", addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddress, deleteAddress);
}
@Override
public void removeSecuritySettings(String addressMatch) throws Exception {
proxy.invokeOperation("removeSecuritySettings", addressMatch);
}
@Override
public Object[] getRoles(String addressMatch) throws Exception {
return (Object[]) proxy.invokeOperation("getRoles", addressMatch);
}
@Override
public String getRolesAsJSON(String addressMatch) throws Exception {
return (String) proxy.invokeOperation("getRolesAsJSON", addressMatch);
}
@Override
public void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
@Parameter(desc = "the dead letter address setting", name = "DLA") String DLA,
@Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress,
@Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay,
@Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue,
@Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts,
@Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes,
@Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes,
@Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize,
@Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay,
@Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier,
@Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay,
@Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay,
@Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
@Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy,
@Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold,
@Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod,
@Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy,
@Parameter(desc = "allow queues to be created automatically", name = "autoCreateJmsQueues") boolean autoCreateJmsQueues,
@Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
@Parameter(desc = "allow topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
@Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics) throws Exception {
proxy.invokeOperation("addAddressSettings",
addressMatch,
DLA,
expiryAddress,
expiryDelay,
lastValueQueue,
deliveryAttempts,
maxSizeBytes,
pageSizeBytes,
pageMaxCacheSize,
redeliveryDelay,
redeliveryMultiplier,
maxRedeliveryDelay,
redistributionDelay,
sendToDLAOnNoRoute,
addressFullMessagePolicy,
slowConsumerThreshold,
slowConsumerCheckPeriod,
slowConsumerPolicy,
autoCreateJmsQueues,
autoDeleteJmsQueues,
autoCreateJmsTopics,
autoDeleteJmsTopics);
}
@Override
public void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
@Parameter(desc = "the dead letter address setting", name = "DLA") String DLA,
@Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress,
@Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay,
@Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue,
@Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts,
@Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes,
@Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes,
@Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize,
@Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay,
@Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier,
@Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay,
@Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay,
@Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
@Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy,
@Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold,
@Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod,
@Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy,
@Parameter(desc = "allow jms queues to be created automatically", name = "autoCreateJmsQueues") boolean autoCreateJmsQueues,
@Parameter(desc = "allow auto-created jms queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
@Parameter(desc = "allow jms topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
@Parameter(desc = "allow auto-created jms topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics,
@Parameter(desc = "allow queues to be created automatically", name = "autoCreateQueues") boolean autoCreateQueues,
@Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteQueues") boolean autoDeleteQueues,
@Parameter(desc = "allow topics to be created automatically", name = "autoCreateAddresses") boolean autoCreateAddresses,
@Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteAddresses") boolean autoDeleteAddresses) throws Exception {
proxy.invokeOperation("addAddressSettings",
addressMatch,
DLA,
expiryAddress,
expiryDelay,
lastValueQueue,
deliveryAttempts,
maxSizeBytes,
pageSizeBytes,
pageMaxCacheSize,
redeliveryDelay,
redeliveryMultiplier,
maxRedeliveryDelay,