18
18
19
19
import java .util .concurrent .ScheduledExecutorService ;
20
20
21
- import org .apache .activemq .artemis .api .config .ActiveMQDefaultConfiguration ;
22
21
import org .apache .activemq .artemis .api .core .Message ;
23
22
import org .apache .activemq .artemis .api .core .QueueConfiguration ;
24
23
import org .apache .activemq .artemis .api .core .SimpleString ;
30
29
import org .apache .activemq .artemis .core .postoffice .PostOffice ;
31
30
import org .apache .activemq .artemis .core .server .ActiveMQServer ;
32
31
import org .apache .activemq .artemis .core .server .Queue ;
33
- import org .apache .activemq .artemis .core .server .QueueConfig ;
34
32
import org .apache .activemq .artemis .core .server .QueueFactory ;
35
33
import org .apache .activemq .artemis .core .settings .HierarchicalRepository ;
36
34
import org .apache .activemq .artemis .core .settings .impl .AddressSettings ;
@@ -74,19 +72,6 @@ public void setPostOffice(final PostOffice postOffice) {
74
72
this .postOffice = postOffice ;
75
73
}
76
74
77
- @ Deprecated
78
- @ Override
79
- public Queue createQueueWith (final QueueConfig config ) {
80
- final Queue queue ;
81
- if (lastValueKey (config ) != null ) {
82
- queue = new LastValueQueue (config .id (), config .address (), config .name (), config .filter (), config .getPagingStore (), config .pageSubscription (), config .user (), config .isDurable (), config .isTemporary (), config .isAutoCreated (), config .deliveryMode (), config .maxConsumers (), config .isExclusive (), config .isGroupRebalance (), config .getGroupBuckets (), config .getGroupFirstKey (), config .consumersBeforeDispatch (), config .delayBeforeDispatch (), config .isPurgeOnNoConsumers (), lastValueKey (config ), config .isNonDestructive (), config .isAutoDelete (), config .getAutoDeleteDelay (), config .getAutoDeleteMessageCount (), config .isConfigurationManaged (), scheduledExecutor , postOffice , storageManager , addressSettingsRepository , executorFactory .getExecutor (), server , this );
83
- } else {
84
- queue = new QueueImpl (config .id (), config .address (), config .name (), config .filter (), config .getPagingStore (), config .pageSubscription (), config .user (), config .isDurable (), config .isTemporary (), config .isAutoCreated (), config .deliveryMode (), config .maxConsumers (), config .isExclusive (), config .isGroupRebalance (), config .getGroupBuckets (), config .getGroupFirstKey (), config .isNonDestructive (), config .consumersBeforeDispatch (), config .delayBeforeDispatch (), config .isPurgeOnNoConsumers (), config .isAutoDelete (), config .getAutoDeleteDelay (), config .getAutoDeleteMessageCount (), config .isConfigurationManaged (), config .getRingSize (), scheduledExecutor , postOffice , storageManager , addressSettingsRepository , executorFactory .getExecutor (), server , this );
85
- }
86
- server .getCriticalAnalyzer ().add (queue );
87
- return queue ;
88
- }
89
-
90
75
@ Override
91
76
public Queue createQueueWith (final QueueConfiguration config , PagingManager pagingManager , Filter filter ) {
92
77
validateState (config );
@@ -101,35 +86,6 @@ public Queue createQueueWith(final QueueConfiguration config, PagingManager pagi
101
86
return queue ;
102
87
}
103
88
104
- @ Deprecated
105
- @ Override
106
- public Queue createQueue (final long persistenceID ,
107
- final SimpleString address ,
108
- final SimpleString name ,
109
- final Filter filter ,
110
- final PageSubscription pageSubscription ,
111
- final SimpleString user ,
112
- final boolean durable ,
113
- final boolean temporary ,
114
- final boolean autoCreated ) throws Exception {
115
-
116
- // Add default address info if one doesn't exist
117
- postOffice .addAddressInfo (new AddressInfo (address ));
118
-
119
- AddressSettings addressSettings = addressSettingsRepository .getMatch (address .toString ());
120
-
121
- Queue queue ;
122
- if (lastValueKey (addressSettings ) != null ) {
123
- queue = new LastValueQueue (persistenceID , address , name , filter , pageSubscription == null ? null : pageSubscription .getPagingStore (), pageSubscription , user , durable , temporary , autoCreated , ActiveMQDefaultConfiguration .getDefaultRoutingType (), ActiveMQDefaultConfiguration .getDefaultMaxQueueConsumers (), ActiveMQDefaultConfiguration .getDefaultExclusive (), ActiveMQDefaultConfiguration .getDefaultGroupRebalance (), ActiveMQDefaultConfiguration .getDefaultGroupBuckets (), ActiveMQDefaultConfiguration .getDefaultGroupFirstKey (), ActiveMQDefaultConfiguration .getDefaultConsumersBeforeDispatch (), ActiveMQDefaultConfiguration .getDefaultDelayBeforeDispatch (), ActiveMQDefaultConfiguration .getDefaultPurgeOnNoConsumers (), lastValueKey (addressSettings ), ActiveMQDefaultConfiguration .getDefaultNonDestructive (), ActiveMQDefaultConfiguration .getDefaultQueueAutoDelete (autoCreated ), ActiveMQDefaultConfiguration .getDefaultQueueAutoDeleteDelay (), ActiveMQDefaultConfiguration .getDefaultQueueAutoDeleteMessageCount (), false , scheduledExecutor , postOffice , storageManager , addressSettingsRepository , executorFactory .getExecutor (), server , this );
124
- } else {
125
- queue = new QueueImpl (persistenceID , address , name , filter , pageSubscription == null ? null : pageSubscription .getPagingStore (), pageSubscription , user , durable , temporary , autoCreated , scheduledExecutor , postOffice , storageManager , addressSettingsRepository , executorFactory .getExecutor (), server , this );
126
- }
127
-
128
- server .getCriticalAnalyzer ().add (queue );
129
-
130
- return queue ;
131
- }
132
-
133
89
@ Override
134
90
public void queueRemoved (Queue queue ) {
135
91
server .getCriticalAnalyzer ().remove (queue );
@@ -152,16 +108,6 @@ public static PageSubscription getPageSubscription(QueueConfiguration queueConfi
152
108
return pageSubscription ;
153
109
}
154
110
155
- private static SimpleString lastValueKey (final QueueConfig config ) {
156
- if (config .lastValueKey () != null && !config .lastValueKey ().isEmpty ()) {
157
- return config .lastValueKey ();
158
- } else if (config .isLastValue ()) {
159
- return Message .HDR_LAST_VALUE_NAME ;
160
- } else {
161
- return null ;
162
- }
163
- }
164
-
165
111
private static SimpleString lastValueKey (final QueueConfiguration config ) {
166
112
if (config .getLastValueKey () != null && !config .getLastValueKey ().isEmpty ()) {
167
113
return config .getLastValueKey ();
@@ -172,16 +118,6 @@ private static SimpleString lastValueKey(final QueueConfiguration config) {
172
118
}
173
119
}
174
120
175
- private static SimpleString lastValueKey (final AddressSettings addressSettings ) {
176
- if (addressSettings .getDefaultLastValueKey () != null && !addressSettings .getDefaultLastValueKey ().isEmpty ()) {
177
- return addressSettings .getDefaultLastValueKey ();
178
- } else if (addressSettings .isDefaultLastValueQueue ()) {
179
- return Message .HDR_LAST_VALUE_NAME ;
180
- } else {
181
- return null ;
182
- }
183
- }
184
-
185
121
private void validateState (QueueConfiguration config ) {
186
122
if (isEmptyOrNull (config .getName ())) {
187
123
throw new IllegalStateException ("name can't be null or empty!" );
0 commit comments