16
16
17
17
package org .springframework .amqp .core ;
18
18
19
- import java .nio .ByteBuffer ;
20
19
import java .util .Map ;
21
- import java .util .UUID ;
22
-
23
- import org .springframework .util .Assert ;
24
- import org .springframework .util .Base64Utils ;
25
20
26
21
/**
27
22
* Represents an anonymous, non-durable, exclusive, auto-delete queue. The name has the
@@ -50,32 +45,6 @@ public AnonymousQueue(Map<String, Object> arguments) {
50
45
this (org .springframework .amqp .core .Base64UrlNamingStrategy .DEFAULT , arguments );
51
46
}
52
47
53
- /**
54
- * Construct a queue with a name provided by the supplied naming strategy.
55
- * @param namingStrategy the naming strategy.
56
- * @deprecated in favor of {@link #AnonymousQueue(NamingStrategy)}.
57
- *
58
- * @since 1.5.3
59
- */
60
- @ Deprecated
61
- public AnonymousQueue (NamingStrategy namingStrategy ) {
62
- this (namingStrategy , null );
63
- }
64
-
65
- /**
66
- * Construct a queue with a name provided by the supplied naming strategy with the
67
- * supplied arguments.
68
- * @param namingStrategy the naming strategy.
69
- * @param arguments the arguments.
70
- * @deprecated in favor of {@link #AnonymousQueue(NamingStrategy, Map)}.
71
- *
72
- * @since 1.5.3
73
- */
74
- @ Deprecated
75
- public AnonymousQueue (NamingStrategy namingStrategy , Map <String , Object > arguments ) {
76
- super (namingStrategy .generateName (), false , true , true , arguments );
77
- }
78
-
79
48
/**
80
49
* Construct a queue with a name provided by the supplied naming strategy.
81
50
* @param namingStrategy the naming strategy.
@@ -99,87 +68,4 @@ public AnonymousQueue(org.springframework.amqp.core.NamingStrategy namingStrateg
99
68
}
100
69
}
101
70
102
- /**
103
- * A strategy to name anonymous queues.
104
- * @deprecated - use the {@link org.springframework.amqp.core.NamingStrategy}.
105
- * @since 1.5.3
106
- *
107
- */
108
- @ Deprecated
109
- @ FunctionalInterface
110
- public interface NamingStrategy extends org .springframework .amqp .core .NamingStrategy {
111
-
112
- }
113
-
114
- /**
115
- * Generates names with the form {@code <prefix><base64url>} where
116
- * 'prefix' is 'spring.gen-' by default
117
- * (e.g. spring.gen-eIwaZAYgQv6LvwaDCfVTNQ);
118
- * the 'base64url' String is generated from a UUID. The base64 alphabet
119
- * is the "URL and Filename Safe Alphabet"; see RFC-4648. Trailing padding
120
- * characters (@code =) are removed.
121
- * @deprecated - use the {@link org.springframework.amqp.core.Base64UrlNamingStrategy}.
122
- * @since 1.5.3
123
- */
124
- @ Deprecated
125
- public static class Base64UrlNamingStrategy implements NamingStrategy {
126
-
127
- /**
128
- * The default instance - using {@code spring.gen-} as the prefix.
129
- */
130
- public static final Base64UrlNamingStrategy DEFAULT = new Base64UrlNamingStrategy ();
131
-
132
- private final String prefix ;
133
-
134
- /**
135
- * Construct an instance using the default prefix {@code spring.gen-}.
136
- */
137
- public Base64UrlNamingStrategy () {
138
- this ("spring.gen-" );
139
- }
140
-
141
- /**
142
- * Construct an instance using the supplied prefix.
143
- * @param prefix The prefix.
144
- */
145
- public Base64UrlNamingStrategy (String prefix ) {
146
- Assert .notNull (prefix , "'prefix' cannot be null; use an empty String " );
147
- this .prefix = prefix ;
148
- }
149
-
150
- @ Override
151
- public String generateName () {
152
- UUID uuid = UUID .randomUUID ();
153
- ByteBuffer bb = ByteBuffer .wrap (new byte [16 ]); // NOSONAR - Magic # deprecated anyway
154
- bb .putLong (uuid .getMostSignificantBits ())
155
- .putLong (uuid .getLeastSignificantBits ());
156
- // Convert to base64 and remove trailing =
157
- return this .prefix + Base64Utils .encodeToUrlSafeString (bb .array ())
158
- .replaceAll ("=" , "" );
159
- }
160
-
161
- }
162
-
163
- /**
164
- * Generates names using {@link UUID#randomUUID()}.
165
- * (e.g. "f20c818a-006b-4416-bf91-643590fedb0e").
166
- * @author Gary Russell
167
- * @deprecated - use the {@link org.springframework.amqp.core.UUIDNamingStrategy}.
168
- * @since 2.0
169
- */
170
- @ Deprecated
171
- public static class UUIDNamingStrategy implements NamingStrategy {
172
-
173
- /**
174
- * The default instance.
175
- */
176
- public static final UUIDNamingStrategy DEFAULT = new UUIDNamingStrategy ();
177
-
178
- @ Override
179
- public String generateName () {
180
- return UUID .randomUUID ().toString ();
181
- }
182
-
183
- }
184
-
185
71
}
0 commit comments