Skip to content

Commit d4e0f5c

Browse files
committed
GH-1485: Remove Deprecations
Resolves #1485
1 parent ba4b62e commit d4e0f5c

File tree

14 files changed

+14
-368
lines changed

14 files changed

+14
-368
lines changed

spring-amqp/src/main/java/org/springframework/amqp/core/AmqpMessageReturnedException.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2020 the original author or authors.
2+
* Copyright 2015-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,13 +32,6 @@ public class AmqpMessageReturnedException extends AmqpException {
3232

3333
private final ReturnedMessage returned;
3434

35-
@Deprecated
36-
public AmqpMessageReturnedException(String message, Message returnedMessage, int replyCode, String replyText,
37-
String exchange, String routingKey) {
38-
39-
this(message, new ReturnedMessage(returnedMessage, replyCode, replyText, exchange, routingKey));
40-
}
41-
4235
public AmqpMessageReturnedException(String message, ReturnedMessage returned) {
4336
super(message);
4437
this.returned = returned;

spring-amqp/src/main/java/org/springframework/amqp/core/Message.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,16 +74,6 @@ public Message(byte[] body, MessageProperties messageProperties) { //NOSONAR
7474
this.messageProperties = messageProperties;
7575
}
7676

77-
/**
78-
* No longer used.
79-
* @param patterns the patterns.
80-
* @since 1.5.7
81-
* @deprecated toString() no longer deserializes the body.
82-
*/
83-
@Deprecated
84-
public static void addAllowedListPatterns(String... patterns) {
85-
}
86-
8777
/**
8878
* Set the encoding to use in {@link #toString()} when converting the body if
8979
* there is no {@link MessageProperties#getContentEncoding() contentEncoding} message property present.

spring-amqp/src/main/java/org/springframework/amqp/core/Queue.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,14 +32,6 @@
3232
*/
3333
public class Queue extends AbstractDeclarable implements Cloneable {
3434

35-
/**
36-
* Argument key for the master locator.
37-
* @since 2.1
38-
* @deprecated in favor of {@link #X_QUEUE_LEADER_LOCATOR}.
39-
*/
40-
@Deprecated
41-
public static final String X_QUEUE_MASTER_LOCATOR = "x-queue-master-locator";
42-
4335
/**
4436
* Argument key for the queue leader locator.
4537
* @since 2.1
@@ -165,22 +157,6 @@ public String getActualName() {
165157
return this.actualName;
166158
}
167159

168-
/**
169-
* Set the master locator strategy argument for this queue.
170-
* @param locator the locator; null to clear the argument.
171-
* @since 2.1
172-
* @deprecated in favor of {@link #setLeaderLocator(String)}.
173-
*/
174-
@Deprecated
175-
public final void setMasterLocator(@Nullable String locator) {
176-
if (locator == null) {
177-
removeArgument(X_QUEUE_LEADER_LOCATOR);
178-
}
179-
else {
180-
addArgument(X_QUEUE_LEADER_LOCATOR, locator);
181-
}
182-
}
183-
184160
/**
185161
* Set the leader locator strategy argument for this queue.
186162
* @param locator the locator; null to clear the argument.

spring-amqp/src/main/java/org/springframework/amqp/core/QueueBuilder.java

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -223,20 +223,6 @@ public QueueBuilder lazy() {
223223
return withArgument("x-queue-mode", "lazy");
224224
}
225225

226-
/**
227-
* Set the master locator mode which determines which node a queue master will be
228-
* located on a cluster of nodes.
229-
* @param locator {@link MasterLocator#minMasters}, {@link MasterLocator#clientLocal}
230-
* or {@link MasterLocator#random}.
231-
* @return the builder.
232-
* @since 2.2
233-
* @deprecated in favor of {@link #leaderLocator(LeaderLocator)}.
234-
*/
235-
@Deprecated
236-
public QueueBuilder masterLocator(MasterLocator locator) {
237-
return withArgument("x-queue-master-locator", locator.getValue());
238-
}
239-
240226
/**
241227
* Set the master locator mode which determines which node a queue master will be
242228
* located on a cluster of nodes.
@@ -326,43 +312,6 @@ public String getValue() {
326312

327313
}
328314

329-
/**
330-
* @deprecated in favor of {@link LeaderLocator}.
331-
*/
332-
@Deprecated
333-
public enum MasterLocator {
334-
335-
/**
336-
* Deploy on the node with the fewest masters.
337-
*/
338-
minMasters("min-masters"),
339-
340-
/**
341-
* Deploy on the node we are connected to.
342-
*/
343-
clientLocal("client-local"),
344-
345-
/**
346-
* Deploy on a random node.
347-
*/
348-
random("random");
349-
350-
private final String value;
351-
352-
MasterLocator(String value) {
353-
this.value = value;
354-
}
355-
356-
/**
357-
* Return the value.
358-
* @return the value.
359-
*/
360-
public String getValue() {
361-
return this.value;
362-
}
363-
364-
}
365-
366315
/**
367316
* Locate the queue leader.
368317
*

spring-rabbit-test/src/main/java/org/springframework/amqp/rabbit/test/mockito/LambdaAnswer.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 the original author or authors.
2+
* Copyright 2016-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,17 +47,6 @@ public class LambdaAnswer<T> extends ForwardsInvocations {
4747

4848
private final boolean hasDelegate;
4949

50-
/**
51-
* Deprecated.
52-
* @param callRealMethod true to call the real method.
53-
* @param callback the callback.
54-
* @deprecated in favor of {@link #LambdaAnswer(boolean, ValueToReturn, Object)}.
55-
*/
56-
@Deprecated
57-
public LambdaAnswer(boolean callRealMethod, ValueToReturn<T> callback) {
58-
this(callRealMethod, callback, null);
59-
}
60-
6150
/**
6251
* Construct an instance with the provided properties. Use the test harness to get an
6352
* instance with the proper delegate.

spring-rabbit-test/src/main/java/org/springframework/amqp/rabbit/test/mockito/LatchCountDownAndCallRealMethodAnswer.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,17 +46,6 @@ public class LatchCountDownAndCallRealMethodAnswer extends ForwardsInvocations {
4646

4747
private final boolean hasDelegate;
4848

49-
/**
50-
* Get an instance with no delegate.
51-
* @param count to set in a {@link CountDownLatch}.
52-
* @deprecated in favor of
53-
* {@link #LatchCountDownAndCallRealMethodAnswer(int, Object)}.
54-
*/
55-
@Deprecated
56-
public LatchCountDownAndCallRealMethodAnswer(int count) {
57-
this(count, null);
58-
}
59-
6049
/**
6150
* Get an instance with the provided properties. Use the test harness to get an
6251
* instance with the proper delegate.

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactory.java

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -397,45 +397,6 @@ public void setPublisherReturns(boolean publisherReturns) {
397397
}
398398
}
399399

400-
/**
401-
* Use full (correlated) publisher confirms, with correlation data and a callback for
402-
* each message.
403-
* @param publisherConfirms true for full publisher returns,
404-
* @since 1.1
405-
* @deprecated in favor of {@link #setPublisherConfirmType(ConfirmType)}.
406-
* @see #setSimplePublisherConfirms(boolean)
407-
*/
408-
@Deprecated
409-
public void setPublisherConfirms(boolean publisherConfirms) {
410-
Assert.isTrue(!publisherConfirms || !ConfirmType.SIMPLE.equals(this.confirmType),
411-
"Cannot set both publisherConfirms and simplePublisherConfirms");
412-
if (publisherConfirms) {
413-
setPublisherConfirmType(ConfirmType.CORRELATED);
414-
}
415-
else if (this.confirmType.equals(ConfirmType.CORRELATED)) {
416-
setPublisherConfirmType(ConfirmType.NONE);
417-
}
418-
}
419-
420-
/**
421-
* Use simple publisher confirms where the template simply waits for completion.
422-
* @param simplePublisherConfirms true for confirms.
423-
* @since 2.1
424-
* @deprecated in favor of {@link #setPublisherConfirmType(ConfirmType)}.
425-
* @see #setPublisherConfirms(boolean)
426-
*/
427-
@Deprecated
428-
public void setSimplePublisherConfirms(boolean simplePublisherConfirms) {
429-
Assert.isTrue(!simplePublisherConfirms || !ConfirmType.CORRELATED.equals(this.confirmType),
430-
"Cannot set both publisherConfirms and simplePublisherConfirms");
431-
if (simplePublisherConfirms) {
432-
setPublisherConfirmType(ConfirmType.SIMPLE);
433-
}
434-
else if (this.confirmType.equals(ConfirmType.SIMPLE)) {
435-
setPublisherConfirmType(ConfirmType.NONE);
436-
}
437-
}
438-
439400
@Override
440401
public boolean isSimplePublisherConfirms() {
441402
return this.confirmType.equals(ConfirmType.SIMPLE);

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CorrelationData.java

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.concurrent.CompletableFuture;
2121

2222
import org.springframework.amqp.core.Correlation;
23-
import org.springframework.amqp.core.Message;
2423
import org.springframework.amqp.core.ReturnedMessage;
2524
import org.springframework.lang.Nullable;
2625
import org.springframework.util.Assert;
@@ -99,44 +98,13 @@ public CompletableFuture<Confirm> getFuture() {
9998
* Return a future to check the success/failure of the publish operation.
10099
* @return the future.
101100
* @since 2.4.7
102-
* @deprecated in favor of {@link #getFuture()}.
101+
* @deprecated as of 3.0, in favor of {@link #getFuture()}.
103102
*/
104103
@Deprecated
105104
public CompletableFuture<Confirm> getCompletableFuture() {
106105
return this.future;
107106
}
108107

109-
/**
110-
* Return a returned message, if any; requires a unique
111-
* {@link #CorrelationData(String) id}. Guaranteed to be populated before the future
112-
* is set.
113-
* @return the message or null.
114-
* @since 2.1
115-
* @deprecated in favor of {@link #getReturned()}.
116-
*/
117-
@Deprecated
118-
@Nullable
119-
public Message getReturnedMessage() {
120-
if (this.returnedMessage == null) {
121-
return null;
122-
}
123-
else {
124-
return this.returnedMessage.getMessage();
125-
}
126-
}
127-
128-
/**
129-
* Set a returned message for this correlation data.
130-
* @param returnedMessage the returned message.
131-
* @since 1.7.13
132-
* @deprecated in favor of {@link #setReturned(ReturnedMessage)}.
133-
*/
134-
@Deprecated
135-
public void setReturnedMessage(Message returnedMessage) {
136-
this.returnedMessage = new ReturnedMessage(returnedMessage, 0, "not available", "not available",
137-
"not available");
138-
}
139-
140108
/**
141109
* Get the returned message and metadata, if any. Guaranteed to be populated before
142110
* the future is set.

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PublisherCallbackChannel.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
1919
import java.util.Collection;
2020
import java.util.function.Consumer;
2121

22-
import com.rabbitmq.client.AMQP;
2322
import com.rabbitmq.client.Channel;
2423
import com.rabbitmq.client.Return;
2524

@@ -115,37 +114,11 @@ interface Listener {
115114
*/
116115
void handleConfirm(PendingConfirm pendingConfirm, boolean ack);
117116

118-
/**
119-
* Handle a returned message.
120-
* @param replyCode the reply code.
121-
* @param replyText the reply text.
122-
* @param exchange the exchange.
123-
* @param routingKey the routing key.
124-
* @param properties the message properties.
125-
* @param body the message body.
126-
* @deprecated in favor of {@link #handleReturn(Return)}.
127-
*/
128-
@Deprecated
129-
default void handleReturn(int replyCode,
130-
String replyText,
131-
String exchange,
132-
String routingKey,
133-
AMQP.BasicProperties properties,
134-
byte[] body) {
135-
136-
throw new UnsupportedOperationException(
137-
"This should never be called; please open a GitHub issue with a stack trace");
138-
}
139-
140117
/**
141118
* Handle a returned message.
142119
* @param returned the message and metadata.
143120
*/
144-
@SuppressWarnings("deprecation")
145-
default void handleReturn(Return returned) {
146-
handleReturn(returned.getReplyCode(), returned.getReplyText(), returned.getExchange(),
147-
returned.getRoutingKey(), returned.getProperties(), returned.getBody());
148-
}
121+
void handleReturn(Return returned);
149122

150123
/**
151124
* When called, this listener should remove all references to the

0 commit comments

Comments
 (0)