ARTEMIS-4796 simplify SimpleString API
This commit does the following: - deprecate the verbosely named `toSimpleString` static factory methods - add `of` static factory methods for all the ctors - replace any uses of the normal ctors with the `of` counterparts This makes the code more concise and readable.
This commit is contained in:
parent
047bc98cc3
commit
7ca30e9a63
|
@ -225,7 +225,7 @@ public class XMLMessageImporter {
|
|||
message.putLongProperty(key, Long.parseLong(value));
|
||||
break;
|
||||
case XmlDataConstants.PROPERTY_TYPE_SIMPLE_STRING:
|
||||
message.putStringProperty(new SimpleString(key), value == null ? null : SimpleString.toSimpleString(value));
|
||||
message.putStringProperty(SimpleString.of(key), value == null ? null : SimpleString.of(value));
|
||||
break;
|
||||
case XmlDataConstants.PROPERTY_TYPE_STRING:
|
||||
message.putStringProperty(key, value);
|
||||
|
@ -270,7 +270,7 @@ public class XMLMessageImporter {
|
|||
* the processor, and reset the cdata for the next event(s)
|
||||
*/
|
||||
if (decodeTextMessage) {
|
||||
SimpleString text = new SimpleString(cdata.toString());
|
||||
SimpleString text = SimpleString.of(cdata.toString());
|
||||
ByteBuf byteBuf = ByteBufAllocator.DEFAULT.buffer(SimpleString.sizeofNullableString(text));
|
||||
SimpleString.writeNullableSimpleString(byteBuf, text);
|
||||
byte[] bytes = new byte[SimpleString.sizeofNullableString(text)];
|
||||
|
|
|
@ -357,7 +357,7 @@ public final class XmlDataImporter extends ConnectionConfigurationAbtract {
|
|||
}
|
||||
|
||||
message.putBytesProperty(Message.HDR_ROUTE_TO_IDS, buffer.array());
|
||||
producer.send(SimpleString.toSimpleString(destination), message);
|
||||
producer.send(SimpleString.of(destination), message);
|
||||
}
|
||||
|
||||
private void oldBinding() throws Exception {
|
||||
|
@ -416,14 +416,14 @@ public final class XmlDataImporter extends ConnectionConfigurationAbtract {
|
|||
}
|
||||
|
||||
|
||||
ClientSession.AddressQuery addressQuery = session.addressQuery(SimpleString.toSimpleString(address));
|
||||
ClientSession.AddressQuery addressQuery = session.addressQuery(SimpleString.of(address));
|
||||
|
||||
if (!addressQuery.isExists()) {
|
||||
session.createAddress(SimpleString.toSimpleString(address), routingType, true);
|
||||
session.createAddress(SimpleString.of(address), routingType, true);
|
||||
}
|
||||
|
||||
if (!filter.equals(FilterImpl.GENERIC_IGNORED_FILTER)) {
|
||||
ClientSession.QueueQuery queueQuery = session.queueQuery(new SimpleString(queueName));
|
||||
ClientSession.QueueQuery queueQuery = session.queueQuery(SimpleString.of(queueName));
|
||||
|
||||
if (!queueQuery.isExists()) {
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter));
|
||||
|
@ -463,7 +463,7 @@ public final class XmlDataImporter extends ConnectionConfigurationAbtract {
|
|||
}
|
||||
}
|
||||
|
||||
ClientSession.QueueQuery queueQuery = session.queueQuery(new SimpleString(queueName));
|
||||
ClientSession.QueueQuery queueQuery = session.queueQuery(SimpleString.of(queueName));
|
||||
|
||||
if (!queueQuery.isExists()) {
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(RoutingType.valueOf(routingType)).setFilterString(filter));
|
||||
|
@ -493,14 +493,14 @@ public final class XmlDataImporter extends ConnectionConfigurationAbtract {
|
|||
}
|
||||
}
|
||||
|
||||
ClientSession.AddressQuery addressQuery = session.addressQuery(new SimpleString(addressName));
|
||||
ClientSession.AddressQuery addressQuery = session.addressQuery(SimpleString.of(addressName));
|
||||
|
||||
if (!addressQuery.isExists()) {
|
||||
EnumSet<RoutingType> set = EnumSet.noneOf(RoutingType.class);
|
||||
for (String routingType : ListUtil.toList(routingTypes)) {
|
||||
set.add(RoutingType.valueOf(routingType));
|
||||
}
|
||||
session.createAddress(SimpleString.toSimpleString(addressName), set, false);
|
||||
session.createAddress(SimpleString.of(addressName), set, false);
|
||||
logger.debug("Binding address(name={}, routingTypes={})", addressName, routingTypes);
|
||||
} else {
|
||||
logger.debug("Binding {} already exists so won't re-bind.", addressName);
|
||||
|
|
|
@ -1399,14 +1399,14 @@ public class ArtemisTest extends CliTestBase {
|
|||
for (String str : queues.split(",")) {
|
||||
String[] seg = str.split(":");
|
||||
RoutingType routingType = RoutingType.valueOf((seg.length == 2 ? seg[1] : "anycast").toUpperCase());
|
||||
ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString(seg[0]));
|
||||
ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.of(seg[0]));
|
||||
assertTrue(queryResult.isExists(), "Couldn't find queue " + seg[0]);
|
||||
assertEquals(routingType, queryResult.getRoutingType());
|
||||
}
|
||||
for (String str : addresses.split(",")) {
|
||||
String[] seg = str.split(":");
|
||||
RoutingType routingType = RoutingType.valueOf((seg.length == 2 ? seg[1] : "multicast").toUpperCase());
|
||||
ClientSession.AddressQuery queryResult = coreSession.addressQuery(SimpleString.toSimpleString(seg[0]));
|
||||
ClientSession.AddressQuery queryResult = coreSession.addressQuery(SimpleString.of(seg[0]));
|
||||
assertTrue(queryResult.isExists(), "Couldn't find address " + str);
|
||||
assertTrue(routingType == RoutingType.ANYCAST ? queryResult.isSupportsAnycast() : queryResult.isSupportsMulticast());
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class ParameterisedAddress {
|
|||
|
||||
public static SimpleString toParameterisedAddress(SimpleString address, Map<String, String> parameters) {
|
||||
if (parameters != null && !parameters.isEmpty()) {
|
||||
return SimpleString.toSimpleString(toParameterisedAddress(address.toString(), parameters));
|
||||
return SimpleString.of(toParameterisedAddress(address.toString(), parameters));
|
||||
} else {
|
||||
return address;
|
||||
}
|
||||
|
@ -71,11 +71,11 @@ public class ParameterisedAddress {
|
|||
|
||||
@Deprecated
|
||||
public ParameterisedAddress(String address, QueueAttributes queueAttributes) {
|
||||
this(SimpleString.toSimpleString(address), queueAttributes.toQueueConfiguration());
|
||||
this(SimpleString.of(address), queueAttributes.toQueueConfiguration());
|
||||
}
|
||||
|
||||
public ParameterisedAddress(String address, QueueConfiguration queueConfiguration) {
|
||||
this(SimpleString.toSimpleString(address), queueConfiguration);
|
||||
this(SimpleString.of(address), queueConfiguration);
|
||||
}
|
||||
|
||||
public ParameterisedAddress(SimpleString address) {
|
||||
|
@ -85,10 +85,10 @@ public class ParameterisedAddress {
|
|||
public ParameterisedAddress(String address) {
|
||||
int index = address.indexOf('?');
|
||||
if (index == -1) {
|
||||
this.address = SimpleString.toSimpleString(address);
|
||||
this.address = SimpleString.of(address);
|
||||
this.queueConfiguration = null;
|
||||
} else {
|
||||
this.address = SimpleString.toSimpleString(address.substring(0, index));
|
||||
this.address = SimpleString.of(address.substring(0, index));
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(address);
|
||||
parseQuery(address).forEach(queueConfiguration::set);
|
||||
this.queueConfiguration = queueConfiguration;
|
||||
|
@ -108,7 +108,7 @@ public class ParameterisedAddress {
|
|||
}
|
||||
|
||||
public static SimpleString extractAddress(SimpleString address) {
|
||||
return SimpleString.toSimpleString(extractAddress(address.toString()));
|
||||
return SimpleString.of(extractAddress(address.toString()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -71,7 +71,7 @@ public class QueueAttributes implements Serializable {
|
|||
if (key.equals(ROUTING_TYPE)) {
|
||||
setRoutingType(RoutingType.valueOf(value.toUpperCase()));
|
||||
} else if (key.equals(FILTER_STRING)) {
|
||||
setFilterString(SimpleString.toSimpleString(value));
|
||||
setFilterString(SimpleString.of(value));
|
||||
} else if (key.equals(DURABLE)) {
|
||||
setDurable(Boolean.valueOf(value));
|
||||
} else if (key.equals(MAX_CONSUMERS)) {
|
||||
|
@ -81,7 +81,7 @@ public class QueueAttributes implements Serializable {
|
|||
} else if (key.equals(LAST_VALUE)) {
|
||||
setLastValue(Boolean.valueOf(value));
|
||||
} else if (key.equals(LAST_VALUE_KEY)) {
|
||||
setLastValueKey(SimpleString.toSimpleString(value));
|
||||
setLastValueKey(SimpleString.of(value));
|
||||
} else if (key.equals(NON_DESTRUCTIVE)) {
|
||||
setNonDestructive(Boolean.valueOf(value));
|
||||
} else if (key.equals(PURGE_ON_NO_CONSUMERS)) {
|
||||
|
@ -99,7 +99,7 @@ public class QueueAttributes implements Serializable {
|
|||
} else if (key.equals(GROUP_BUCKETS)) {
|
||||
setGroupBuckets(Integer.valueOf(value));
|
||||
} else if (key.equals(GROUP_FIRST_KEY)) {
|
||||
setGroupFirstKey(SimpleString.toSimpleString(value));
|
||||
setGroupFirstKey(SimpleString.of(value));
|
||||
} else if (key.equals(AUTO_DELETE)) {
|
||||
setAutoDelete(Boolean.valueOf(value));
|
||||
} else if (key.equals(AUTO_DELETE_DELAY)) {
|
||||
|
|
|
@ -168,7 +168,7 @@ public class QueueConfiguration implements Serializable {
|
|||
* @param name the name to use for the queue
|
||||
*/
|
||||
public QueueConfiguration(String name) {
|
||||
this(SimpleString.toSimpleString(name));
|
||||
this(SimpleString.of(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -227,7 +227,7 @@ public class QueueConfiguration implements Serializable {
|
|||
} else if (key.equals(DURABLE)) {
|
||||
setDurable(Boolean.valueOf(value));
|
||||
} else if (key.equals(USER)) {
|
||||
setUser(SimpleString.toSimpleString(value));
|
||||
setUser(SimpleString.of(value));
|
||||
} else if (key.equals(MAX_CONSUMERS)) {
|
||||
setMaxConsumers(Integer.valueOf(value));
|
||||
} else if (key.equals(EXCLUSIVE)) {
|
||||
|
@ -320,7 +320,7 @@ public class QueueConfiguration implements Serializable {
|
|||
* @see QueueConfiguration#setAddress(SimpleString)
|
||||
*/
|
||||
public QueueConfiguration setAddress(String address) {
|
||||
return setAddress(SimpleString.toSimpleString(address));
|
||||
return setAddress(SimpleString.of(address));
|
||||
}
|
||||
|
||||
public SimpleString getName() {
|
||||
|
@ -350,7 +350,7 @@ public class QueueConfiguration implements Serializable {
|
|||
* @see QueueConfiguration#setName(SimpleString)
|
||||
*/
|
||||
public QueueConfiguration setName(String name) {
|
||||
return setName(SimpleString.toSimpleString(name));
|
||||
return setName(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public RoutingType getRoutingType() {
|
||||
|
@ -372,7 +372,7 @@ public class QueueConfiguration implements Serializable {
|
|||
}
|
||||
|
||||
public QueueConfiguration setFilterString(String filterString) {
|
||||
return setFilterString(filterString == null ? null : SimpleString.toSimpleString(filterString));
|
||||
return setFilterString(filterString == null ? null : SimpleString.of(filterString));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -398,7 +398,7 @@ public class QueueConfiguration implements Serializable {
|
|||
}
|
||||
|
||||
public QueueConfiguration setUser(String user) {
|
||||
return setUser(SimpleString.toSimpleString(user));
|
||||
return setUser(SimpleString.of(user));
|
||||
}
|
||||
|
||||
public Integer getMaxConsumers() {
|
||||
|
@ -438,7 +438,7 @@ public class QueueConfiguration implements Serializable {
|
|||
}
|
||||
|
||||
public QueueConfiguration setLastValueKey(String lastValueKey) {
|
||||
return setLastValueKey(SimpleString.toSimpleString(lastValueKey));
|
||||
return setLastValueKey(SimpleString.of(lastValueKey));
|
||||
}
|
||||
|
||||
public Boolean isNonDestructive() {
|
||||
|
@ -533,7 +533,7 @@ public class QueueConfiguration implements Serializable {
|
|||
}
|
||||
|
||||
public QueueConfiguration setGroupFirstKey(String groupFirstKey) {
|
||||
return setGroupFirstKey(SimpleString.toSimpleString(groupFirstKey));
|
||||
return setGroupFirstKey(SimpleString.of(groupFirstKey));
|
||||
}
|
||||
|
||||
public Boolean isAutoDelete() {
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.activemq.artemis.utils.DataConstants;
|
|||
*/
|
||||
public final class SimpleString implements CharSequence, Serializable, Comparable<SimpleString> {
|
||||
|
||||
private static final SimpleString EMPTY = new SimpleString("");
|
||||
private static final SimpleString EMPTY = SimpleString.of("");
|
||||
private static final long serialVersionUID = 4204223851422244307L;
|
||||
|
||||
private final byte[] data;
|
||||
|
@ -56,26 +56,89 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
* @param string String used to instantiate a SimpleString.
|
||||
* @return A new SimpleString
|
||||
*/
|
||||
public static SimpleString toSimpleString(final String string) {
|
||||
public static SimpleString of(final String string) {
|
||||
if (string == null) {
|
||||
return null;
|
||||
}
|
||||
return new SimpleString(string);
|
||||
}
|
||||
|
||||
public static SimpleString toSimpleString(final String string, StringSimpleStringPool pool) {
|
||||
/**
|
||||
* Returns a SimpleString constructed from the {@code string} parameter.
|
||||
* <p>
|
||||
* If {@code string} is {@code null}, the return value will be {@code null} too.
|
||||
*
|
||||
* @param string String used to instantiate a SimpleString.
|
||||
* @param pool The pool from which to create the SimpleString
|
||||
* @return A new SimpleString
|
||||
*/
|
||||
public static SimpleString of(final String string, StringSimpleStringPool pool) {
|
||||
if (pool == null) {
|
||||
return toSimpleString(string);
|
||||
return of(string);
|
||||
}
|
||||
return pool.getOrCreate(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a SimpleString from a byte array
|
||||
*
|
||||
* @param data the byte array to use
|
||||
*/
|
||||
public static SimpleString of(final byte[] data) {
|
||||
return new SimpleString(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a SimpleString from a character
|
||||
*
|
||||
* @param c the char to use
|
||||
*/
|
||||
public static SimpleString of(final char c) {
|
||||
return new SimpleString(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a SimpleString constructed from the {@code string} parameter.
|
||||
* <p>
|
||||
* If {@code string} is {@code null}, the return value will be {@code null} too.
|
||||
*
|
||||
* @deprecated
|
||||
* Use {@link #of(String)} instead.
|
||||
*
|
||||
* @param string String used to instantiate a SimpleString.
|
||||
* @return A new SimpleString
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static SimpleString toSimpleString(final String string) {
|
||||
return of(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a SimpleString constructed from the {@code string} parameter.
|
||||
* <p>
|
||||
* If {@code string} is {@code null}, the return value will be {@code null} too.
|
||||
*
|
||||
* @deprecated
|
||||
* Use {@link #of(String, StringSimpleStringPool)} instead.
|
||||
*
|
||||
* @param string String used to instantiate a SimpleString.
|
||||
* @param pool The pool from which to create the SimpleString
|
||||
* @return A new SimpleString
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static SimpleString toSimpleString(final String string, StringSimpleStringPool pool) {
|
||||
return of(string, pool);
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a SimpleString from a conventional String
|
||||
*
|
||||
* @deprecated
|
||||
* Use {@link #of(String)} instead.
|
||||
*
|
||||
* @param string the string to transform
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public SimpleString(final String string) {
|
||||
int len = string.length();
|
||||
|
||||
|
@ -101,12 +164,25 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
/**
|
||||
* creates a SimpleString from a byte array
|
||||
*
|
||||
* @deprecated
|
||||
* Use {@link #of(byte[])} instead.
|
||||
*
|
||||
* @param data the byte array to use
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public SimpleString(final byte[] data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* creates a SimpleString from a character
|
||||
*
|
||||
* @deprecated
|
||||
* Use {@link #of(char)} instead.
|
||||
*
|
||||
* @param c the char to use
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public SimpleString(final char c) {
|
||||
data = new byte[2];
|
||||
|
||||
|
@ -180,7 +256,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
}
|
||||
byte[] data = new byte[length];
|
||||
buffer.readBytes(data);
|
||||
return new SimpleString(data);
|
||||
return SimpleString.of(data);
|
||||
}
|
||||
|
||||
public static void writeNullableSimpleString(ByteBuf buffer, SimpleString val) {
|
||||
|
@ -209,7 +285,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
|
||||
System.arraycopy(data, start << 1, bytes, 0, newlen);
|
||||
|
||||
return new SimpleString(bytes);
|
||||
return SimpleString.of(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -387,7 +463,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
// Note by Clebert
|
||||
all = new ArrayList<>(2);
|
||||
}
|
||||
all.add(new SimpleString(bytes));
|
||||
all.add(SimpleString.of(bytes));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -397,7 +473,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
// Adding the last one
|
||||
byte[] bytes = new byte[data.length - lasPos];
|
||||
System.arraycopy(data, lasPos, bytes, 0, bytes.length);
|
||||
all.add(new SimpleString(bytes));
|
||||
all.add(SimpleString.of(bytes));
|
||||
|
||||
// Converting it to arrays
|
||||
SimpleString[] parts = new SimpleString[all.size()];
|
||||
|
@ -445,7 +521,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
final int ssIndex = startIndex << 1;
|
||||
final int delIndex = endIndex << 1;
|
||||
final byte[] bytes = Arrays.copyOfRange(data, ssIndex, delIndex);
|
||||
ss = new SimpleString(bytes);
|
||||
ss = SimpleString.of(bytes);
|
||||
}
|
||||
// We will create the ArrayList lazily
|
||||
if (all == null) {
|
||||
|
@ -513,7 +589,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
bytes[offset] = (byte) (c & 0xFF);
|
||||
bytes[offset + 1] = (byte) (c >> 8 & 0xFF);
|
||||
}
|
||||
return new SimpleString(bytes);
|
||||
return SimpleString.of(bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -526,7 +602,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
byte[] bytes = new byte[data.length + toAdd.getData().length];
|
||||
System.arraycopy(data, 0, bytes, 0, data.length);
|
||||
System.arraycopy(toAdd.getData(), 0, bytes, data.length, toAdd.getData().length);
|
||||
return new SimpleString(bytes);
|
||||
return SimpleString.of(bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -540,7 +616,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
System.arraycopy(data, 0, bytes, 0, data.length);
|
||||
bytes[data.length] = (byte) (c & 0xFF);
|
||||
bytes[data.length + 1] = (byte) (c >> 8 & 0xFF);
|
||||
return new SimpleString(bytes);
|
||||
return SimpleString.of(bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -660,7 +736,7 @@ public final class SimpleString implements CharSequence, Serializable, Comparabl
|
|||
|
||||
@Override
|
||||
protected SimpleString create(String value) {
|
||||
return toSimpleString(value);
|
||||
return of(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,6 +72,6 @@ public class CoreMessageObjectPools {
|
|||
}
|
||||
|
||||
public static SimpleString cachedAddressSimpleString(String address, CoreMessageObjectPools coreMessageObjectPools) {
|
||||
return SimpleString.toSimpleString(address, coreMessageObjectPools == null ? null : coreMessageObjectPools.getAddressStringSimpleStringPool());
|
||||
return SimpleString.of(address, coreMessageObjectPools == null ? null : coreMessageObjectPools.getAddressStringSimpleStringPool());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ public class ByteUtil {
|
|||
}
|
||||
|
||||
public static String toSimpleString(byte[] bytes) {
|
||||
SimpleString simpleString = new SimpleString(bytes);
|
||||
SimpleString simpleString = SimpleString.of(bytes);
|
||||
String value = simpleString.toString();
|
||||
|
||||
for (char c : value.toCharArray()) {
|
||||
|
|
|
@ -23,7 +23,7 @@ public class CompositeAddress {
|
|||
public static final String SEPARATOR = "::";
|
||||
|
||||
public static String toFullyQualified(String address, String qName) {
|
||||
return toFullyQualified(SimpleString.toSimpleString(address), SimpleString.toSimpleString(qName)).toString();
|
||||
return toFullyQualified(SimpleString.of(address), SimpleString.of(qName)).toString();
|
||||
}
|
||||
|
||||
public static SimpleString toFullyQualified(SimpleString address, SimpleString qName) {
|
||||
|
@ -58,7 +58,7 @@ public class CompositeAddress {
|
|||
if (queueName.equals(nameString)) {
|
||||
return name;
|
||||
}
|
||||
return new SimpleString(queueName);
|
||||
return SimpleString.of(queueName);
|
||||
}
|
||||
|
||||
public static String extractQueueName(String queue) {
|
||||
|
@ -81,7 +81,7 @@ public class CompositeAddress {
|
|||
if (addressName.equals(addrString)) {
|
||||
return address;
|
||||
}
|
||||
return new SimpleString(addressName);
|
||||
return SimpleString.of(addressName);
|
||||
}
|
||||
|
||||
public static String extractAddressName(String address) {
|
||||
|
|
|
@ -68,7 +68,7 @@ public class DestinationUtil {
|
|||
escape(subscriptionName);
|
||||
}
|
||||
}
|
||||
return SimpleString.toSimpleString(queueName);
|
||||
return SimpleString.of(queueName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public class RandomUtil {
|
|||
}
|
||||
|
||||
public static SimpleString randomSimpleString() {
|
||||
return new SimpleString(RandomUtil.randomString());
|
||||
return SimpleString.of(RandomUtil.randomString());
|
||||
}
|
||||
|
||||
public static char randomChar() {
|
||||
|
|
|
@ -69,7 +69,7 @@ public final class UTF8Util {
|
|||
saveUTF(buffer, val);
|
||||
} else {
|
||||
// Store as SimpleString, since can't store utf > 0xffff in length
|
||||
SimpleString.writeSimpleString(buffer, new SimpleString(val));
|
||||
SimpleString.writeSimpleString(buffer, SimpleString.of(val));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ public final class UUIDGenerator {
|
|||
}
|
||||
|
||||
public SimpleString generateSimpleStringUUID() {
|
||||
return new SimpleString(generateStringUUID());
|
||||
return SimpleString.of(generateStringUUID());
|
||||
}
|
||||
|
||||
public UUID generateUUID() {
|
||||
|
|
|
@ -192,7 +192,7 @@ public class MetaBean<T> {
|
|||
} else if (type == String.class) {
|
||||
setter.accept(resultObject, json.getString(name));
|
||||
} else if (type == SimpleString.class) {
|
||||
setter.accept(resultObject, SimpleString.toSimpleString(json.getString(name)));
|
||||
setter.accept(resultObject, SimpleString.of(json.getString(name)));
|
||||
} else if (type == Integer.class) {
|
||||
setter.accept(resultObject, json.getInt(name));
|
||||
} else if (type == Long.class) {
|
||||
|
|
|
@ -297,21 +297,21 @@ public class TypedProperties {
|
|||
if (value instanceof SimpleString) {
|
||||
return (SimpleString) value;
|
||||
} else if (value instanceof Boolean) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
} else if (value instanceof Character) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
} else if (value instanceof Byte) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
} else if (value instanceof Short) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
} else if (value instanceof Integer) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
} else if (value instanceof Long) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
} else if (value instanceof Float) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
} else if (value instanceof Double) {
|
||||
return new SimpleString(value.toString());
|
||||
return SimpleString.of(value.toString());
|
||||
}
|
||||
throw new ActiveMQPropertyConversionException("Invalid conversion: " + key);
|
||||
}
|
||||
|
@ -1199,7 +1199,7 @@ public class TypedProperties {
|
|||
} else if (value instanceof Double) {
|
||||
properties.putDoubleProperty(key, (Double) value);
|
||||
} else if (value instanceof String) {
|
||||
properties.putSimpleStringProperty(key, new SimpleString((String) value));
|
||||
properties.putSimpleStringProperty(key, SimpleString.of((String) value));
|
||||
} else if (value instanceof SimpleString) {
|
||||
properties.putSimpleStringProperty(key, (SimpleString) value);
|
||||
} else if (value instanceof byte[]) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class TypedPropertiesConcurrencyTest {
|
|||
try {
|
||||
countDownLatch.await();
|
||||
for (int h = 0; h < 100; h++) {
|
||||
props.putSimpleStringProperty(SimpleString.toSimpleString("S" + h), SimpleString.toSimpleString("hello"));
|
||||
props.putSimpleStringProperty(SimpleString.of("S" + h), SimpleString.of("hello"));
|
||||
}
|
||||
props.clear();
|
||||
} catch (ConcurrentModificationException t) {
|
||||
|
@ -94,7 +94,7 @@ public class TypedPropertiesConcurrencyTest {
|
|||
try {
|
||||
countDownLatch.await();
|
||||
for (int h = 0; h < 100; h++) {
|
||||
props.putSimpleStringProperty(SimpleString.toSimpleString("S" + h), SimpleString.toSimpleString("hello"));
|
||||
props.putSimpleStringProperty(SimpleString.of("S" + h), SimpleString.of("hello"));
|
||||
}
|
||||
props.getPropertyNames().clear();
|
||||
} catch (UnsupportedOperationException uoe) {
|
||||
|
@ -133,7 +133,7 @@ public class TypedPropertiesConcurrencyTest {
|
|||
@Test
|
||||
public void testEncodedSizeAfterClearIsSameAsNewTypedProperties() throws Exception {
|
||||
TypedProperties props = new TypedProperties();
|
||||
props.putSimpleStringProperty(SimpleString.toSimpleString("helllllloooooo"), SimpleString.toSimpleString("raaaaaaaaaaaaaaaaaaaaaaaa"));
|
||||
props.putSimpleStringProperty(SimpleString.of("helllllloooooo"), SimpleString.of("raaaaaaaaaaaaaaaaaaaaaaaa"));
|
||||
|
||||
props.clear();
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class TypedPropertiesConcurrencyTest {
|
|||
@Test
|
||||
public void testMemoryOffsetAfterClearIsSameAsNewTypedProperties() throws Exception {
|
||||
TypedProperties props = new TypedProperties();
|
||||
props.putSimpleStringProperty(SimpleString.toSimpleString("helllllloooooo"), SimpleString.toSimpleString("raaaaaaaaaaaaaaaaaaaaaaaa"));
|
||||
props.putSimpleStringProperty(SimpleString.of("helllllloooooo"), SimpleString.of("raaaaaaaaaaaaaaaaaaaaaaaa"));
|
||||
|
||||
props.clear();
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TypedPropertiesConversionTest {
|
|||
|
||||
private SimpleString key;
|
||||
|
||||
private final SimpleString unknownKey = new SimpleString("this.key.is.never.used");
|
||||
private final SimpleString unknownKey = SimpleString.of("this.key.is.never.used");
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
|
@ -50,9 +50,9 @@ public class TypedPropertiesConversionTest {
|
|||
props.putBooleanProperty(key, val);
|
||||
|
||||
assertEquals(val, props.getBooleanProperty(key));
|
||||
assertEquals(new SimpleString(Boolean.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Boolean.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
props.putSimpleStringProperty(key, new SimpleString(Boolean.toString(val)));
|
||||
props.putSimpleStringProperty(key, SimpleString.of(Boolean.toString(val)));
|
||||
assertEquals(val, props.getBooleanProperty(key));
|
||||
|
||||
try {
|
||||
|
@ -71,7 +71,7 @@ public class TypedPropertiesConversionTest {
|
|||
props.putCharProperty(key, val);
|
||||
|
||||
assertEquals(val, props.getCharProperty(key));
|
||||
assertEquals(new SimpleString(Character.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Character.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
try {
|
||||
props.putByteProperty(key, RandomUtil.randomByte());
|
||||
|
@ -93,9 +93,9 @@ public class TypedPropertiesConversionTest {
|
|||
props.putByteProperty(key, val);
|
||||
|
||||
assertEquals(val, props.getByteProperty(key));
|
||||
assertEquals(new SimpleString(Byte.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Byte.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
props.putSimpleStringProperty(key, new SimpleString(Byte.toString(val)));
|
||||
props.putSimpleStringProperty(key, SimpleString.of(Byte.toString(val)));
|
||||
assertEquals(val, props.getByteProperty(key));
|
||||
|
||||
try {
|
||||
|
@ -130,9 +130,9 @@ public class TypedPropertiesConversionTest {
|
|||
props.putIntProperty(key, val);
|
||||
|
||||
assertEquals(val, props.getIntProperty(key));
|
||||
assertEquals(new SimpleString(Integer.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Integer.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
props.putSimpleStringProperty(key, new SimpleString(Integer.toString(val)));
|
||||
props.putSimpleStringProperty(key, SimpleString.of(Integer.toString(val)));
|
||||
assertEquals(val, props.getIntProperty(key));
|
||||
|
||||
Byte byteVal = RandomUtil.randomByte();
|
||||
|
@ -159,9 +159,9 @@ public class TypedPropertiesConversionTest {
|
|||
props.putLongProperty(key, val);
|
||||
|
||||
assertEquals(val, props.getLongProperty(key));
|
||||
assertEquals(new SimpleString(Long.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Long.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
props.putSimpleStringProperty(key, new SimpleString(Long.toString(val)));
|
||||
props.putSimpleStringProperty(key, SimpleString.of(Long.toString(val)));
|
||||
assertEquals(val, props.getLongProperty(key));
|
||||
|
||||
Byte byteVal = RandomUtil.randomByte();
|
||||
|
@ -196,9 +196,9 @@ public class TypedPropertiesConversionTest {
|
|||
props.putDoubleProperty(key, val);
|
||||
|
||||
assertEquals(val, props.getDoubleProperty(key));
|
||||
assertEquals(new SimpleString(Double.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Double.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
props.putSimpleStringProperty(key, new SimpleString(Double.toString(val)));
|
||||
props.putSimpleStringProperty(key, SimpleString.of(Double.toString(val)));
|
||||
assertEquals(val, props.getDoubleProperty(key));
|
||||
|
||||
try {
|
||||
|
@ -222,9 +222,9 @@ public class TypedPropertiesConversionTest {
|
|||
|
||||
assertEquals(val, props.getFloatProperty(key));
|
||||
assertEquals(Double.valueOf(val), props.getDoubleProperty(key));
|
||||
assertEquals(new SimpleString(Float.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Float.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
props.putSimpleStringProperty(key, new SimpleString(Float.toString(val)));
|
||||
props.putSimpleStringProperty(key, SimpleString.of(Float.toString(val)));
|
||||
assertEquals(val, props.getFloatProperty(key));
|
||||
|
||||
try {
|
||||
|
@ -248,9 +248,9 @@ public class TypedPropertiesConversionTest {
|
|||
|
||||
assertEquals(val, props.getShortProperty(key));
|
||||
assertEquals(Integer.valueOf(val), props.getIntProperty(key));
|
||||
assertEquals(new SimpleString(Short.toString(val)), props.getSimpleStringProperty(key));
|
||||
assertEquals(SimpleString.of(Short.toString(val)), props.getSimpleStringProperty(key));
|
||||
|
||||
props.putSimpleStringProperty(key, new SimpleString(Short.toString(val)));
|
||||
props.putSimpleStringProperty(key, SimpleString.of(Short.toString(val)));
|
||||
assertEquals(val, props.getShortProperty(key));
|
||||
|
||||
Byte byteVal = RandomUtil.randomByte();
|
||||
|
|
|
@ -238,7 +238,7 @@ public class TypedPropertiesTest {
|
|||
TypedPropertiesTest.assertEqualsTypeProperties(emptyProps, decodedProps);
|
||||
}
|
||||
|
||||
private static final SimpleString PROP_NAME = SimpleString.toSimpleString("TEST_PROP");
|
||||
private static final SimpleString PROP_NAME = SimpleString.of("TEST_PROP");
|
||||
|
||||
@Test
|
||||
public void testCannotClearInternalPropertiesIfEmpty() {
|
||||
|
@ -268,7 +268,7 @@ public class TypedPropertiesTest {
|
|||
ByteBuf buf = Unpooled.buffer(Byte.BYTES, Byte.BYTES);
|
||||
props.encode(buf);
|
||||
buf.resetReaderIndex();
|
||||
assertFalse(searchProperty(SimpleString.toSimpleString(""), buf, 0), "There is no property");
|
||||
assertFalse(searchProperty(SimpleString.of(""), buf, 0), "There is no property");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -294,7 +294,7 @@ public class TypedPropertiesTest {
|
|||
assertFalse(searchProperty(value, buf, 0));
|
||||
props.forEachKey(key -> {
|
||||
assertTrue(searchProperty(key, buf, 0));
|
||||
assertTrue(searchProperty(SimpleString.toSimpleString(key.toString()), buf, 0));
|
||||
assertTrue(searchProperty(SimpleString.of(key.toString()), buf, 0));
|
||||
// concat a string just to check if the search won't perform an eager search to find the string pattern
|
||||
assertFalse(searchProperty(key.concat(" "), buf, 0));
|
||||
});
|
||||
|
@ -308,7 +308,7 @@ public class TypedPropertiesTest {
|
|||
buf.writeByte(DataConstants.NOT_NULL);
|
||||
buf.writeInt(1);
|
||||
buf.resetReaderIndex();
|
||||
searchProperty(SimpleString.toSimpleString(" "), buf, 0);
|
||||
searchProperty(SimpleString.of(" "), buf, 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -322,7 +322,7 @@ public class TypedPropertiesTest {
|
|||
//SimpleString::data length
|
||||
buf.writeInt(2);
|
||||
buf.resetReaderIndex();
|
||||
searchProperty(SimpleString.toSimpleString("a"), buf, 0);
|
||||
searchProperty(SimpleString.of("a"), buf, 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ public class TypedPropertiesTest {
|
|||
// invalid type
|
||||
buf.writeByte(Byte.MIN_VALUE);
|
||||
buf.resetReaderIndex();
|
||||
searchProperty(SimpleString.toSimpleString(""), buf, 0);
|
||||
searchProperty(SimpleString.of(""), buf, 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,7 @@ public class TypedPropertiesTest {
|
|||
// invalid type
|
||||
buf.writeByte(Byte.MIN_VALUE);
|
||||
buf.resetReaderIndex();
|
||||
assertFalse(searchProperty(SimpleString.toSimpleString(""), buf, 0));
|
||||
assertFalse(searchProperty(SimpleString.of(""), buf, 0));
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
|
@ -369,10 +369,10 @@ public class TypedPropertiesTest {
|
|||
final int capacity = 8;
|
||||
final int chars = Integer.toString(capacity).length();
|
||||
final TypedProperties.StringValue.ByteBufStringValuePool pool = new TypedProperties.StringValue.ByteBufStringValuePool(capacity, chars);
|
||||
final int bytes = new SimpleString(Integer.toString(capacity)).sizeof();
|
||||
final int bytes = SimpleString.of(Integer.toString(capacity)).sizeof();
|
||||
final ByteBuf bb = Unpooled.buffer(bytes, bytes);
|
||||
for (int i = 0; i < capacity; i++) {
|
||||
final SimpleString s = new SimpleString(Integer.toString(i));
|
||||
final SimpleString s = SimpleString.of(Integer.toString(i));
|
||||
bb.resetWriterIndex();
|
||||
SimpleString.writeSimpleString(bb, s);
|
||||
bb.resetReaderIndex();
|
||||
|
@ -385,7 +385,7 @@ public class TypedPropertiesTest {
|
|||
|
||||
@Test
|
||||
public void testByteBufStringValuePoolTooLong() {
|
||||
final SimpleString tooLong = new SimpleString("aa");
|
||||
final SimpleString tooLong = SimpleString.of("aa");
|
||||
final ByteBuf bb = Unpooled.buffer(tooLong.sizeof(), tooLong.sizeof());
|
||||
SimpleString.writeSimpleString(bb, tooLong);
|
||||
final TypedProperties.StringValue.ByteBufStringValuePool pool = new TypedProperties.StringValue.ByteBufStringValuePool(1, tooLong.length() - 1);
|
||||
|
@ -414,7 +414,7 @@ public class TypedPropertiesTest {
|
|||
};
|
||||
t.start();
|
||||
for (int i = 0; !error.get() && (i < 100 || copies.get() < 50); i++) {
|
||||
properties.putIntProperty(SimpleString.toSimpleString("key" + i), i);
|
||||
properties.putIntProperty(SimpleString.of("key" + i), i);
|
||||
}
|
||||
|
||||
running.set(false);
|
||||
|
|
|
@ -46,7 +46,7 @@ public class MetaBeanTest {
|
|||
sourceObject.setC(RandomUtil.randomInt());
|
||||
sourceObject.setD(null);
|
||||
sourceObject.setIdCacheSize(333);
|
||||
sourceObject.setSimpleString(SimpleString.toSimpleString("mySimpleString"));
|
||||
sourceObject.setSimpleString(SimpleString.of("mySimpleString"));
|
||||
sourceObject.setFloatValue(33.33f);
|
||||
sourceObject.setDoubleValue(11.11);
|
||||
sourceObject.setBoolValue(true);
|
||||
|
@ -71,7 +71,7 @@ public class MetaBeanTest {
|
|||
assertEquals(MyEnum.TWO, result.getMyEnum());
|
||||
assertTrue(result.getBoolValue());
|
||||
|
||||
sourceObject.setGated(SimpleString.toSimpleString("gated-now-has-value"));
|
||||
sourceObject.setGated(SimpleString.of("gated-now-has-value"));
|
||||
jsonObject = MYClass.metaBean.toJSON(sourceObject, false);
|
||||
assertTrue(jsonObject.containsKey("gated"));
|
||||
assertEquals("gated-now-has-value", jsonObject.getString("gated"));
|
||||
|
|
|
@ -176,10 +176,10 @@ public final class ActiveMQDefaultConfiguration {
|
|||
|
||||
private static String DEFAULT_ADDRESS_PATH_SEPARATOR = ".";
|
||||
|
||||
private static SimpleString DEFAULT_MANAGEMENT_ADDRESS = new SimpleString("activemq.management");
|
||||
private static SimpleString DEFAULT_MANAGEMENT_ADDRESS = SimpleString.of("activemq.management");
|
||||
|
||||
// the name of the address that consumers bind to receive management notifications
|
||||
private static SimpleString DEFAULT_MANAGEMENT_NOTIFICATION_ADDRESS = new SimpleString("activemq.notifications");
|
||||
private static SimpleString DEFAULT_MANAGEMENT_NOTIFICATION_ADDRESS = SimpleString.of("activemq.notifications");
|
||||
|
||||
// The default address used for clustering, empty string means all addresses
|
||||
private static String DEFAULT_CLUSTER_ADDRESS = "";
|
||||
|
|
|
@ -25,57 +25,57 @@ public final class FilterConstants {
|
|||
/**
|
||||
* Name of the ActiveMQ Artemis UserID header.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_USERID = new SimpleString("AMQUserID");
|
||||
public static final SimpleString ACTIVEMQ_USERID = SimpleString.of("AMQUserID");
|
||||
|
||||
/**
|
||||
* Name of the ActiveMQ Artemis Message expiration header.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_EXPIRATION = new SimpleString("AMQExpiration");
|
||||
public static final SimpleString ACTIVEMQ_EXPIRATION = SimpleString.of("AMQExpiration");
|
||||
|
||||
/**
|
||||
* Name of the ActiveMQ Artemis Message durable header.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_DURABLE = new SimpleString("AMQDurable");
|
||||
public static final SimpleString ACTIVEMQ_DURABLE = SimpleString.of("AMQDurable");
|
||||
|
||||
/**
|
||||
* Value for the Durable header when the message is non-durable.
|
||||
*/
|
||||
public static final SimpleString NON_DURABLE = new SimpleString("NON_DURABLE");
|
||||
public static final SimpleString NON_DURABLE = SimpleString.of("NON_DURABLE");
|
||||
|
||||
/**
|
||||
* Value for the Durable header when the message is durable.
|
||||
*/
|
||||
public static final SimpleString DURABLE = new SimpleString("DURABLE");
|
||||
public static final SimpleString DURABLE = SimpleString.of("DURABLE");
|
||||
|
||||
/**
|
||||
* Name of the ActiveMQ Artemis Message timestamp header.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_TIMESTAMP = new SimpleString("AMQTimestamp");
|
||||
public static final SimpleString ACTIVEMQ_TIMESTAMP = SimpleString.of("AMQTimestamp");
|
||||
|
||||
/**
|
||||
* Name of the ActiveMQ Artemis Message priority header.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_PRIORITY = new SimpleString("AMQPriority");
|
||||
public static final SimpleString ACTIVEMQ_PRIORITY = SimpleString.of("AMQPriority");
|
||||
|
||||
/**
|
||||
* Name of the ActiveMQ Artemis Message size header.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_SIZE = new SimpleString("AMQSize");
|
||||
public static final SimpleString ACTIVEMQ_SIZE = SimpleString.of("AMQSize");
|
||||
|
||||
/**
|
||||
* Name of the ActiveMQ Artemis Address header
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_ADDRESS = new SimpleString("AMQAddress");
|
||||
public static final SimpleString ACTIVEMQ_ADDRESS = SimpleString.of("AMQAddress");
|
||||
|
||||
/**
|
||||
* Name of the ActiveMQ Artemis Message group id header.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_GROUP_ID = new SimpleString("AMQGroupID");
|
||||
public static final SimpleString ACTIVEMQ_GROUP_ID = SimpleString.of("AMQGroupID");
|
||||
|
||||
/**
|
||||
* All ActiveMQ Artemis headers are prepended by this prefix.
|
||||
*/
|
||||
public static final SimpleString ACTIVEMQ_PREFIX = new SimpleString("AMQ");
|
||||
public static final SimpleString ACTIVEMQ_PREFIX = SimpleString.of("AMQ");
|
||||
|
||||
/**
|
||||
* Proton protocol stores JMSMessageID as NATIVE_MESSAGE_ID
|
||||
|
|
|
@ -86,98 +86,98 @@ public interface Message {
|
|||
name -> (name.startsWith(Message.HDR_ROUTE_TO_IDS) && !name.equals(Message.HDR_ROUTE_TO_IDS)) ||
|
||||
(name.startsWith(Message.HDR_ROUTE_TO_ACK_IDS) && !name.equals(Message.HDR_ROUTE_TO_ACK_IDS));
|
||||
|
||||
SimpleString HDR_ROUTE_TO_IDS = new SimpleString("_AMQ_ROUTE_TO");
|
||||
SimpleString HDR_ROUTE_TO_IDS = SimpleString.of("_AMQ_ROUTE_TO");
|
||||
|
||||
SimpleString HDR_SCALEDOWN_TO_IDS = new SimpleString("_AMQ_SCALEDOWN_TO");
|
||||
SimpleString HDR_SCALEDOWN_TO_IDS = SimpleString.of("_AMQ_SCALEDOWN_TO");
|
||||
|
||||
SimpleString HDR_ROUTE_TO_ACK_IDS = new SimpleString("_AMQ_ACK_ROUTE_TO");
|
||||
SimpleString HDR_ROUTE_TO_ACK_IDS = SimpleString.of("_AMQ_ACK_ROUTE_TO");
|
||||
|
||||
// used by the bridges to set duplicates
|
||||
SimpleString HDR_BRIDGE_DUPLICATE_ID = new SimpleString("_AMQ_BRIDGE_DUP");
|
||||
SimpleString HDR_BRIDGE_DUPLICATE_ID = SimpleString.of("_AMQ_BRIDGE_DUP");
|
||||
|
||||
/**
|
||||
* the actual time the message was expired.
|
||||
* * *
|
||||
*/
|
||||
SimpleString HDR_ACTUAL_EXPIRY_TIME = new SimpleString("_AMQ_ACTUAL_EXPIRY");
|
||||
SimpleString HDR_ACTUAL_EXPIRY_TIME = SimpleString.of("_AMQ_ACTUAL_EXPIRY");
|
||||
|
||||
/**
|
||||
* The original address of a message when a message is diverted or transferred through DLQ or expiry
|
||||
*/
|
||||
SimpleString HDR_ORIGINAL_ADDRESS = new SimpleString("_AMQ_ORIG_ADDRESS");
|
||||
SimpleString HDR_ORIGINAL_ADDRESS = SimpleString.of("_AMQ_ORIG_ADDRESS");
|
||||
|
||||
/**
|
||||
* The original address of a message when a message is transferred through DLQ or expiry
|
||||
*/
|
||||
SimpleString HDR_ORIGINAL_QUEUE = new SimpleString("_AMQ_ORIG_QUEUE");
|
||||
SimpleString HDR_ORIGINAL_QUEUE = SimpleString.of("_AMQ_ORIG_QUEUE");
|
||||
|
||||
/**
|
||||
* The original message ID before the message was transferred.
|
||||
*/
|
||||
SimpleString HDR_ORIG_MESSAGE_ID = new SimpleString("_AMQ_ORIG_MESSAGE_ID");
|
||||
SimpleString HDR_ORIG_MESSAGE_ID = SimpleString.of("_AMQ_ORIG_MESSAGE_ID");
|
||||
|
||||
/**
|
||||
* For the Message Grouping feature.
|
||||
*/
|
||||
SimpleString HDR_GROUP_ID = new SimpleString("_AMQ_GROUP_ID");
|
||||
SimpleString HDR_GROUP_ID = SimpleString.of("_AMQ_GROUP_ID");
|
||||
|
||||
SimpleString HDR_GROUP_SEQUENCE = new SimpleString("_AMQ_GROUP_SEQUENCE");
|
||||
SimpleString HDR_GROUP_SEQUENCE = SimpleString.of("_AMQ_GROUP_SEQUENCE");
|
||||
|
||||
/**
|
||||
* to determine if the Large Message was compressed.
|
||||
*/
|
||||
SimpleString HDR_LARGE_COMPRESSED = new SimpleString("_AMQ_LARGE_COMPRESSED");
|
||||
SimpleString HDR_LARGE_COMPRESSED = SimpleString.of("_AMQ_LARGE_COMPRESSED");
|
||||
|
||||
/**
|
||||
* The body size of a large message before it was compressed.
|
||||
*/
|
||||
SimpleString HDR_LARGE_BODY_SIZE = new SimpleString("_AMQ_LARGE_SIZE");
|
||||
SimpleString HDR_LARGE_BODY_SIZE = SimpleString.of("_AMQ_LARGE_SIZE");
|
||||
|
||||
/**
|
||||
* To be used with Scheduled Delivery.
|
||||
*/
|
||||
SimpleString HDR_SCHEDULED_DELIVERY_TIME = new SimpleString("_AMQ_SCHED_DELIVERY");
|
||||
SimpleString HDR_SCHEDULED_DELIVERY_TIME = SimpleString.of("_AMQ_SCHED_DELIVERY");
|
||||
|
||||
/**
|
||||
* To be used with duplicate detection.
|
||||
*/
|
||||
SimpleString HDR_DUPLICATE_DETECTION_ID = new SimpleString("_AMQ_DUPL_ID");
|
||||
SimpleString HDR_DUPLICATE_DETECTION_ID = SimpleString.of("_AMQ_DUPL_ID");
|
||||
|
||||
/**
|
||||
* To be used with Last value queues.
|
||||
*/
|
||||
SimpleString HDR_LAST_VALUE_NAME = new SimpleString("_AMQ_LVQ_NAME");
|
||||
SimpleString HDR_LAST_VALUE_NAME = SimpleString.of("_AMQ_LVQ_NAME");
|
||||
|
||||
/**
|
||||
* To define the mime-type of body messages. Mainly for stomp but it could be informed on any message for user purposes.
|
||||
*/
|
||||
SimpleString HDR_CONTENT_TYPE = new SimpleString("_AMQ_CONTENT_TYPE");
|
||||
SimpleString HDR_CONTENT_TYPE = SimpleString.of("_AMQ_CONTENT_TYPE");
|
||||
|
||||
/**
|
||||
* The name of the validated user who sent the message. Useful for auditing.
|
||||
*/
|
||||
SimpleString HDR_VALIDATED_USER = new SimpleString("_AMQ_VALIDATED_USER");
|
||||
SimpleString HDR_VALIDATED_USER = SimpleString.of("_AMQ_VALIDATED_USER");
|
||||
|
||||
/**
|
||||
* The Routing Type for this message. Ensures that this message is only routed to queues with matching routing type.
|
||||
*/
|
||||
SimpleString HDR_ROUTING_TYPE = new SimpleString("_AMQ_ROUTING_TYPE");
|
||||
SimpleString HDR_ROUTING_TYPE = SimpleString.of("_AMQ_ROUTING_TYPE");
|
||||
|
||||
/**
|
||||
* The original routing type of a message before getting transferred through DLQ or expiry
|
||||
*/
|
||||
SimpleString HDR_ORIG_ROUTING_TYPE = new SimpleString("_AMQ_ORIG_ROUTING_TYPE");
|
||||
SimpleString HDR_ORIG_ROUTING_TYPE = SimpleString.of("_AMQ_ORIG_ROUTING_TYPE");
|
||||
|
||||
/**
|
||||
* The time at which the message arrived at the broker.
|
||||
*/
|
||||
SimpleString HDR_INGRESS_TIMESTAMP = new SimpleString("_AMQ_INGRESS_TIMESTAMP");
|
||||
SimpleString HDR_INGRESS_TIMESTAMP = SimpleString.of("_AMQ_INGRESS_TIMESTAMP");
|
||||
|
||||
/**
|
||||
* The prefix used (if any) when sending this message. For protocols (e.g. STOMP) that need to track this and restore
|
||||
* the prefix when the message is consumed.
|
||||
*/
|
||||
SimpleString HDR_PREFIX = new SimpleString("_AMQ_PREFIX");
|
||||
SimpleString HDR_PREFIX = SimpleString.of("_AMQ_PREFIX");
|
||||
|
||||
byte DEFAULT_TYPE = 0;
|
||||
|
||||
|
@ -501,7 +501,7 @@ public interface Message {
|
|||
if (duplicateID instanceof SimpleString) {
|
||||
return ((SimpleString) duplicateID).getData();
|
||||
} else if (duplicateID instanceof String) {
|
||||
return new SimpleString(duplicateID.toString()).getData();
|
||||
return SimpleString.of(duplicateID.toString()).getData();
|
||||
} else {
|
||||
return (byte[]) duplicateID;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public final class ClientRequestor implements AutoCloseable {
|
|||
queueSession = session;
|
||||
|
||||
requestProducer = queueSession.createProducer(requestAddress);
|
||||
replyQueue = new SimpleString(requestAddress + "." + UUID.randomUUID().toString());
|
||||
replyQueue = SimpleString.of(requestAddress + "." + UUID.randomUUID().toString());
|
||||
queueSession.createQueue(new QueueConfiguration(replyQueue).setDurable(false).setTemporary(true));
|
||||
replyConsumer = queueSession.createConsumer(replyQueue);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public final class ClientRequestor implements AutoCloseable {
|
|||
* @see ClientRequestor#ClientRequestor(ClientSession, SimpleString)
|
||||
*/
|
||||
public ClientRequestor(final ClientSession session, final String requestAddress) throws Exception {
|
||||
this(session, SimpleString.toSimpleString(requestAddress));
|
||||
this(session, SimpleString.of(requestAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,63 +36,63 @@ import org.apache.activemq.artemis.core.message.impl.CoreMessage;
|
|||
*/
|
||||
public final class ManagementHelper {
|
||||
|
||||
public static final SimpleString HDR_RESOURCE_NAME = new SimpleString("_AMQ_ResourceName");
|
||||
public static final SimpleString HDR_RESOURCE_NAME = SimpleString.of("_AMQ_ResourceName");
|
||||
|
||||
public static final SimpleString HDR_ATTRIBUTE = new SimpleString("_AMQ_Attribute");
|
||||
public static final SimpleString HDR_ATTRIBUTE = SimpleString.of("_AMQ_Attribute");
|
||||
|
||||
public static final SimpleString HDR_OPERATION_NAME = new SimpleString("_AMQ_OperationName");
|
||||
public static final SimpleString HDR_OPERATION_NAME = SimpleString.of("_AMQ_OperationName");
|
||||
|
||||
public static final SimpleString HDR_OPERATION_SUCCEEDED = new SimpleString("_AMQ_OperationSucceeded");
|
||||
public static final SimpleString HDR_OPERATION_SUCCEEDED = SimpleString.of("_AMQ_OperationSucceeded");
|
||||
|
||||
public static final SimpleString HDR_NOTIFICATION_TYPE = new SimpleString("_AMQ_NotifType");
|
||||
public static final SimpleString HDR_NOTIFICATION_TYPE = SimpleString.of("_AMQ_NotifType");
|
||||
|
||||
public static final SimpleString HDR_NOTIFICATION_TIMESTAMP = new SimpleString("_AMQ_NotifTimestamp");
|
||||
public static final SimpleString HDR_NOTIFICATION_TIMESTAMP = SimpleString.of("_AMQ_NotifTimestamp");
|
||||
|
||||
public static final SimpleString HDR_ROUTING_NAME = new SimpleString("_AMQ_RoutingName");
|
||||
public static final SimpleString HDR_ROUTING_NAME = SimpleString.of("_AMQ_RoutingName");
|
||||
|
||||
public static final SimpleString HDR_CLUSTER_NAME = new SimpleString("_AMQ_ClusterName");
|
||||
public static final SimpleString HDR_CLUSTER_NAME = SimpleString.of("_AMQ_ClusterName");
|
||||
|
||||
public static final SimpleString HDR_ADDRESS = new SimpleString("_AMQ_Address");
|
||||
public static final SimpleString HDR_ADDRESS = SimpleString.of("_AMQ_Address");
|
||||
|
||||
public static final SimpleString HDR_ROUTING_TYPE = new SimpleString("_AMQ_Routing_Type");
|
||||
public static final SimpleString HDR_ROUTING_TYPE = SimpleString.of("_AMQ_Routing_Type");
|
||||
|
||||
public static final SimpleString HDR_BINDING_ID = new SimpleString("_AMQ_Binding_ID");
|
||||
public static final SimpleString HDR_BINDING_ID = SimpleString.of("_AMQ_Binding_ID");
|
||||
|
||||
public static final SimpleString HDR_BINDING_TYPE = new SimpleString("_AMQ_Binding_Type");
|
||||
public static final SimpleString HDR_BINDING_TYPE = SimpleString.of("_AMQ_Binding_Type");
|
||||
|
||||
public static final SimpleString HDR_FILTERSTRING = new SimpleString("_AMQ_FilterString");
|
||||
public static final SimpleString HDR_FILTERSTRING = SimpleString.of("_AMQ_FilterString");
|
||||
|
||||
public static final SimpleString HDR_DISTANCE = new SimpleString("_AMQ_Distance");
|
||||
public static final SimpleString HDR_DISTANCE = SimpleString.of("_AMQ_Distance");
|
||||
|
||||
public static final SimpleString HDR_CONSUMER_COUNT = new SimpleString("_AMQ_ConsumerCount");
|
||||
public static final SimpleString HDR_CONSUMER_COUNT = SimpleString.of("_AMQ_ConsumerCount");
|
||||
|
||||
public static final SimpleString HDR_USER = new SimpleString("_AMQ_User");
|
||||
public static final SimpleString HDR_USER = SimpleString.of("_AMQ_User");
|
||||
|
||||
public static final SimpleString HDR_VALIDATED_USER = new SimpleString("_AMQ_ValidatedUser");
|
||||
public static final SimpleString HDR_VALIDATED_USER = SimpleString.of("_AMQ_ValidatedUser");
|
||||
|
||||
public static final SimpleString HDR_CERT_SUBJECT_DN = new SimpleString("_AMQ_CertSubjectDN");
|
||||
public static final SimpleString HDR_CERT_SUBJECT_DN = SimpleString.of("_AMQ_CertSubjectDN");
|
||||
|
||||
public static final SimpleString HDR_CHECK_TYPE = new SimpleString("_AMQ_CheckType");
|
||||
public static final SimpleString HDR_CHECK_TYPE = SimpleString.of("_AMQ_CheckType");
|
||||
|
||||
public static final SimpleString HDR_SESSION_NAME = new SimpleString("_AMQ_SessionName");
|
||||
public static final SimpleString HDR_SESSION_NAME = SimpleString.of("_AMQ_SessionName");
|
||||
|
||||
public static final SimpleString HDR_REMOTE_ADDRESS = new SimpleString("_AMQ_RemoteAddress");
|
||||
public static final SimpleString HDR_REMOTE_ADDRESS = SimpleString.of("_AMQ_RemoteAddress");
|
||||
|
||||
public static final SimpleString HDR_PROPOSAL_GROUP_ID = new SimpleString("_JBM_ProposalGroupId");
|
||||
public static final SimpleString HDR_PROPOSAL_GROUP_ID = SimpleString.of("_JBM_ProposalGroupId");
|
||||
|
||||
public static final SimpleString HDR_PROPOSAL_VALUE = new SimpleString("_JBM_ProposalValue");
|
||||
public static final SimpleString HDR_PROPOSAL_VALUE = SimpleString.of("_JBM_ProposalValue");
|
||||
|
||||
public static final SimpleString HDR_PROPOSAL_ALT_VALUE = new SimpleString("_JBM_ProposalAltValue");
|
||||
public static final SimpleString HDR_PROPOSAL_ALT_VALUE = SimpleString.of("_JBM_ProposalAltValue");
|
||||
|
||||
public static final SimpleString HDR_CONSUMER_NAME = new SimpleString("_AMQ_ConsumerName");
|
||||
public static final SimpleString HDR_CONSUMER_NAME = SimpleString.of("_AMQ_ConsumerName");
|
||||
|
||||
public static final SimpleString HDR_CONNECTION_NAME = new SimpleString("_AMQ_ConnectionName");
|
||||
public static final SimpleString HDR_CONNECTION_NAME = SimpleString.of("_AMQ_ConnectionName");
|
||||
|
||||
public static final SimpleString HDR_MESSAGE_ID = new SimpleString("_AMQ_Message_ID");
|
||||
public static final SimpleString HDR_MESSAGE_ID = SimpleString.of("_AMQ_Message_ID");
|
||||
|
||||
public static final SimpleString HDR_PROTOCOL_NAME = new SimpleString("_AMQ_Protocol_Name");
|
||||
public static final SimpleString HDR_PROTOCOL_NAME = SimpleString.of("_AMQ_Protocol_Name");
|
||||
|
||||
public static final SimpleString HDR_CLIENT_ID = new SimpleString("_AMQ_Client_ID");
|
||||
public static final SimpleString HDR_CLIENT_ID = SimpleString.of("_AMQ_Client_ID");
|
||||
|
||||
// Lambda declaration for management function. Pretty much same thing as java.util.function.Consumer but with an exception in the declaration that was needed.
|
||||
public interface MessageAcceptor {
|
||||
|
@ -142,8 +142,8 @@ public final class ManagementHelper {
|
|||
* @see ResourceNames
|
||||
*/
|
||||
public static void putAttribute(final ICoreMessage message, final String resourceName, final String attribute) {
|
||||
message.putStringProperty(ManagementHelper.HDR_RESOURCE_NAME, new SimpleString(resourceName));
|
||||
message.putStringProperty(ManagementHelper.HDR_ATTRIBUTE, new SimpleString(attribute));
|
||||
message.putStringProperty(ManagementHelper.HDR_RESOURCE_NAME, SimpleString.of(resourceName));
|
||||
message.putStringProperty(ManagementHelper.HDR_ATTRIBUTE, SimpleString.of(attribute));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -174,8 +174,8 @@ public final class ManagementHelper {
|
|||
final String operationName,
|
||||
final Object... parameters) throws Exception {
|
||||
// store the name of the operation in the headers
|
||||
message.putStringProperty(ManagementHelper.HDR_RESOURCE_NAME, new SimpleString(resourceName));
|
||||
message.putStringProperty(ManagementHelper.HDR_OPERATION_NAME, new SimpleString(operationName));
|
||||
message.putStringProperty(ManagementHelper.HDR_RESOURCE_NAME, SimpleString.of(resourceName));
|
||||
message.putStringProperty(ManagementHelper.HDR_OPERATION_NAME, SimpleString.of(operationName));
|
||||
|
||||
// and the params go in the body, since might be too large for header
|
||||
|
||||
|
@ -189,7 +189,7 @@ public final class ManagementHelper {
|
|||
paramString = null;
|
||||
}
|
||||
|
||||
message.getBodyBuffer().writeNullableSimpleString(SimpleString.toSimpleString(paramString));
|
||||
message.getBodyBuffer().writeNullableSimpleString(SimpleString.of(paramString));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -238,7 +238,7 @@ public final class ManagementHelper {
|
|||
resultString = null;
|
||||
}
|
||||
|
||||
message.getBodyBuffer().writeNullableSimpleString(SimpleString.toSimpleString(resultString));
|
||||
message.getBodyBuffer().writeNullableSimpleString(SimpleString.of(resultString));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,7 +61,7 @@ public final class ResourceNames {
|
|||
}
|
||||
|
||||
private static SimpleString getRetroactiveResourceName(String prefix, String delimiter, SimpleString address, String resourceType) {
|
||||
return SimpleString.toSimpleString(prefix.concat(address.toString()).concat(delimiter).concat(resourceType).concat(delimiter).concat(RETROACTIVE_SUFFIX));
|
||||
return SimpleString.of(prefix.concat(address.toString()).concat(delimiter).concat(resourceType).concat(delimiter).concat(RETROACTIVE_SUFFIX));
|
||||
}
|
||||
|
||||
public static boolean isRetroactiveResource(String prefix, SimpleString address) {
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal {
|
|||
|
||||
private static final int NUM_PRIORITIES = 10;
|
||||
|
||||
public static final SimpleString FORCED_DELIVERY_MESSAGE = new SimpleString("_hornetq.forced.delivery.seq");
|
||||
public static final SimpleString FORCED_DELIVERY_MESSAGE = SimpleString.of("_hornetq.forced.delivery.seq");
|
||||
|
||||
private final ClientSessionInternal session;
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ public class ClientProducerCreditManagerImpl implements ClientProducerCreditMana
|
|||
|
||||
@Override
|
||||
public SimpleString getAddress() {
|
||||
return SimpleString.toSimpleString("");
|
||||
return SimpleString.of("");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -131,7 +131,7 @@ public class ClientProducerImpl implements ClientProducerInternal {
|
|||
|
||||
@Override
|
||||
public void send(final String address1, final Message message) throws ActiveMQException {
|
||||
send(SimpleString.toSimpleString(address1), message);
|
||||
send(SimpleString.of(address1), message);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -276,7 +276,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
public void createQueue(final String address,
|
||||
final String queueName,
|
||||
final boolean durable) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), durable);
|
||||
createQueue(SimpleString.of(address), SimpleString.of(queueName), durable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -346,9 +346,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
final String queueName,
|
||||
final String filterString,
|
||||
final boolean durable) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address),
|
||||
SimpleString.toSimpleString(queueName),
|
||||
SimpleString.toSimpleString(filterString),
|
||||
createQueue(SimpleString.of(address),
|
||||
SimpleString.of(queueName),
|
||||
SimpleString.of(filterString),
|
||||
durable);
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
final String filterString,
|
||||
final boolean durable,
|
||||
final boolean autoCreated) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), durable, autoCreated);
|
||||
createQueue(SimpleString.of(address), SimpleString.of(queueName), SimpleString.of(filterString), durable, autoCreated);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -377,7 +377,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public void createTemporaryQueue(final String address, final String queueName) throws ActiveMQException {
|
||||
createTemporaryQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName));
|
||||
createTemporaryQueue(SimpleString.of(address), SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -391,7 +391,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
public void createTemporaryQueue(final String address,
|
||||
final String queueName,
|
||||
final String filter) throws ActiveMQException {
|
||||
createTemporaryQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filter));
|
||||
createTemporaryQueue(SimpleString.of(address), SimpleString.of(queueName), SimpleString.of(filter));
|
||||
}
|
||||
|
||||
|
||||
|
@ -421,10 +421,10 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
@Override
|
||||
public void createQueue(final String address, final RoutingType routingType, final String queueName, final String filterString,
|
||||
final boolean durable, final boolean autoCreated) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address),
|
||||
createQueue(SimpleString.of(address),
|
||||
routingType,
|
||||
SimpleString.toSimpleString(queueName),
|
||||
SimpleString.toSimpleString(filterString),
|
||||
SimpleString.of(queueName),
|
||||
SimpleString.of(filterString),
|
||||
durable,
|
||||
autoCreated);
|
||||
}
|
||||
|
@ -493,10 +493,10 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
@Override
|
||||
public void createQueue(final String address, final RoutingType routingType, final String queueName, final String filterString,
|
||||
final boolean durable, final boolean autoCreated, final int maxConsumers, final boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address),
|
||||
createQueue(SimpleString.of(address),
|
||||
routingType,
|
||||
SimpleString.toSimpleString(queueName),
|
||||
SimpleString.toSimpleString(filterString),
|
||||
SimpleString.of(queueName),
|
||||
SimpleString.of(filterString),
|
||||
durable,
|
||||
autoCreated,
|
||||
maxConsumers,
|
||||
|
@ -514,7 +514,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public void createTemporaryQueue(final String address, final RoutingType routingType, final String queueName) throws ActiveMQException {
|
||||
createTemporaryQueue(SimpleString.toSimpleString(address), routingType, SimpleString.toSimpleString(queueName));
|
||||
createTemporaryQueue(SimpleString.of(address), routingType, SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
@ -564,7 +564,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public void createTemporaryQueue(final String address, final RoutingType routingType, final String queueName, final String filter) throws ActiveMQException {
|
||||
createTemporaryQueue(SimpleString.toSimpleString(address), routingType, SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filter));
|
||||
createTemporaryQueue(SimpleString.of(address), routingType, SimpleString.of(queueName), SimpleString.of(filter));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -679,7 +679,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
*/
|
||||
@Override
|
||||
public void createQueue(String address, RoutingType routingType, String queueName, boolean durable) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address), routingType, SimpleString.toSimpleString(queueName), durable);
|
||||
createQueue(SimpleString.of(address), routingType, SimpleString.of(queueName), durable);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -693,8 +693,8 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
@Deprecated
|
||||
@Override
|
||||
public void createQueue(String address, RoutingType routingType, String queueName) throws ActiveMQException {
|
||||
internalCreateQueue(SimpleString.toSimpleString(address),
|
||||
SimpleString.toSimpleString(queueName),
|
||||
internalCreateQueue(SimpleString.of(address),
|
||||
SimpleString.of(queueName),
|
||||
false,
|
||||
false,
|
||||
new QueueAttributes()
|
||||
|
@ -766,7 +766,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
*/
|
||||
@Override
|
||||
public void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address), routingType, SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filter),
|
||||
createQueue(SimpleString.of(address), routingType, SimpleString.of(queueName), SimpleString.of(filter),
|
||||
durable);
|
||||
}
|
||||
|
||||
|
@ -785,7 +785,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public void deleteQueue(final String queueName) throws ActiveMQException {
|
||||
deleteQueue(SimpleString.toSimpleString(queueName));
|
||||
deleteQueue(SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -815,7 +815,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public ClientConsumer createConsumer(final String queueName) throws ActiveMQException {
|
||||
return createConsumer(SimpleString.toSimpleString(queueName));
|
||||
return createConsumer(SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -826,12 +826,12 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public void createQueue(final String address, final String queueName) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName));
|
||||
createQueue(SimpleString.of(address), SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientConsumer createConsumer(final String queueName, final String filterString) throws ActiveMQException {
|
||||
return createConsumer(SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString));
|
||||
return createConsumer(SimpleString.of(queueName), SimpleString.of(filterString));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -859,12 +859,12 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
public ClientConsumer createConsumer(final String queueName,
|
||||
final String filterString,
|
||||
final boolean browseOnly) throws ActiveMQException {
|
||||
return createConsumer(SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), browseOnly);
|
||||
return createConsumer(SimpleString.of(queueName), SimpleString.of(filterString), browseOnly);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientConsumer createConsumer(final String queueName, final boolean browseOnly) throws ActiveMQException {
|
||||
return createConsumer(SimpleString.toSimpleString(queueName), null, browseOnly);
|
||||
return createConsumer(SimpleString.of(queueName), null, browseOnly);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -907,7 +907,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
final int windowSize,
|
||||
final int maxRate,
|
||||
final boolean browseOnly) throws ActiveMQException {
|
||||
return createConsumer(SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), windowSize, maxRate, browseOnly);
|
||||
return createConsumer(SimpleString.of(queueName), SimpleString.of(filterString), windowSize, maxRate, browseOnly);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -922,7 +922,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public ClientProducer createProducer(final String address) throws ActiveMQException {
|
||||
return createProducer(SimpleString.toSimpleString(address));
|
||||
return createProducer(SimpleString.of(address));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -931,7 +931,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
}
|
||||
|
||||
public ClientProducer createProducer(final String address, final int rate) throws ActiveMQException {
|
||||
return createProducer(SimpleString.toSimpleString(address), rate);
|
||||
return createProducer(SimpleString.of(address), rate);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2040,7 +2040,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
maxRate == -1 ? null : new TokenBucketLimiterImpl(maxRate, false),
|
||||
autoCommitSends && blockOnNonDurableSend,
|
||||
autoCommitSends && blockOnDurableSend,
|
||||
autoGroup, groupID == null ? null : new SimpleString(groupID),
|
||||
autoGroup, groupID == null ? null : SimpleString.of(groupID),
|
||||
minLargeMessageSize,
|
||||
sessionContext,
|
||||
producerIDs.incrementAndGet());
|
||||
|
|
|
@ -631,7 +631,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
|
|||
int len = readInt();
|
||||
byte[] data = new byte[len];
|
||||
readBytes(data);
|
||||
return new SimpleString(data);
|
||||
return SimpleString.of(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1016,7 +1016,7 @@ public class LargeMessageControllerImpl implements LargeMessageController {
|
|||
int len = readInt();
|
||||
byte[] data = new byte[len];
|
||||
readBytes(data);
|
||||
return new SimpleString(data);
|
||||
return SimpleString.of(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -130,7 +130,7 @@ public final class DiscoveryGroup implements ActiveMQComponent {
|
|||
if (notificationService != null) {
|
||||
TypedProperties props = new TypedProperties();
|
||||
|
||||
props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
|
||||
props.putSimpleStringProperty(SimpleString.of("name"), SimpleString.of(name));
|
||||
|
||||
Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STARTED, props);
|
||||
|
||||
|
@ -191,7 +191,7 @@ public final class DiscoveryGroup implements ActiveMQComponent {
|
|||
|
||||
if (notificationService != null) {
|
||||
TypedProperties props = new TypedProperties();
|
||||
props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
|
||||
props.putSimpleStringProperty(SimpleString.of("name"), SimpleString.of(name));
|
||||
Notification notification = new Notification(nodeID, CoreNotificationType.DISCOVERY_GROUP_STOPPED, props);
|
||||
try {
|
||||
notificationService.sendNotification(notification);
|
||||
|
|
|
@ -313,7 +313,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
|
|||
|
||||
@Override
|
||||
public CoreMessage setGroupID(String groupId) {
|
||||
return this.setGroupID(SimpleString.toSimpleString(groupId, coreMessageObjectPools == null ? null : coreMessageObjectPools.getGroupIdStringSimpleStringPool()));
|
||||
return this.setGroupID(SimpleString.of(groupId, coreMessageObjectPools == null ? null : coreMessageObjectPools.getGroupIdStringSimpleStringPool()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -860,7 +860,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
|
|||
@Override
|
||||
public CoreMessage setAddress(String address) {
|
||||
messageChanged();
|
||||
this.address = SimpleString.toSimpleString(address, coreMessageObjectPools == null ? null : coreMessageObjectPools.getAddressStringSimpleStringPool());
|
||||
this.address = SimpleString.of(address, coreMessageObjectPools == null ? null : coreMessageObjectPools.getAddressStringSimpleStringPool());
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -1308,11 +1308,11 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
|
|||
}
|
||||
|
||||
private SimpleString key(String key) {
|
||||
return SimpleString.toSimpleString(key, getPropertyKeysPool());
|
||||
return SimpleString.of(key, getPropertyKeysPool());
|
||||
}
|
||||
|
||||
private SimpleString value(String value) {
|
||||
return SimpleString.toSimpleString(value, getPropertyValuesPool());
|
||||
return SimpleString.of(value, getPropertyValuesPool());
|
||||
}
|
||||
|
||||
private SimpleString.StringSimpleStringPool getPropertyKeysPool() {
|
||||
|
|
|
@ -53,10 +53,10 @@ public class PacketImpl implements Packet {
|
|||
// 2.29.0
|
||||
public static final int ARTEMIS_2_29_0_VERSION = 135;
|
||||
|
||||
public static final SimpleString OLD_QUEUE_PREFIX = new SimpleString("jms.queue.");
|
||||
public static final SimpleString OLD_TEMP_QUEUE_PREFIX = new SimpleString("jms.tempqueue.");
|
||||
public static final SimpleString OLD_TOPIC_PREFIX = new SimpleString("jms.topic.");
|
||||
public static final SimpleString OLD_TEMP_TOPIC_PREFIX = new SimpleString("jms.temptopic.");
|
||||
public static final SimpleString OLD_QUEUE_PREFIX = SimpleString.of("jms.queue.");
|
||||
public static final SimpleString OLD_TEMP_QUEUE_PREFIX = SimpleString.of("jms.tempqueue.");
|
||||
public static final SimpleString OLD_TOPIC_PREFIX = SimpleString.of("jms.topic.");
|
||||
public static final SimpleString OLD_TEMP_TOPIC_PREFIX = SimpleString.of("jms.temptopic.");
|
||||
|
||||
// The minimal size for all the packets, Common data for all the packets (look at
|
||||
// PacketImpl.encode)
|
||||
|
|
|
@ -288,7 +288,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
|
|||
Packet disconnect;
|
||||
|
||||
if (channel0.supports(PacketImpl.DISCONNECT_V3)) {
|
||||
disconnect = new DisconnectMessage_V3(nodeID, reason, SimpleString.toSimpleString(targetNodeID), targetConnector);
|
||||
disconnect = new DisconnectMessage_V3(nodeID, reason, SimpleString.of(targetNodeID), targetConnector);
|
||||
} else if (channel0.supports(PacketImpl.DISCONNECT_V2)) {
|
||||
disconnect = new DisconnectMessage_V2(nodeID, reason.isScaleDown() ? targetNodeID : null);
|
||||
} else {
|
||||
|
|
|
@ -28,7 +28,7 @@ public class DisconnectMessage_V2 extends DisconnectMessage {
|
|||
|
||||
this.nodeID = nodeID;
|
||||
|
||||
this.scaleDownNodeID = SimpleString.toSimpleString(scaleDownNodeID);
|
||||
this.scaleDownNodeID = SimpleString.of(scaleDownNodeID);
|
||||
}
|
||||
|
||||
public DisconnectMessage_V2() {
|
||||
|
|
|
@ -36,19 +36,19 @@ public class MessageUtil {
|
|||
|
||||
public static final String CORRELATIONID_HEADER_NAME_STRING = "JMSCorrelationID";
|
||||
|
||||
public static final SimpleString CORRELATIONID_HEADER_NAME = new SimpleString(CORRELATIONID_HEADER_NAME_STRING);
|
||||
public static final SimpleString CORRELATIONID_HEADER_NAME = SimpleString.of(CORRELATIONID_HEADER_NAME_STRING);
|
||||
|
||||
public static final SimpleString REPLYTO_HEADER_NAME = new SimpleString("JMSReplyTo");
|
||||
public static final SimpleString REPLYTO_HEADER_NAME = SimpleString.of("JMSReplyTo");
|
||||
|
||||
public static final String TYPE_HEADER_NAME_STRING = "JMSType";
|
||||
|
||||
public static final SimpleString TYPE_HEADER_NAME = new SimpleString(TYPE_HEADER_NAME_STRING);
|
||||
public static final SimpleString TYPE_HEADER_NAME = SimpleString.of(TYPE_HEADER_NAME_STRING);
|
||||
|
||||
public static final SimpleString JMS = new SimpleString("JMS");
|
||||
public static final SimpleString JMS = SimpleString.of("JMS");
|
||||
|
||||
public static final SimpleString JMSX = new SimpleString("JMSX");
|
||||
public static final SimpleString JMSX = SimpleString.of("JMSX");
|
||||
|
||||
public static final SimpleString JMS_ = new SimpleString("JMS_");
|
||||
public static final SimpleString JMS_ = SimpleString.of("JMS_");
|
||||
|
||||
public static final String JMSXDELIVERYCOUNT = "JMSXDeliveryCount";
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class MessageUtil {
|
|||
|
||||
public static final String CONNECTION_ID_PROPERTY_NAME_STRING = "__AMQ_CID";
|
||||
|
||||
public static final SimpleString CONNECTION_ID_PROPERTY_NAME = new SimpleString(CONNECTION_ID_PROPERTY_NAME_STRING);
|
||||
public static final SimpleString CONNECTION_ID_PROPERTY_NAME = SimpleString.of(CONNECTION_ID_PROPERTY_NAME_STRING);
|
||||
|
||||
// public static ActiveMQBuffer getBodyBuffer(Message message) {
|
||||
// return message.getBodyBuffer();
|
||||
|
@ -77,7 +77,7 @@ public class MessageUtil {
|
|||
}
|
||||
|
||||
public static void setJMSType(Message message, String type) {
|
||||
message.putStringProperty(TYPE_HEADER_NAME, new SimpleString(type));
|
||||
message.putStringProperty(TYPE_HEADER_NAME, SimpleString.of(type));
|
||||
}
|
||||
|
||||
public static String getJMSType(Message message) {
|
||||
|
@ -102,7 +102,7 @@ public class MessageUtil {
|
|||
if (correlationID == null) {
|
||||
message.removeProperty(CORRELATIONID_HEADER_NAME);
|
||||
} else {
|
||||
message.putStringProperty(CORRELATIONID_HEADER_NAME, new SimpleString(correlationID));
|
||||
message.putStringProperty(CORRELATIONID_HEADER_NAME, SimpleString.of(correlationID));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ public class MessageUtil {
|
|||
}
|
||||
|
||||
public static boolean propertyExists(Message message, String name) {
|
||||
return message.containsProperty(new SimpleString(name)) || name.equals(MessageUtil.JMSXDELIVERYCOUNT) ||
|
||||
return message.containsProperty(SimpleString.of(name)) || name.equals(MessageUtil.JMSXDELIVERYCOUNT) ||
|
||||
(MessageUtil.JMSXGROUPID.equals(name) && message.containsProperty(Message.HDR_GROUP_ID)) ||
|
||||
(MessageUtil.JMSXGROUPSEQ.equals(name) && message.containsProperty(Message.HDR_GROUP_SEQUENCE)) ||
|
||||
(MessageUtil.JMSXUSERID.equals(name) && message.containsProperty(Message.HDR_VALIDATED_USER));
|
||||
|
|
|
@ -45,7 +45,7 @@ public class BufferHelper {
|
|||
}
|
||||
|
||||
public static void writeAsNullableSimpleString(ActiveMQBuffer buffer, String str) {
|
||||
buffer.writeNullableSimpleString(SimpleString.toSimpleString(str));
|
||||
buffer.writeNullableSimpleString(SimpleString.of(str));
|
||||
}
|
||||
|
||||
public static String readNullableSimpleStringAsString(ActiveMQBuffer buffer) {
|
||||
|
@ -54,7 +54,7 @@ public class BufferHelper {
|
|||
}
|
||||
|
||||
public static void writeAsSimpleString(ActiveMQBuffer buffer, String str) {
|
||||
buffer.writeSimpleString(new SimpleString(str));
|
||||
buffer.writeSimpleString(SimpleString.of(str));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ResourceNamesTest {
|
|||
super();
|
||||
this.delimiterChar = delimiterChar;
|
||||
delimiter = "" + delimiterChar;
|
||||
testAddress = SimpleString.toSimpleString(UUID.randomUUID().toString());
|
||||
testAddress = SimpleString.of(UUID.randomUUID().toString());
|
||||
prefix = ActiveMQDefaultConfiguration.getInternalNamingPrefix().replace('.', delimiterChar);
|
||||
baseName = prefix + testAddress + delimiter;
|
||||
testResourceAddressName = baseName + ResourceNames.ADDRESS.replace('.', delimiterChar) + ResourceNames.RETROACTIVE_SUFFIX;
|
||||
|
@ -86,8 +86,8 @@ public class ResourceNamesTest {
|
|||
|
||||
@TestTemplate
|
||||
public void testIsRetroactiveResource() {
|
||||
assertTrue(ResourceNames.isRetroactiveResource(prefix, SimpleString.toSimpleString(testResourceAddressName)));
|
||||
assertTrue(ResourceNames.isRetroactiveResource(prefix, SimpleString.toSimpleString(testResourceMulticastQueueName)));
|
||||
assertTrue(ResourceNames.isRetroactiveResource(prefix, SimpleString.toSimpleString(testResourceDivertName)));
|
||||
assertTrue(ResourceNames.isRetroactiveResource(prefix, SimpleString.of(testResourceAddressName)));
|
||||
assertTrue(ResourceNames.isRetroactiveResource(prefix, SimpleString.of(testResourceMulticastQueueName)));
|
||||
assertTrue(ResourceNames.isRetroactiveResource(prefix, SimpleString.of(testResourceDivertName)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
public class CoreMTMessageTest {
|
||||
|
||||
public static final SimpleString ADDRESS = new SimpleString("this.local.address");
|
||||
public static final SimpleString ADDRESS2 = new SimpleString("some.other.address");
|
||||
public static final SimpleString ADDRESS = SimpleString.of("this.local.address");
|
||||
public static final SimpleString ADDRESS2 = SimpleString.of("some.other.address");
|
||||
public static final byte MESSAGE_TYPE = Message.TEXT_TYPE;
|
||||
public static final boolean DURABLE = true;
|
||||
public static final long EXPIRATION = 123L;
|
||||
|
@ -62,11 +62,11 @@ public class CoreMTMessageTest {
|
|||
UUID userID = UUIDGenerator.getInstance().generateUUID();
|
||||
String body = UUIDGenerator.getInstance().generateStringUUID();
|
||||
ClientMessageImpl message = new ClientMessageImpl(MESSAGE_TYPE, DURABLE, EXPIRATION, TIMESTAMP, PRIORITY, 10 * 1024, objectPools);
|
||||
TextMessageUtil.writeBodyText(message.getBodyBuffer(), SimpleString.toSimpleString(body));
|
||||
TextMessageUtil.writeBodyText(message.getBodyBuffer(), SimpleString.of(body));
|
||||
|
||||
message.setAddress(ADDRESS);
|
||||
message.setUserID(userID);
|
||||
message.getProperties().putSimpleStringProperty(SimpleString.toSimpleString("str-prop"), propValue);
|
||||
message.getProperties().putSimpleStringProperty(SimpleString.of("str-prop"), propValue);
|
||||
|
||||
ActiveMQBuffer buffer = ActiveMQBuffers.dynamicBuffer(10 * 1024);
|
||||
message.sendBuffer(buffer.byteBuf(), 0);
|
||||
|
@ -96,7 +96,7 @@ public class CoreMTMessageTest {
|
|||
recMessage.receiveBuffer(buffer.byteBuf());
|
||||
assertEquals(ADDRESS2, recMessage.getAddressSimpleString());
|
||||
assertEquals(33, recMessage.getMessageID());
|
||||
assertEquals(propValue, recMessage.getSimpleStringProperty(SimpleString.toSimpleString("str-prop")));
|
||||
assertEquals(propValue, recMessage.getSimpleStringProperty(SimpleString.of("str-prop")));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
errors.incrementAndGet();
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
public class CoreMessageTest {
|
||||
|
||||
public static final SimpleString ADDRESS = new SimpleString("this.local.address");
|
||||
public static final SimpleString ADDRESS = SimpleString.of("this.local.address");
|
||||
public static final byte MESSAGE_TYPE = Message.TEXT_TYPE;
|
||||
public static final boolean DURABLE = true;
|
||||
public static final long EXPIRATION = 123L;
|
||||
|
@ -57,8 +57,8 @@ public class CoreMessageTest {
|
|||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 1});
|
||||
public static final SimpleString PROP1_NAME = new SimpleString("t1");
|
||||
public static final SimpleString PROP1_VALUE = new SimpleString("value-t1");
|
||||
public static final SimpleString PROP1_NAME = SimpleString.of("t1");
|
||||
public static final SimpleString PROP1_VALUE = SimpleString.of("value-t1");
|
||||
|
||||
/**
|
||||
* This encode was generated by {@link #generate()}.
|
||||
|
@ -276,7 +276,7 @@ public class CoreMessageTest {
|
|||
legacyBuffer.resetWriterIndex();
|
||||
legacyBuffer.clear();
|
||||
|
||||
TextMessageUtil.writeBodyText(legacyBuffer, SimpleString.toSimpleString(newString));
|
||||
TextMessageUtil.writeBodyText(legacyBuffer, SimpleString.of(newString));
|
||||
|
||||
ByteBuf newbuffer = Unpooled.buffer(150000);
|
||||
|
||||
|
@ -400,7 +400,7 @@ public class CoreMessageTest {
|
|||
public String generate(String body) throws Exception {
|
||||
|
||||
ClientMessageImpl message = new ClientMessageImpl(MESSAGE_TYPE, DURABLE, EXPIRATION, TIMESTAMP, PRIORITY, 10 * 1024, null);
|
||||
TextMessageUtil.writeBodyText(message.getBodyBuffer(), SimpleString.toSimpleString(body));
|
||||
TextMessageUtil.writeBodyText(message.getBodyBuffer(), SimpleString.of(body));
|
||||
|
||||
message.setAddress(ADDRESS);
|
||||
message.setUserID(uuid);
|
||||
|
|
|
@ -213,11 +213,11 @@ public class ActiveMQDestination extends JNDIStorable implements Destination, Se
|
|||
}
|
||||
|
||||
public static SimpleString createQueueAddressFromName(final String name) {
|
||||
return new SimpleString(QUEUE_QUALIFIED_PREFIX + name);
|
||||
return SimpleString.of(QUEUE_QUALIFIED_PREFIX + name);
|
||||
}
|
||||
|
||||
public static SimpleString createTopicAddressFromName(final String name) {
|
||||
return new SimpleString(TOPIC_QUALIFIED_PREFIX + name);
|
||||
return SimpleString.of(TOPIC_QUALIFIED_PREFIX + name);
|
||||
}
|
||||
|
||||
public static ActiveMQQueue createQueue(final String address) {
|
||||
|
@ -320,7 +320,7 @@ public class ActiveMQDestination extends JNDIStorable implements Destination, Se
|
|||
protected ActiveMQDestination(final String address,
|
||||
final TYPE type,
|
||||
final ActiveMQSession session) {
|
||||
this(SimpleString.toSimpleString(address), type, session);
|
||||
this(SimpleString.of(address), type, session);
|
||||
}
|
||||
|
||||
protected ActiveMQDestination(final SimpleString address,
|
||||
|
@ -344,7 +344,7 @@ public class ActiveMQDestination extends JNDIStorable implements Destination, Se
|
|||
final String name,
|
||||
final TYPE type,
|
||||
final ActiveMQSession session) {
|
||||
this(SimpleString.toSimpleString(address), name, type, session);
|
||||
this(SimpleString.of(address), name, type, session);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
@ -360,7 +360,7 @@ public class ActiveMQDestination extends JNDIStorable implements Destination, Se
|
|||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
setSimpleAddress(SimpleString.toSimpleString(address));
|
||||
setSimpleAddress(SimpleString.of(address));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -390,7 +390,7 @@ public class ActiveMQDestination extends JNDIStorable implements Destination, Se
|
|||
}
|
||||
|
||||
public void setSimpleAddress(String address) {
|
||||
setSimpleAddress(new SimpleString(address));
|
||||
setSimpleAddress(SimpleString.of(address));
|
||||
}
|
||||
|
||||
public void delete() throws JMSException {
|
||||
|
|
|
@ -332,57 +332,57 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public JMSProducer setProperty(String name, boolean value) {
|
||||
checkName(name);
|
||||
properties.putBooleanProperty(new SimpleString(name), value);
|
||||
properties.putBooleanProperty(SimpleString.of(name), value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JMSProducer setProperty(String name, byte value) {
|
||||
checkName(name);
|
||||
properties.putByteProperty(new SimpleString(name), value);
|
||||
properties.putByteProperty(SimpleString.of(name), value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JMSProducer setProperty(String name, short value) {
|
||||
checkName(name);
|
||||
properties.putShortProperty(new SimpleString(name), value);
|
||||
properties.putShortProperty(SimpleString.of(name), value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JMSProducer setProperty(String name, int value) {
|
||||
checkName(name);
|
||||
properties.putIntProperty(new SimpleString(name), value);
|
||||
properties.putIntProperty(SimpleString.of(name), value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JMSProducer setProperty(String name, long value) {
|
||||
checkName(name);
|
||||
properties.putLongProperty(new SimpleString(name), value);
|
||||
properties.putLongProperty(SimpleString.of(name), value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JMSProducer setProperty(String name, float value) {
|
||||
checkName(name);
|
||||
properties.putFloatProperty(new SimpleString(name), value);
|
||||
properties.putFloatProperty(SimpleString.of(name), value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JMSProducer setProperty(String name, double value) {
|
||||
checkName(name);
|
||||
properties.putDoubleProperty(new SimpleString(name), value);
|
||||
properties.putDoubleProperty(SimpleString.of(name), value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JMSProducer setProperty(String name, String value) {
|
||||
checkName(name);
|
||||
SimpleString key = new SimpleString(name);
|
||||
properties.putSimpleStringProperty(key, new SimpleString(value));
|
||||
SimpleString key = SimpleString.of(name);
|
||||
properties.putSimpleStringProperty(key, SimpleString.of(value));
|
||||
stringPropertyNames.add(key);
|
||||
return this;
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
public JMSProducer setProperty(String name, Object value) {
|
||||
checkName(name);
|
||||
try {
|
||||
TypedProperties.setObjectProperty(new SimpleString(name), value, properties);
|
||||
TypedProperties.setObjectProperty(SimpleString.of(name), value, properties);
|
||||
} catch (ActiveMQPropertyConversionException amqe) {
|
||||
throw new MessageFormatRuntimeException(amqe.getMessage());
|
||||
} catch (RuntimeException e) {
|
||||
|
@ -413,13 +413,13 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
|
||||
@Override
|
||||
public boolean propertyExists(String name) {
|
||||
return properties.containsProperty(new SimpleString(name));
|
||||
return properties.containsProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getBooleanProperty(String name) {
|
||||
try {
|
||||
return properties.getBooleanProperty(new SimpleString(name));
|
||||
return properties.getBooleanProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException ce) {
|
||||
throw new MessageFormatRuntimeException(ce.getMessage());
|
||||
} catch (RuntimeException e) {
|
||||
|
@ -430,7 +430,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public byte getByteProperty(String name) {
|
||||
try {
|
||||
return properties.getByteProperty(new SimpleString(name));
|
||||
return properties.getByteProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException ce) {
|
||||
throw new MessageFormatRuntimeException(ce.getMessage());
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public short getShortProperty(String name) {
|
||||
try {
|
||||
return properties.getShortProperty(new SimpleString(name));
|
||||
return properties.getShortProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException ce) {
|
||||
throw new MessageFormatRuntimeException(ce.getMessage());
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public int getIntProperty(String name) {
|
||||
try {
|
||||
return properties.getIntProperty(new SimpleString(name));
|
||||
return properties.getIntProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException ce) {
|
||||
throw new MessageFormatRuntimeException(ce.getMessage());
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public long getLongProperty(String name) {
|
||||
try {
|
||||
return properties.getLongProperty(new SimpleString(name));
|
||||
return properties.getLongProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException ce) {
|
||||
throw new MessageFormatRuntimeException(ce.getMessage());
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public float getFloatProperty(String name) {
|
||||
try {
|
||||
return properties.getFloatProperty(new SimpleString(name));
|
||||
return properties.getFloatProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException ce) {
|
||||
throw new MessageFormatRuntimeException(ce.getMessage());
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public double getDoubleProperty(String name) {
|
||||
try {
|
||||
return properties.getDoubleProperty(new SimpleString(name));
|
||||
return properties.getDoubleProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException ce) {
|
||||
throw new MessageFormatRuntimeException(ce.getMessage());
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public String getStringProperty(String name) {
|
||||
try {
|
||||
SimpleString prop = properties.getSimpleStringProperty(new SimpleString(name));
|
||||
SimpleString prop = properties.getSimpleStringProperty(SimpleString.of(name));
|
||||
if (prop == null)
|
||||
return null;
|
||||
return prop.toString();
|
||||
|
@ -498,7 +498,7 @@ public final class ActiveMQJMSProducer implements JMSProducer {
|
|||
@Override
|
||||
public Object getObjectProperty(String name) {
|
||||
try {
|
||||
SimpleString key = new SimpleString(name);
|
||||
SimpleString key = SimpleString.of(name);
|
||||
Object property = properties.getProperty(key);
|
||||
if (stringPropertyNames.contains(key)) {
|
||||
property = property.toString();
|
||||
|
|
|
@ -95,70 +95,70 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public void setBoolean(final String name, final boolean value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putBooleanProperty(new SimpleString(name), value);
|
||||
map.putBooleanProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setByte(final String name, final byte value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putByteProperty(new SimpleString(name), value);
|
||||
map.putByteProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShort(final String name, final short value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putShortProperty(new SimpleString(name), value);
|
||||
map.putShortProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChar(final String name, final char value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putCharProperty(new SimpleString(name), value);
|
||||
map.putCharProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(final String name, final int value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putIntProperty(new SimpleString(name), value);
|
||||
map.putIntProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLong(final String name, final long value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putLongProperty(new SimpleString(name), value);
|
||||
map.putLongProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFloat(final String name, final float value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putFloatProperty(new SimpleString(name), value);
|
||||
map.putFloatProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(final String name, final double value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putDoubleProperty(new SimpleString(name), value);
|
||||
map.putDoubleProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setString(final String name, final String value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putSimpleStringProperty(new SimpleString(name), value == null ? null : new SimpleString(value));
|
||||
map.putSimpleStringProperty(SimpleString.of(name), value == null ? null : SimpleString.of(value));
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBytes(final String name, final byte[] value) throws JMSException {
|
||||
checkName(name);
|
||||
map.putBytesProperty(new SimpleString(name), value);
|
||||
map.putBytesProperty(SimpleString.of(name), value);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
}
|
||||
byte[] newBytes = new byte[length];
|
||||
System.arraycopy(value, offset, newBytes, 0, length);
|
||||
map.putBytesProperty(new SimpleString(name), newBytes);
|
||||
map.putBytesProperty(SimpleString.of(name), newBytes);
|
||||
invalid = true;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
public void setObject(final String name, final Object value) throws JMSException {
|
||||
checkName(name);
|
||||
try {
|
||||
TypedProperties.setObjectProperty(new SimpleString(name), value, map);
|
||||
TypedProperties.setObjectProperty(SimpleString.of(name), value, map);
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public boolean getBoolean(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getBooleanProperty(new SimpleString(name));
|
||||
return map.getBooleanProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public byte getByte(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getByteProperty(new SimpleString(name));
|
||||
return map.getByteProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public short getShort(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getShortProperty(new SimpleString(name));
|
||||
return map.getShortProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public char getChar(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getCharProperty(new SimpleString(name));
|
||||
return map.getCharProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public int getInt(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getIntProperty(new SimpleString(name));
|
||||
return map.getIntProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public long getLong(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getLongProperty(new SimpleString(name));
|
||||
return map.getLongProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public float getFloat(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getFloatProperty(new SimpleString(name));
|
||||
return map.getFloatProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public double getDouble(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getDoubleProperty(new SimpleString(name));
|
||||
return map.getDoubleProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public String getString(final String name) throws JMSException {
|
||||
try {
|
||||
SimpleString str = map.getSimpleStringProperty(new SimpleString(name));
|
||||
SimpleString str = map.getSimpleStringProperty(SimpleString.of(name));
|
||||
if (str == null) {
|
||||
return null;
|
||||
} else {
|
||||
|
@ -274,7 +274,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
@Override
|
||||
public byte[] getBytes(final String name) throws JMSException {
|
||||
try {
|
||||
return map.getBytesProperty(new SimpleString(name));
|
||||
return map.getBytesProperty(SimpleString.of(name));
|
||||
} catch (ActiveMQPropertyConversionException e) {
|
||||
throw new MessageFormatException(e.getMessage());
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
|
||||
@Override
|
||||
public Object getObject(final String name) throws JMSException {
|
||||
Object val = map.getProperty(new SimpleString(name));
|
||||
Object val = map.getProperty(SimpleString.of(name));
|
||||
|
||||
if (val instanceof SimpleString) {
|
||||
val = ((SimpleString) val).toString();
|
||||
|
@ -298,7 +298,7 @@ public class ActiveMQMapMessage extends ActiveMQMessage implements MapMessage {
|
|||
|
||||
@Override
|
||||
public boolean itemExists(final String name) throws JMSException {
|
||||
return map.containsProperty(new SimpleString(name));
|
||||
return map.containsProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,10 +66,10 @@ public class ActiveMQMessage implements javax.jms.Message {
|
|||
|
||||
public static final byte TYPE = org.apache.activemq.artemis.api.core.Message.DEFAULT_TYPE;
|
||||
|
||||
public static final SimpleString OLD_QUEUE_QUALIFIED_PREFIX = SimpleString.toSimpleString(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX + PacketImpl.OLD_QUEUE_PREFIX);
|
||||
public static final SimpleString OLD_TEMP_QUEUE_QUALIFED_PREFIX = SimpleString.toSimpleString(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX + PacketImpl.OLD_TEMP_QUEUE_PREFIX);
|
||||
public static final SimpleString OLD_TOPIC_QUALIFIED_PREFIX = SimpleString.toSimpleString(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX + PacketImpl.OLD_TOPIC_PREFIX);
|
||||
public static final SimpleString OLD_TEMP_TOPIC_QUALIFED_PREFIX = SimpleString.toSimpleString(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX + PacketImpl.OLD_TEMP_TOPIC_PREFIX);
|
||||
public static final SimpleString OLD_QUEUE_QUALIFIED_PREFIX = SimpleString.of(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX + PacketImpl.OLD_QUEUE_PREFIX);
|
||||
public static final SimpleString OLD_TEMP_QUEUE_QUALIFED_PREFIX = SimpleString.of(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX + PacketImpl.OLD_TEMP_QUEUE_PREFIX);
|
||||
public static final SimpleString OLD_TOPIC_QUALIFIED_PREFIX = SimpleString.of(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX + PacketImpl.OLD_TOPIC_PREFIX);
|
||||
public static final SimpleString OLD_TEMP_TOPIC_QUALIFED_PREFIX = SimpleString.of(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX + PacketImpl.OLD_TEMP_TOPIC_PREFIX);
|
||||
|
||||
public static Map<String, Object> coreMaptoJMSMap(final Map<String, Object> coreMessage) {
|
||||
Map<String, Object> jmsMessage = new HashMap<>();
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, To
|
|||
this.options = options;
|
||||
this.connection = connection;
|
||||
|
||||
connID = connection.getClientID() != null ? new SimpleString(connection.getClientID()) : connection.getUID();
|
||||
connID = connection.getClientID() != null ? SimpleString.of(connection.getClientID()) : connection.getUID();
|
||||
|
||||
this.clientProducer = producer;
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class ActiveMQQueueBrowser implements QueueBrowser {
|
|||
this.session = session;
|
||||
this.queue = queue;
|
||||
if (messageSelector != null) {
|
||||
filterString = new SimpleString(SelectorTranslator.convertToActiveMQFilterString(messageSelector));
|
||||
filterString = SimpleString.of(SelectorTranslator.convertToActiveMQFilterString(messageSelector));
|
||||
}
|
||||
this.enable1xPrefixes = enable1xPrefixes;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
|
||||
public static final int TYPE_TOPIC_SESSION = 2;
|
||||
|
||||
private static SimpleString REJECTING_FILTER = new SimpleString("_AMQX=-1");
|
||||
private static SimpleString REJECTING_FILTER = SimpleString.of("_AMQX=-1");
|
||||
|
||||
private final ConnectionFactoryOptions options;
|
||||
|
||||
|
@ -736,7 +736,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
SimpleString coreFilterString = null;
|
||||
|
||||
if (selectorString != null) {
|
||||
coreFilterString = new SimpleString(SelectorTranslator.convertToActiveMQFilterString(selectorString));
|
||||
coreFilterString = SimpleString.of(SelectorTranslator.convertToActiveMQFilterString(selectorString));
|
||||
}
|
||||
|
||||
ClientConsumer consumer;
|
||||
|
@ -810,7 +810,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
SimpleString coreFilterString = null;
|
||||
|
||||
if (selectorString != null) {
|
||||
coreFilterString = new SimpleString(SelectorTranslator.convertToActiveMQFilterString(selectorString));
|
||||
coreFilterString = SimpleString.of(SelectorTranslator.convertToActiveMQFilterString(selectorString));
|
||||
}
|
||||
|
||||
ClientConsumer consumer;
|
||||
|
@ -854,7 +854,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
if (CompositeAddress.isFullyQualified(dest.getAddress())) {
|
||||
queueName = createFQQNSubscription(dest, coreFilterString, response);
|
||||
} else {
|
||||
queueName = new SimpleString(UUID.randomUUID().toString());
|
||||
queueName = SimpleString.of(UUID.randomUUID().toString());
|
||||
createTemporaryQueue(dest, RoutingType.MULTICAST, queueName, coreFilterString, response);
|
||||
}
|
||||
|
||||
|
@ -996,7 +996,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
SelectorParser.parse(filterString.trim());
|
||||
}
|
||||
} catch (FilterException e) {
|
||||
throw JMSExceptionHelper.convertFromActiveMQException(ActiveMQJMSClientBundle.BUNDLE.invalidFilter(new SimpleString(filterString), e));
|
||||
throw JMSExceptionHelper.convertFromActiveMQException(ActiveMQJMSClientBundle.BUNDLE.invalidFilter(SimpleString.of(filterString), e));
|
||||
}
|
||||
|
||||
ActiveMQDestination activeMQDestination = (ActiveMQDestination) queue;
|
||||
|
@ -1006,7 +1006,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
}
|
||||
|
||||
try {
|
||||
AddressQuery response = session.addressQuery(new SimpleString(activeMQDestination.getAddress()));
|
||||
AddressQuery response = session.addressQuery(SimpleString.of(activeMQDestination.getAddress()));
|
||||
if (!response.isExists()) {
|
||||
if (response.isAutoCreateQueues()) {
|
||||
createQueue(activeMQDestination, RoutingType.ANYCAST, activeMQDestination.getSimpleAddress(), null, true, true, response);
|
||||
|
|
|
@ -73,7 +73,7 @@ public class ActiveMQTextMessage extends ActiveMQMessage implements TextMessage
|
|||
checkWrite();
|
||||
|
||||
if (text != null) {
|
||||
this.text = new SimpleString(text);
|
||||
this.text = SimpleString.of(text);
|
||||
} else {
|
||||
this.text = null;
|
||||
}
|
||||
|
|
|
@ -87,8 +87,8 @@ public class PersistedDestination implements EncodingSupport {
|
|||
@Override
|
||||
public void encode(final ActiveMQBuffer buffer) {
|
||||
buffer.writeByte(type.getType());
|
||||
buffer.writeSimpleString(SimpleString.toSimpleString(name));
|
||||
buffer.writeNullableSimpleString(SimpleString.toSimpleString(selector));
|
||||
buffer.writeSimpleString(SimpleString.of(name));
|
||||
buffer.writeNullableSimpleString(SimpleString.of(selector));
|
||||
buffer.writeBoolean(durable);
|
||||
}
|
||||
|
||||
|
|
|
@ -779,11 +779,11 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM
|
|||
public synchronized boolean destroyQueue(final String name, final boolean removeConsumers) throws Exception {
|
||||
checkInitialised();
|
||||
|
||||
server.destroyQueue(SimpleString.toSimpleString(name), null, !removeConsumers, removeConsumers);
|
||||
server.destroyQueue(SimpleString.of(name), null, !removeConsumers, removeConsumers);
|
||||
|
||||
// if the queue has consumers and 'removeConsumers' is false then the queue won't actually be removed
|
||||
// therefore only remove the queue from Bindings, etc. if the queue is actually removed
|
||||
if (this.server.getPostOffice().getBinding(SimpleString.toSimpleString(name)) == null) {
|
||||
if (this.server.getPostOffice().getBinding(SimpleString.of(name)) == null) {
|
||||
removeFromBindings(queues, queueBindings, name);
|
||||
|
||||
queues.remove(name);
|
||||
|
@ -809,7 +809,7 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM
|
|||
AddressControl addressControl = (AddressControl) server.getManagementService().getResource(ResourceNames.ADDRESS + name);
|
||||
if (addressControl != null) {
|
||||
for (String queueName : addressControl.getAllQueueNames()) {
|
||||
Binding binding = server.getPostOffice().getBinding(new SimpleString(queueName));
|
||||
Binding binding = server.getPostOffice().getBinding(SimpleString.of(queueName));
|
||||
if (binding == null) {
|
||||
ActiveMQJMSServerLogger.LOGGER.noQueueOnTopic(queueName, name);
|
||||
continue;
|
||||
|
@ -817,13 +817,13 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM
|
|||
|
||||
// We can't remove the remote binding. As this would be the bridge associated with the topic on this case
|
||||
if (binding.getType() != BindingType.REMOTE_QUEUE) {
|
||||
server.destroyQueue(SimpleString.toSimpleString(queueName), null, !removeConsumers, removeConsumers, false);
|
||||
server.destroyQueue(SimpleString.of(queueName), null, !removeConsumers, removeConsumers, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (addressControl.getAllQueueNames().length == 0) {
|
||||
try {
|
||||
server.removeAddressInfo(SimpleString.toSimpleString(name), null);
|
||||
server.removeAddressInfo(SimpleString.of(name), null);
|
||||
} catch (ActiveMQAddressDoesNotExistException e) {
|
||||
// ignore
|
||||
}
|
||||
|
@ -1030,7 +1030,7 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM
|
|||
|
||||
private void sendNotification(JMSNotificationType type, String message) {
|
||||
TypedProperties prop = new TypedProperties();
|
||||
prop.putSimpleStringProperty(JMSNotificationType.MESSAGE, SimpleString.toSimpleString(message));
|
||||
prop.putSimpleStringProperty(JMSNotificationType.MESSAGE, SimpleString.of(message));
|
||||
Notification notif = new Notification(null, type, prop);
|
||||
try {
|
||||
server.getManagementService().sendNotification(notif);
|
||||
|
@ -1080,7 +1080,7 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM
|
|||
coreFilterString = SelectorTranslator.convertToActiveMQFilterString(selectorString);
|
||||
}
|
||||
|
||||
server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queueName)).addRoutingType(RoutingType.ANYCAST));
|
||||
server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.of(queueName)).addRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
server.createQueue(new QueueConfiguration(queueName).setRoutingType(RoutingType.ANYCAST).setFilterString(coreFilterString).setDurable(durable), true);
|
||||
|
||||
|
@ -1114,7 +1114,7 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM
|
|||
} else {
|
||||
// Create the JMS topic with topicName as the logical name of the topic *and* address as its address
|
||||
ActiveMQTopic activeMQTopic = ActiveMQDestination.createTopic(address, topicName);
|
||||
server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(activeMQTopic.getAddress()), RoutingType.MULTICAST));
|
||||
server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.of(activeMQTopic.getAddress()), RoutingType.MULTICAST));
|
||||
|
||||
topics.put(address, activeMQTopic);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public enum JMSNotificationType implements NotificationType {
|
|||
CONNECTION_FACTORY_CREATED(4),
|
||||
CONNECTION_FACTORY_DESTROYED(5);
|
||||
|
||||
public static final SimpleString MESSAGE = new SimpleString("message");
|
||||
public static final SimpleString MESSAGE = SimpleString.of("message");
|
||||
|
||||
private int type;
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ActiveMQConsumerResource extends ExternalResource implements Active
|
|||
|
||||
public ActiveMQConsumerResource(String url, String queueName, String username, String password) {
|
||||
this.activeMQConsumer =
|
||||
new ActiveMQConsumerDelegate(url, SimpleString.toSimpleString(queueName), username, password);
|
||||
new ActiveMQConsumerDelegate(url, SimpleString.of(queueName), username, password);
|
||||
}
|
||||
|
||||
public ActiveMQConsumerResource(String url, SimpleString queueName, String username, String password) {
|
||||
|
@ -66,11 +66,11 @@ public class ActiveMQConsumerResource extends ExternalResource implements Active
|
|||
}
|
||||
|
||||
public ActiveMQConsumerResource(ServerLocator serverLocator, String queueName, String username, String password) {
|
||||
this(serverLocator, SimpleString.toSimpleString(queueName), username, password);
|
||||
this(serverLocator, SimpleString.of(queueName), username, password);
|
||||
}
|
||||
|
||||
public ActiveMQConsumerResource(ServerLocator serverLocator, String queueName) {
|
||||
this(serverLocator, SimpleString.toSimpleString(queueName), null, null);
|
||||
this(serverLocator, SimpleString.of(queueName), null, null);
|
||||
}
|
||||
|
||||
public ActiveMQConsumerResource(ServerLocator serverLocator, SimpleString queueName, String username,
|
||||
|
|
|
@ -67,7 +67,7 @@ public class ActiveMQProducerResource extends ExternalResource implements Active
|
|||
}
|
||||
|
||||
public ActiveMQProducerResource(String url, String address, String username, String password) {
|
||||
activeMQProducer = new ActiveMQProducerDelegate(url, SimpleString.toSimpleString(address), username, password);
|
||||
activeMQProducer = new ActiveMQProducerDelegate(url, SimpleString.of(address), username, password);
|
||||
}
|
||||
|
||||
public ActiveMQProducerResource(String url, String address) {
|
||||
|
@ -84,11 +84,11 @@ public class ActiveMQProducerResource extends ExternalResource implements Active
|
|||
|
||||
public ActiveMQProducerResource(ServerLocator serverLocator, String address, String username, String password) {
|
||||
activeMQProducer =
|
||||
new ActiveMQProducerDelegate(serverLocator, SimpleString.toSimpleString(address), username, password);
|
||||
new ActiveMQProducerDelegate(serverLocator, SimpleString.of(address), username, password);
|
||||
}
|
||||
|
||||
public ActiveMQProducerResource(ServerLocator serverLocator, String address) {
|
||||
activeMQProducer = new ActiveMQProducerDelegate(serverLocator, SimpleString.toSimpleString(address));
|
||||
activeMQProducer = new ActiveMQProducerDelegate(serverLocator, SimpleString.of(address));
|
||||
}
|
||||
|
||||
public ActiveMQProducerResource(ServerLocator serverLocator, SimpleString address, String username,
|
||||
|
|
|
@ -34,8 +34,8 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class ActiveMQConsumerResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_QUEUE = SimpleString.of("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = SimpleString.of("test.queue");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class ActiveMQDynamicProducerResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = new SimpleString("test.queue.two");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = SimpleString.of("test.queue.two");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.junit.rules.RuleChain;
|
|||
|
||||
public class ActiveMQDynamicProducerResourceWithoutAddressExceptionTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class ActiveMQDynamicProducerResourceWithoutAddressTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = new SimpleString("test.queue.two");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = SimpleString.of("test.queue.two");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class ActiveMQProducerResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_QUEUE = SimpleString.of("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = SimpleString.of("test.queue");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class EmbeddedActiveMQResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = new SimpleString("test.queueName");
|
||||
static final SimpleString TEST_QUEUE = SimpleString.of("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = SimpleString.of("test.queueName");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ import static org.junit.Assert.assertNotNull;
|
|||
|
||||
public class MultipleEmbeddedActiveMQResourcesTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = new SimpleString("test.queue.two");
|
||||
static final SimpleString TEST_ADDRESS_ONE = new SimpleString("test.address.one");
|
||||
static final SimpleString TEST_ADDRESS_TWO = new SimpleString("test.address.two");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = SimpleString.of("test.queue.two");
|
||||
static final SimpleString TEST_ADDRESS_ONE = SimpleString.of("test.address.one");
|
||||
static final SimpleString TEST_ADDRESS_TWO = SimpleString.of("test.address.two");
|
||||
|
||||
static final String TEST_BODY = "Test Message";
|
||||
|
||||
|
@ -48,8 +48,8 @@ public class MultipleEmbeddedActiveMQResourcesTest {
|
|||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
serverOne.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLA")).setExpiryAddress(SimpleString.toSimpleString("Expiry")));
|
||||
serverTwo.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLA")).setExpiryAddress(SimpleString.toSimpleString("Expiry")));
|
||||
serverOne.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLA")).setExpiryAddress(SimpleString.of("Expiry")));
|
||||
serverTwo.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLA")).setExpiryAddress(SimpleString.of("Expiry")));
|
||||
|
||||
serverOne.createQueue(TEST_ADDRESS_ONE, TEST_QUEUE_ONE);
|
||||
serverTwo.createQueue(TEST_ADDRESS_TWO, TEST_QUEUE_TWO);
|
||||
|
|
|
@ -44,8 +44,8 @@ public class MultipleEmbeddedJMSResourcesTest {
|
|||
|
||||
@Test
|
||||
public void testMultipleServers() throws Exception {
|
||||
jmsServerOne.getJmsServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLA")).setExpiryAddress(SimpleString.toSimpleString("Expiry")));
|
||||
jmsServerTwo.getJmsServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLA")).setExpiryAddress(SimpleString.toSimpleString("Expiry")));
|
||||
jmsServerOne.getJmsServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLA")).setExpiryAddress(SimpleString.of("Expiry")));
|
||||
jmsServerTwo.getJmsServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLA")).setExpiryAddress(SimpleString.of("Expiry")));
|
||||
|
||||
Message pushedOne = jmsServerOne.pushMessage(TEST_QUEUE_ONE, TEST_BODY);
|
||||
assertNotNull(String.format(ASSERT_PUSHED_FORMAT, TEST_QUEUE_ONE), pushedOne);
|
||||
|
|
|
@ -36,8 +36,8 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle;
|
|||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
public class ActiveMQConsumerResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_QUEUE = SimpleString.of("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = SimpleString.of("test.queue");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle;
|
|||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
public class ActiveMQDynamicProducerResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = new SimpleString("test.queue.two");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = SimpleString.of("test.queue.two");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle;
|
|||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
public class ActiveMQDynamicProducerResourceWithoutAddressExceptionTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle;
|
|||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
public class ActiveMQDynamicProducerResourceWithoutAddressTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = new SimpleString("test.queue.two");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = SimpleString.of("test.queue.two");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle;
|
|||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
public class ActiveMQProducerResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_QUEUE = SimpleString.of("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = SimpleString.of("test.queue");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle;
|
|||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
public class EmbeddedActiveMQResourceTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE = new SimpleString("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = new SimpleString("test.queueName");
|
||||
static final SimpleString TEST_QUEUE = SimpleString.of("test.queue");
|
||||
static final SimpleString TEST_ADDRESS = SimpleString.of("test.queueName");
|
||||
static final String TEST_BODY = "Test Message";
|
||||
static final Map<String, Object> TEST_PROPERTIES;
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@ import static org.junit.jupiter.api.TestInstance.Lifecycle;
|
|||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
public class MultipleEmbeddedActiveMQResourcesTest {
|
||||
|
||||
static final SimpleString TEST_QUEUE_ONE = new SimpleString("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = new SimpleString("test.queue.two");
|
||||
static final SimpleString TEST_ADDRESS_ONE = new SimpleString("test.address.one");
|
||||
static final SimpleString TEST_ADDRESS_TWO = new SimpleString("test.address.two");
|
||||
static final SimpleString TEST_QUEUE_ONE = SimpleString.of("test.queue.one");
|
||||
static final SimpleString TEST_QUEUE_TWO = SimpleString.of("test.queue.two");
|
||||
static final SimpleString TEST_ADDRESS_ONE = SimpleString.of("test.address.one");
|
||||
static final SimpleString TEST_ADDRESS_TWO = SimpleString.of("test.address.two");
|
||||
|
||||
static final String TEST_BODY = "Test Message";
|
||||
|
||||
|
@ -51,8 +51,8 @@ public class MultipleEmbeddedActiveMQResourcesTest {
|
|||
|
||||
@BeforeAll
|
||||
public void setUp() throws Exception {
|
||||
serverOne.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLA")).setExpiryAddress(SimpleString.toSimpleString("Expiry")));
|
||||
serverTwo.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLA")).setExpiryAddress(SimpleString.toSimpleString("Expiry")));
|
||||
serverOne.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLA")).setExpiryAddress(SimpleString.of("Expiry")));
|
||||
serverTwo.getServer().getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLA")).setExpiryAddress(SimpleString.of("Expiry")));
|
||||
|
||||
serverOne.createQueue(TEST_ADDRESS_ONE, TEST_QUEUE_ONE);
|
||||
serverTwo.createQueue(TEST_ADDRESS_TWO, TEST_QUEUE_TWO);
|
||||
|
|
|
@ -35,11 +35,11 @@ public class ActiveMQConsumerDelegate extends AbstractActiveMQClientDelegate imp
|
|||
ClientConsumer consumer;
|
||||
|
||||
public ActiveMQConsumerDelegate(String url, String queueName) {
|
||||
this(url, SimpleString.toSimpleString(queueName), null, null);
|
||||
this(url, SimpleString.of(queueName), null, null);
|
||||
}
|
||||
|
||||
public ActiveMQConsumerDelegate(String url, String queueName, String username, String password) {
|
||||
this(url, SimpleString.toSimpleString(queueName), username, password);
|
||||
this(url, SimpleString.of(queueName), username, password);
|
||||
}
|
||||
|
||||
public ActiveMQConsumerDelegate(String url, SimpleString queueName, String username, String password) {
|
||||
|
@ -52,11 +52,11 @@ public class ActiveMQConsumerDelegate extends AbstractActiveMQClientDelegate imp
|
|||
}
|
||||
|
||||
public ActiveMQConsumerDelegate(ServerLocator serverLocator, String queueName, String username, String password) {
|
||||
this(serverLocator, SimpleString.toSimpleString(queueName), username, password);
|
||||
this(serverLocator, SimpleString.of(queueName), username, password);
|
||||
}
|
||||
|
||||
public ActiveMQConsumerDelegate(ServerLocator serverLocator, String queueName) {
|
||||
this(serverLocator, SimpleString.toSimpleString(queueName), null, null);
|
||||
this(serverLocator, SimpleString.of(queueName), null, null);
|
||||
}
|
||||
|
||||
public ActiveMQConsumerDelegate(ServerLocator serverLocator, SimpleString queueName, String username,
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ActiveMQProducerDelegate extends AbstractActiveMQClientDelegate imp
|
|||
}
|
||||
|
||||
protected ActiveMQProducerDelegate(String url, String address, String username, String password) {
|
||||
this(url, SimpleString.toSimpleString(address), username, password);
|
||||
this(url, SimpleString.of(address), username, password);
|
||||
}
|
||||
|
||||
protected ActiveMQProducerDelegate(String url, String address) {
|
||||
|
@ -72,11 +72,11 @@ public class ActiveMQProducerDelegate extends AbstractActiveMQClientDelegate imp
|
|||
}
|
||||
|
||||
protected ActiveMQProducerDelegate(ServerLocator serverLocator, String address, String username, String password) {
|
||||
this(serverLocator, SimpleString.toSimpleString(address), username, password);
|
||||
this(serverLocator, SimpleString.of(address), username, password);
|
||||
}
|
||||
|
||||
protected ActiveMQProducerDelegate(ServerLocator serverLocator, String address) {
|
||||
this(serverLocator, SimpleString.toSimpleString(address));
|
||||
this(serverLocator, SimpleString.of(address));
|
||||
}
|
||||
|
||||
protected ActiveMQProducerDelegate(ServerLocator serverLocator, SimpleString address, String username,
|
||||
|
|
|
@ -75,8 +75,8 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
.setSecurityEnabled(false)
|
||||
.addAcceptorConfiguration(new TransportConfiguration(InVMAcceptorFactory.class.getName()))
|
||||
.addAddressSetting("#",
|
||||
new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("dla"))
|
||||
.setExpiryAddress(SimpleString.toSimpleString("expiry")));
|
||||
new AddressSettings().setDeadLetterAddress(SimpleString.of("dla"))
|
||||
.setExpiryAddress(SimpleString.of("expiry")));
|
||||
init();
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public long getMessageCount(String queueName) {
|
||||
return getMessageCount(SimpleString.toSimpleString(queueName));
|
||||
return getMessageCount(SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -253,7 +253,7 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public Queue locateQueue(String queueName) {
|
||||
return locateQueue(SimpleString.toSimpleString(queueName));
|
||||
return locateQueue(SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -263,7 +263,7 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public List<Queue> getBoundQueues(String address) {
|
||||
return getBoundQueues(SimpleString.toSimpleString(address));
|
||||
return getBoundQueues(SimpleString.of(address));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -290,12 +290,12 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public Queue createQueue(String name) {
|
||||
return createQueue(SimpleString.toSimpleString(name), SimpleString.toSimpleString(name));
|
||||
return createQueue(SimpleString.of(name), SimpleString.of(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Queue createQueue(String address, String name) {
|
||||
return createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(name));
|
||||
return createQueue(SimpleString.of(address), SimpleString.of(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -315,14 +315,14 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public void createSharedQueue(String name, String user) {
|
||||
createSharedQueue(SimpleString.toSimpleString(name), SimpleString.toSimpleString(name),
|
||||
SimpleString.toSimpleString(user));
|
||||
createSharedQueue(SimpleString.of(name), SimpleString.of(name),
|
||||
SimpleString.of(user));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createSharedQueue(String address, String name, String user) {
|
||||
createSharedQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(name),
|
||||
SimpleString.toSimpleString(user));
|
||||
createSharedQueue(SimpleString.of(address), SimpleString.of(name),
|
||||
SimpleString.of(user));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -401,32 +401,32 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public void sendMessage(String address, ClientMessage message) {
|
||||
sendMessage(SimpleString.toSimpleString(address), message);
|
||||
sendMessage(SimpleString.of(address), message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientMessage sendMessage(String address, byte[] body) {
|
||||
return sendMessage(SimpleString.toSimpleString(address), body);
|
||||
return sendMessage(SimpleString.of(address), body);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientMessage sendMessage(String address, String body) {
|
||||
return sendMessage(SimpleString.toSimpleString(address), body);
|
||||
return sendMessage(SimpleString.of(address), body);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientMessage sendMessageWithProperties(String address, Map<String, Object> properties) {
|
||||
return sendMessageWithProperties(SimpleString.toSimpleString(address), properties);
|
||||
return sendMessageWithProperties(SimpleString.of(address), properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientMessage sendMessageWithProperties(String address, byte[] body, Map<String, Object> properties) {
|
||||
return sendMessageWithProperties(SimpleString.toSimpleString(address), body, properties);
|
||||
return sendMessageWithProperties(SimpleString.of(address), body, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientMessage sendMessageWithProperties(String address, String body, Map<String, Object> properties) {
|
||||
return sendMessageWithProperties(SimpleString.toSimpleString(address), body, properties);
|
||||
return sendMessageWithProperties(SimpleString.of(address), body, properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -478,12 +478,12 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public ClientMessage receiveMessage(String queueName) {
|
||||
return receiveMessage(SimpleString.toSimpleString(queueName));
|
||||
return receiveMessage(SimpleString.of(queueName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientMessage receiveMessage(String queueName, long timeout) {
|
||||
return receiveMessage(SimpleString.toSimpleString(queueName), timeout);
|
||||
return receiveMessage(SimpleString.of(queueName), timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -500,12 +500,12 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
|
||||
@Override
|
||||
public ClientMessage browseMessage(String queueName) {
|
||||
return browseMessage(SimpleString.toSimpleString(queueName), defaultReceiveTimeout);
|
||||
return browseMessage(SimpleString.of(queueName), defaultReceiveTimeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientMessage browseMessage(String queueName, long timeout) {
|
||||
return browseMessage(SimpleString.toSimpleString(queueName), timeout);
|
||||
return browseMessage(SimpleString.of(queueName), timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -118,11 +118,11 @@ import static org.apache.activemq.artemis.protocol.amqp.converter.AMQPMessageSup
|
|||
*/
|
||||
public abstract class AMQPMessage extends RefCountMessage implements org.apache.activemq.artemis.api.core.Message {
|
||||
|
||||
private static final SimpleString ANNOTATION_AREA_PREFIX = SimpleString.toSimpleString("m.");
|
||||
private static final SimpleString ANNOTATION_AREA_PREFIX = SimpleString.of("m.");
|
||||
|
||||
protected static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
public static final SimpleString ADDRESS_PROPERTY = SimpleString.toSimpleString("_AMQ_AD");
|
||||
public static final SimpleString ADDRESS_PROPERTY = SimpleString.of("_AMQ_AD");
|
||||
// used to perform quick search
|
||||
private static final Symbol[] SCHEDULED_DELIVERY_SYMBOLS = new Symbol[]{
|
||||
AMQPMessageSupport.SCHEDULED_DELIVERY_TIME, AMQPMessageSupport.SCHEDULED_DELIVERY_DELAY};
|
||||
|
@ -1299,7 +1299,7 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
|
|||
@Override
|
||||
public final SimpleString getReplyTo() {
|
||||
if (properties != null) {
|
||||
return SimpleString.toSimpleString(properties.getReplyTo());
|
||||
return SimpleString.of(properties.getReplyTo());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -1353,8 +1353,8 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
|
|||
ensureMessageDataScanned();
|
||||
|
||||
if (properties != null && properties.getGroupId() != null) {
|
||||
return SimpleString.toSimpleString(properties.getGroupId(),
|
||||
coreMessageObjectPools == null ? null : coreMessageObjectPools.getGroupIdStringSimpleStringPool());
|
||||
return SimpleString.of(properties.getGroupId(),
|
||||
coreMessageObjectPools == null ? null : coreMessageObjectPools.getGroupIdStringSimpleStringPool());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -1612,7 +1612,7 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
|
|||
public final Set<SimpleString> getPropertyNames() {
|
||||
HashSet<SimpleString> values = new HashSet<>();
|
||||
for (Object k : getApplicationPropertiesMap(false).keySet()) {
|
||||
values.add(SimpleString.toSimpleString(k.toString(), getPropertyKeysPool()));
|
||||
values.add(SimpleString.of(k.toString(), getPropertyKeysPool()));
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
@ -1678,7 +1678,7 @@ public abstract class AMQPMessage extends RefCountMessage implements org.apache.
|
|||
}
|
||||
@Override
|
||||
public final SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException {
|
||||
return SimpleString.toSimpleString((String) getApplicationPropertiesMap(false).get(key), getPropertyValuesPool());
|
||||
return SimpleString.of((String) getApplicationPropertiesMap(false).get(key), getPropertyValuesPool());
|
||||
}
|
||||
|
||||
// Core Message Application Property update methods, calling these puts the message in a dirty
|
||||
|
|
|
@ -280,7 +280,7 @@ public class AMQPSessionCallback implements SessionCallback {
|
|||
boolean browserOnly,
|
||||
Number priority) throws Exception {
|
||||
final long consumerID = consumerIDGenerator.generateID();
|
||||
final SimpleString filterString = SimpleString.toSimpleString(SelectorTranslator.convertToActiveMQFilterString(filter));
|
||||
final SimpleString filterString = SimpleString.of(SelectorTranslator.convertToActiveMQFilterString(filter));
|
||||
final int consumerPriority = priority != null ? priority.intValue() : ActiveMQDefaultConfiguration.getDefaultConsumerPriority();
|
||||
final ServerConsumer consumer = serverSession.createConsumer(
|
||||
consumerID, queue, filterString, consumerPriority, browserOnly, false, null);
|
||||
|
|
|
@ -335,14 +335,14 @@ public class ProtonProtocolManager extends AbstractProtocolManager<AMQPMessage,
|
|||
@Override
|
||||
public void setAnycastPrefix(String anycastPrefix) {
|
||||
for (String prefix : anycastPrefix.split(",")) {
|
||||
prefixes.put(SimpleString.toSimpleString(prefix), RoutingType.ANYCAST);
|
||||
prefixes.put(SimpleString.of(prefix), RoutingType.ANYCAST);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMulticastPrefix(String multicastPrefix) {
|
||||
for (String prefix : multicastPrefix.split(",")) {
|
||||
prefixes.put(SimpleString.toSimpleString(prefix), RoutingType.MULTICAST);
|
||||
prefixes.put(SimpleString.of(prefix), RoutingType.MULTICAST);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener,
|
|||
SimpleString getMirrorSNF(AMQPMirrorBrokerConnectionElement mirrorElement) {
|
||||
SimpleString snf = mirrorElement.getMirrorSNF();
|
||||
if (snf == null) {
|
||||
snf = SimpleString.toSimpleString(ProtonProtocolManager.getMirrorAddress(this.brokerConnectConfiguration.getName()));
|
||||
snf = SimpleString.of(ProtonProtocolManager.getMirrorAddress(this.brokerConnectConfiguration.getName()));
|
||||
mirrorElement.setMirrorSNF(snf);
|
||||
}
|
||||
return snf;
|
||||
|
|
|
@ -98,7 +98,7 @@ public class AMQPFederationAddressConsumer implements FederationConsumerInternal
|
|||
|
||||
// Redefined because AMQPMessage uses SimpleString in its annotations API for some reason.
|
||||
private static final SimpleString MESSAGE_HOPS_ANNOTATION =
|
||||
new SimpleString(AMQPFederationPolicySupport.MESSAGE_HOPS_ANNOTATION.toString());
|
||||
SimpleString.of(AMQPFederationPolicySupport.MESSAGE_HOPS_ANNOTATION.toString());
|
||||
|
||||
private static final Symbol[] DEFAULT_OUTCOMES = new Symbol[]{Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL,
|
||||
Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL};
|
||||
|
@ -431,7 +431,7 @@ public class AMQPFederationAddressConsumer implements FederationConsumerInternal
|
|||
AMQPFederatedAddressDeliveryReceiver(AMQPSessionContext session, FederationConsumerInfo consumerInfo, Receiver receiver) {
|
||||
super(session.getSessionSPI(), session.getAMQPConnectionContext(), session, receiver);
|
||||
|
||||
this.cachedAddress = SimpleString.toSimpleString(consumerInfo.getAddress());
|
||||
this.cachedAddress = SimpleString.of(consumerInfo.getAddress());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -484,7 +484,7 @@ public class AMQPFederationAddressConsumer implements FederationConsumerInternal
|
|||
throw new ActiveMQAMQPInternalErrorException("Remote should have sent an valid Target but we got: " + target);
|
||||
}
|
||||
|
||||
address = SimpleString.toSimpleString(target.getAddress());
|
||||
address = SimpleString.of(target.getAddress());
|
||||
defRoutingType = getRoutingType(target.getCapabilities(), address);
|
||||
|
||||
try {
|
||||
|
|
|
@ -78,7 +78,7 @@ public final class AMQPFederationAddressSenderController extends AMQPFederationB
|
|||
final Sender sender = senderContext.getSender();
|
||||
final Source source = (Source) sender.getRemoteSource();
|
||||
final String selector;
|
||||
final SimpleString queueName = SimpleString.toSimpleString(sender.getName());
|
||||
final SimpleString queueName = SimpleString.of(sender.getName());
|
||||
final Connection protonConnection = sender.getSession().getConnection();
|
||||
final org.apache.qpid.proton.engine.Record attachments = protonConnection.attachments();
|
||||
|
||||
|
@ -136,7 +136,7 @@ public final class AMQPFederationAddressSenderController extends AMQPFederationB
|
|||
selector = jmsSelector;
|
||||
}
|
||||
|
||||
final SimpleString address = SimpleString.toSimpleString(source.getAddress());
|
||||
final SimpleString address = SimpleString.of(source.getAddress());
|
||||
final AddressQueryResult addressQueryResult;
|
||||
|
||||
try {
|
||||
|
|
|
@ -125,12 +125,12 @@ public class AMQPFederationCommandDispatcher implements SenderController {
|
|||
controlAddress = federation.prefixControlLinkQueueName(sender.getRemoteTarget().getAddress());
|
||||
|
||||
try {
|
||||
session.createTemporaryQueue(SimpleString.toSimpleString(getControlLinkAddress()), RoutingType.ANYCAST, 1);
|
||||
session.createTemporaryQueue(SimpleString.of(getControlLinkAddress()), RoutingType.ANYCAST, 1);
|
||||
} catch (Exception e) {
|
||||
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorCreatingTemporaryQueue(e.getMessage());
|
||||
}
|
||||
|
||||
return (Consumer) session.createSender(senderContext, SimpleString.toSimpleString(getControlLinkAddress()), null, false);
|
||||
return (Consumer) session.createSender(senderContext, SimpleString.of(getControlLinkAddress()), null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,7 +138,7 @@ public class AMQPFederationCommandDispatcher implements SenderController {
|
|||
// Make a best effort to remove the temporary queue used for control commands on close.
|
||||
|
||||
try {
|
||||
session.removeTemporaryQueue(SimpleString.toSimpleString(getControlLinkAddress()));
|
||||
session.removeTemporaryQueue(SimpleString.of(getControlLinkAddress()));
|
||||
} catch (Exception e) {
|
||||
// Ignored as the temporary queue should be removed on connection termination.
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ public class AMQPFederationEventDispatcher implements SenderController, ActiveMQ
|
|||
}
|
||||
|
||||
try {
|
||||
session.createTemporaryQueue(SimpleString.toSimpleString(getEventsLinkAddress()), RoutingType.ANYCAST, 1);
|
||||
session.createTemporaryQueue(SimpleString.of(getEventsLinkAddress()), RoutingType.ANYCAST, 1);
|
||||
} catch (Exception e) {
|
||||
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorCreatingTemporaryQueue(e.getMessage());
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class AMQPFederationEventDispatcher implements SenderController, ActiveMQ
|
|||
|
||||
server.registerBrokerPlugin(this); // Start listening for bindings and consumer events.
|
||||
|
||||
return (Consumer) session.createSender(senderContext, SimpleString.toSimpleString(getEventsLinkAddress()), null, false);
|
||||
return (Consumer) session.createSender(senderContext, SimpleString.of(getEventsLinkAddress()), null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,7 +155,7 @@ public class AMQPFederationEventDispatcher implements SenderController, ActiveMQ
|
|||
server.unRegisterBrokerPlugin(this);
|
||||
|
||||
try {
|
||||
session.removeTemporaryQueue(SimpleString.toSimpleString(getEventsLinkAddress()));
|
||||
session.removeTemporaryQueue(SimpleString.of(getEventsLinkAddress()));
|
||||
} catch (Exception e) {
|
||||
// Ignored as the temporary queue should be removed on connection termination.
|
||||
}
|
||||
|
|
|
@ -413,7 +413,7 @@ public class AMQPFederationQueueConsumer implements FederationConsumerInternal {
|
|||
super(session.getSessionSPI(), session.getAMQPConnectionContext(), session, receiver);
|
||||
|
||||
this.localQueue = localQueue;
|
||||
this.cachedFqqn = SimpleString.toSimpleString(consumerInfo.getFqqn());
|
||||
this.cachedFqqn = SimpleString.of(consumerInfo.getFqqn());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -449,7 +449,7 @@ public class AMQPFederationQueueConsumer implements FederationConsumerInternal {
|
|||
throw new ActiveMQAMQPInternalErrorException("Remote should have sent an valid Target but we got: " + target);
|
||||
}
|
||||
|
||||
address = SimpleString.toSimpleString(target.getAddress());
|
||||
address = SimpleString.of(target.getAddress());
|
||||
defRoutingType = getRoutingType(target.getCapabilities(), address);
|
||||
|
||||
try {
|
||||
|
|
|
@ -97,11 +97,11 @@ public final class AMQPFederationQueueSenderController extends AMQPFederationBas
|
|||
final SimpleString targetQueue;
|
||||
|
||||
if (CompositeAddress.isFullyQualified(source.getAddress())) {
|
||||
targetAddress = SimpleString.toSimpleString(CompositeAddress.extractAddressName(source.getAddress()));
|
||||
targetQueue = SimpleString.toSimpleString(CompositeAddress.extractQueueName(source.getAddress()));
|
||||
targetAddress = SimpleString.of(CompositeAddress.extractAddressName(source.getAddress()));
|
||||
targetQueue = SimpleString.of(CompositeAddress.extractQueueName(source.getAddress()));
|
||||
} else {
|
||||
targetAddress = null;
|
||||
targetQueue = SimpleString.toSimpleString(source.getAddress());
|
||||
targetQueue = SimpleString.of(source.getAddress());
|
||||
}
|
||||
|
||||
final QueueQueryResult result = sessionSPI.queueQuery(targetQueue, routingType, false, null);
|
||||
|
|
|
@ -69,7 +69,7 @@ public class AMQPMirrorControllerSource extends BasicMirrorController<Sender> im
|
|||
public static final Symbol ADDRESS = Symbol.getSymbol("x-opt-amq-mr-adr");
|
||||
public static final Symbol QUEUE = Symbol.getSymbol("x-opt-amq-mr-qu");
|
||||
public static final Symbol BROKER_ID = Symbol.getSymbol("x-opt-amq-bkr-id");
|
||||
public static final SimpleString BROKER_ID_SIMPLE_STRING = SimpleString.toSimpleString(BROKER_ID.toString());
|
||||
public static final SimpleString BROKER_ID_SIMPLE_STRING = SimpleString.of(BROKER_ID.toString());
|
||||
|
||||
// Events:
|
||||
public static final Symbol ADD_ADDRESS = Symbol.getSymbol("addAddress");
|
||||
|
@ -90,8 +90,8 @@ public class AMQPMirrorControllerSource extends BasicMirrorController<Sender> im
|
|||
public static final Symbol MIRROR_CAPABILITY = Symbol.getSymbol("amq.mirror");
|
||||
public static final Symbol QPID_DISPATCH_WAYPOINT_CAPABILITY = Symbol.valueOf("qd.waypoint");
|
||||
|
||||
public static final SimpleString INTERNAL_ID_EXTRA_PROPERTY = SimpleString.toSimpleString(INTERNAL_ID.toString());
|
||||
public static final SimpleString INTERNAL_BROKER_ID_EXTRA_PROPERTY = SimpleString.toSimpleString(BROKER_ID.toString());
|
||||
public static final SimpleString INTERNAL_ID_EXTRA_PROPERTY = SimpleString.of(INTERNAL_ID.toString());
|
||||
public static final SimpleString INTERNAL_BROKER_ID_EXTRA_PROPERTY = SimpleString.of(BROKER_ID.toString());
|
||||
|
||||
private static final ThreadLocal<RoutingContext> mirrorControlRouting = ThreadLocal.withInitial(() -> new RoutingContextImpl(null));
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ public class AMQPMirrorControllerTarget extends ProtonAbstractReceiver implement
|
|||
String address = (String) AMQPMessageBrokerAccessor.getMessageAnnotationProperty(amqpMessage, ADDRESS);
|
||||
String queueName = (String) AMQPMessageBrokerAccessor.getMessageAnnotationProperty(amqpMessage, QUEUE);
|
||||
|
||||
deleteQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName));
|
||||
deleteQueue(SimpleString.of(address), SimpleString.of(queueName));
|
||||
} else if (eventType.equals(POST_ACK)) {
|
||||
String nodeID = (String) AMQPMessageBrokerAccessor.getMessageAnnotationProperty(amqpMessage, BROKER_ID);
|
||||
|
||||
|
@ -458,7 +458,7 @@ public class AMQPMirrorControllerTarget extends ProtonAbstractReceiver implement
|
|||
logger.trace("Setting up duplicate detection cache on {}, ServerID={} with {} elements, being the number of credits", ProtonProtocolManager.MIRROR_ADDRESS, internalMirrorID, connection.getAmqpCredits());
|
||||
|
||||
lruDuplicateIDKey = internalMirrorID;
|
||||
lruduplicateIDCache = server.getPostOffice().getDuplicateIDCache(SimpleString.toSimpleString(ProtonProtocolManager.MIRROR_ADDRESS + "_" + internalMirrorID), connection.getAmqpCredits());
|
||||
lruduplicateIDCache = server.getPostOffice().getDuplicateIDCache(SimpleString.of(ProtonProtocolManager.MIRROR_ADDRESS + "_" + internalMirrorID), connection.getAmqpCredits());
|
||||
duplicateIDCache = lruduplicateIDCache;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ public class MirrorAddressFilter {
|
|||
for (String part : parts) {
|
||||
if (!"".equals(part) && !"!".equals(part)) {
|
||||
if (part.startsWith("!")) {
|
||||
denyList.add(new SimpleString(part.substring(1)));
|
||||
denyList.add(SimpleString.of(part.substring(1)));
|
||||
} else {
|
||||
allowList.add(new SimpleString(part));
|
||||
allowList.add(SimpleString.of(part));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public final class AMQPMessageSupport {
|
|||
|
||||
public static final int MESSAGE_DEFAULT_PRIORITY = 4;
|
||||
|
||||
public static SimpleString HDR_ORIGINAL_ADDRESS_ANNOTATION = SimpleString.toSimpleString("x-opt-ORIG-ADDRESS");
|
||||
public static SimpleString HDR_ORIGINAL_ADDRESS_ANNOTATION = SimpleString.of("x-opt-ORIG-ADDRESS");
|
||||
|
||||
public static final String JMS_REPLY_TO_TYPE_MSG_ANNOTATION_SYMBOL_NAME = "x-opt-jms-reply-to";
|
||||
public static final String X_OPT_DELIVERY_TIME = "x-opt-delivery-time";
|
||||
|
|
|
@ -80,49 +80,49 @@ public final class CoreMapMessageWrapper extends CoreMessageWrapper {
|
|||
}
|
||||
|
||||
public void setBoolean(final String name, final boolean value) {
|
||||
map.putBooleanProperty(new SimpleString(name), value);
|
||||
map.putBooleanProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setByte(final String name, final byte value) {
|
||||
map.putByteProperty(new SimpleString(name), value);
|
||||
map.putByteProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setShort(final String name, final short value) {
|
||||
map.putShortProperty(new SimpleString(name), value);
|
||||
map.putShortProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setChar(final String name, final char value) {
|
||||
map.putCharProperty(new SimpleString(name), value);
|
||||
map.putCharProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setInt(final String name, final int value) {
|
||||
map.putIntProperty(new SimpleString(name), value);
|
||||
map.putIntProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setLong(final String name, final long value) {
|
||||
map.putLongProperty(new SimpleString(name), value);
|
||||
map.putLongProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setFloat(final String name, final float value) {
|
||||
map.putFloatProperty(new SimpleString(name), value);
|
||||
map.putFloatProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setDouble(final String name, final double value) {
|
||||
map.putDoubleProperty(new SimpleString(name), value);
|
||||
map.putDoubleProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setString(final String name, final String value) {
|
||||
map.putSimpleStringProperty(new SimpleString(name), SimpleString.toSimpleString(value));
|
||||
map.putSimpleStringProperty(SimpleString.of(name), SimpleString.of(value));
|
||||
}
|
||||
|
||||
public void setBytes(final String name, final byte[] value) {
|
||||
map.putBytesProperty(new SimpleString(name), value);
|
||||
map.putBytesProperty(SimpleString.of(name), value);
|
||||
}
|
||||
|
||||
public void setBytes(final String name, final byte[] value, final int offset, final int length) {
|
||||
byte[] newBytes = new byte[length];
|
||||
System.arraycopy(value, offset, newBytes, 0, length);
|
||||
map.putBytesProperty(new SimpleString(name), newBytes);
|
||||
map.putBytesProperty(SimpleString.of(name), newBytes);
|
||||
}
|
||||
|
||||
public void setObject(final String name, final Object value) throws ActiveMQPropertyConversionException {
|
||||
|
@ -137,43 +137,43 @@ public final class CoreMapMessageWrapper extends CoreMessageWrapper {
|
|||
} else if (value instanceof UnsignedLong) {
|
||||
val = ((UnsignedLong) value).longValue();
|
||||
}
|
||||
TypedProperties.setObjectProperty(new SimpleString(name), val, map);
|
||||
TypedProperties.setObjectProperty(SimpleString.of(name), val, map);
|
||||
}
|
||||
|
||||
public boolean getBoolean(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getBooleanProperty(new SimpleString(name));
|
||||
return map.getBooleanProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public byte getByte(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getByteProperty(new SimpleString(name));
|
||||
return map.getByteProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public short getShort(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getShortProperty(new SimpleString(name));
|
||||
return map.getShortProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public char getChar(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getCharProperty(new SimpleString(name));
|
||||
return map.getCharProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public int getInt(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getIntProperty(new SimpleString(name));
|
||||
return map.getIntProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public long getLong(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getLongProperty(new SimpleString(name));
|
||||
return map.getLongProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public float getFloat(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getFloatProperty(new SimpleString(name));
|
||||
return map.getFloatProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public double getDouble(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getDoubleProperty(new SimpleString(name));
|
||||
return map.getDoubleProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public String getString(final String name) throws ActiveMQPropertyConversionException {
|
||||
SimpleString str = map.getSimpleStringProperty(new SimpleString(name));
|
||||
SimpleString str = map.getSimpleStringProperty(SimpleString.of(name));
|
||||
if (str == null) {
|
||||
return null;
|
||||
} else {
|
||||
|
@ -182,11 +182,11 @@ public final class CoreMapMessageWrapper extends CoreMessageWrapper {
|
|||
}
|
||||
|
||||
public byte[] getBytes(final String name) throws ActiveMQPropertyConversionException {
|
||||
return map.getBytesProperty(new SimpleString(name));
|
||||
return map.getBytesProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
public Object getObject(final String name) {
|
||||
Object val = map.getProperty(new SimpleString(name));
|
||||
Object val = map.getProperty(SimpleString.of(name));
|
||||
|
||||
if (val instanceof SimpleString) {
|
||||
val = ((SimpleString) val).toString();
|
||||
|
@ -200,7 +200,7 @@ public final class CoreMapMessageWrapper extends CoreMessageWrapper {
|
|||
}
|
||||
|
||||
public boolean itemExists(final String name) {
|
||||
return map.containsProperty(new SimpleString(name));
|
||||
return map.containsProperty(SimpleString.of(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -187,14 +187,14 @@ public class CoreMessageWrapper {
|
|||
}
|
||||
|
||||
public final void setJMSReplyTo(String replyTo) {
|
||||
MessageUtil.setJMSReplyTo(message, SimpleString.toSimpleString(replyTo));
|
||||
MessageUtil.setJMSReplyTo(message, SimpleString.of(replyTo));
|
||||
}
|
||||
|
||||
public SimpleString getDestination() {
|
||||
if (message.getAddress() == null || message.getAddress().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return SimpleString.toSimpleString(AMQPMessageSupport.destination(message.getRoutingType(), message.getAddress()));
|
||||
return SimpleString.of(AMQPMessageSupport.destination(message.getRoutingType(), message.getAddress()));
|
||||
}
|
||||
|
||||
public final void setDestination(String destination) {
|
||||
|
|
|
@ -88,7 +88,7 @@ public class CoreTextMessageWrapper extends CoreMessageWrapper {
|
|||
|
||||
public void setText(final String text) {
|
||||
if (text != null) {
|
||||
this.text = new SimpleString(text);
|
||||
this.text = SimpleString.of(text);
|
||||
} else {
|
||||
this.text = null;
|
||||
}
|
||||
|
|
|
@ -439,7 +439,7 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
private void handleReplicaTargetLinkOpened(AMQPSessionContext protonSession, Receiver receiver) throws Exception {
|
||||
try {
|
||||
try {
|
||||
protonSession.getSessionSPI().check(SimpleString.toSimpleString(receiver.getTarget().getAddress()), CheckType.SEND, getSecurityAuth());
|
||||
protonSession.getSessionSPI().check(SimpleString.of(receiver.getTarget().getAddress()), CheckType.SEND, getSecurityAuth());
|
||||
} catch (ActiveMQSecurityException e) {
|
||||
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.securityErrorCreatingProducer(e.getMessage());
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ public class AMQPConnectionContext extends ProtonInitializable implements EventH
|
|||
private void handleFederationControlLinkOpened(AMQPSessionContext protonSession, Receiver receiver) throws Exception {
|
||||
try {
|
||||
try {
|
||||
protonSession.getSessionSPI().check(SimpleString.toSimpleString(FEDERATION_BASE_VALIDATION_ADDRESS), CheckType.SEND, getSecurityAuth());
|
||||
protonSession.getSessionSPI().check(SimpleString.of(FEDERATION_BASE_VALIDATION_ADDRESS), CheckType.SEND, getSecurityAuth());
|
||||
} catch (ActiveMQSecurityException e) {
|
||||
throw new ActiveMQAMQPSecurityException(
|
||||
"User does not have permission to attach to the federation control address");
|
||||
|
|
|
@ -381,7 +381,7 @@ public class AmqpSupport {
|
|||
}
|
||||
}
|
||||
|
||||
return SimpleString.toSimpleString(queue);
|
||||
return SimpleString.of(queue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ public class DefaultSenderController implements SenderController {
|
|||
} else if (source.getDynamic()) {
|
||||
// if dynamic we have to create the node (queue) and set the address on the target, the
|
||||
// node is temporary and will be deleted on closing of the session
|
||||
queue = SimpleString.toSimpleString(java.util.UUID.randomUUID().toString());
|
||||
queue = SimpleString.of(java.util.UUID.randomUUID().toString());
|
||||
tempQueueName = queue;
|
||||
try {
|
||||
sessionSPI.createTemporaryQueue(queue, RoutingType.ANYCAST);
|
||||
|
@ -226,11 +226,11 @@ public class DefaultSenderController implements SenderController {
|
|||
//find out if we have an address made up of the address and queue name, if yes then set queue name
|
||||
if (CompositeAddress.isFullyQualified(sourceAddress)) {
|
||||
isFQQN = true;
|
||||
addressToUse = SimpleString.toSimpleString(CompositeAddress.extractAddressName(sourceAddress));
|
||||
queueNameToUse = SimpleString.toSimpleString(CompositeAddress.extractQueueName(sourceAddress));
|
||||
addressToUse = SimpleString.of(CompositeAddress.extractAddressName(sourceAddress));
|
||||
queueNameToUse = SimpleString.of(CompositeAddress.extractQueueName(sourceAddress));
|
||||
} else {
|
||||
isFQQN = false;
|
||||
addressToUse = SimpleString.toSimpleString(sourceAddress);
|
||||
addressToUse = SimpleString.of(sourceAddress);
|
||||
}
|
||||
|
||||
//check to see if the client has defined how we act
|
||||
|
@ -312,7 +312,7 @@ public class DefaultSenderController implements SenderController {
|
|||
supportedFilters.put(filter.getKey(), filter.getValue());
|
||||
}
|
||||
|
||||
SimpleString simpleStringSelector = SimpleString.toSimpleString(selector);
|
||||
SimpleString simpleStringSelector = SimpleString.of(selector);
|
||||
queue = getMatchingQueue(queueNameToUse, addressToUse, RoutingType.MULTICAST, simpleStringSelector, isFQQN);
|
||||
|
||||
//if the address specifies a broker configured queue then we always use this, treat it as a queue
|
||||
|
@ -365,7 +365,7 @@ public class DefaultSenderController implements SenderController {
|
|||
sessionSPI.createSharedVolatileQueue(addressToUse, RoutingType.MULTICAST, queue, simpleStringSelector);
|
||||
}
|
||||
} else {
|
||||
queue = SimpleString.toSimpleString(java.util.UUID.randomUUID().toString());
|
||||
queue = SimpleString.of(java.util.UUID.randomUUID().toString());
|
||||
tempQueueName = queue;
|
||||
try {
|
||||
sessionSPI.createTemporaryQueue(addressToUse, queue, RoutingType.MULTICAST, simpleStringSelector);
|
||||
|
@ -452,7 +452,7 @@ public class DefaultSenderController implements SenderController {
|
|||
String sourceAddress = getSourceAddress(source);
|
||||
|
||||
if (source != null && sourceAddress != null && multicast) {
|
||||
SimpleString queueName = SimpleString.toSimpleString(sourceAddress);
|
||||
SimpleString queueName = SimpleString.of(sourceAddress);
|
||||
QueueQueryResult result = sessionSPI.queueQuery(queueName, routingTypeToUse, false);
|
||||
if (result.isExists() && source.getDynamic()) {
|
||||
sessionSPI.deleteQueue(queueName);
|
||||
|
@ -474,7 +474,7 @@ public class DefaultSenderController implements SenderController {
|
|||
}
|
||||
} else if (source != null && source.getDynamic() && (source.getExpiryPolicy() == TerminusExpiryPolicy.LINK_DETACH || source.getExpiryPolicy() == TerminusExpiryPolicy.SESSION_END)) {
|
||||
try {
|
||||
sessionSPI.removeTemporaryQueue(SimpleString.toSimpleString(sourceAddress));
|
||||
sessionSPI.removeTemporaryQueue(SimpleString.of(sourceAddress));
|
||||
} catch (Exception e) {
|
||||
// Ignore on close, its temporary anyway and will be removed later
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class ProtonServerReceiverContext extends ProtonAbstractReceiver {
|
|||
if (target.getDynamic()) {
|
||||
// if dynamic we have to create the node (queue) and set the address on the target, the node is temporary and
|
||||
// will be deleted on closing of the session
|
||||
address = SimpleString.toSimpleString(sessionSPI.tempQueueName());
|
||||
address = SimpleString.of(sessionSPI.tempQueueName());
|
||||
defRoutingType = getRoutingType(target.getCapabilities(), address);
|
||||
|
||||
try {
|
||||
|
@ -112,7 +112,7 @@ public class ProtonServerReceiverContext extends ProtonAbstractReceiver {
|
|||
// matched on receive of the message.
|
||||
String targetAddress = target.getAddress();
|
||||
if (targetAddress != null && !targetAddress.isEmpty()) {
|
||||
address = SimpleString.toSimpleString(targetAddress);
|
||||
address = SimpleString.of(targetAddress);
|
||||
}
|
||||
|
||||
if (address != null) {
|
||||
|
@ -289,7 +289,7 @@ public class ProtonServerReceiverContext extends ProtonAbstractReceiver {
|
|||
org.apache.qpid.proton.amqp.messaging.Target target = (org.apache.qpid.proton.amqp.messaging.Target) receiver.getRemoteTarget();
|
||||
if (target != null && target.getDynamic() && (target.getExpiryPolicy() == TerminusExpiryPolicy.LINK_DETACH || target.getExpiryPolicy() == TerminusExpiryPolicy.SESSION_END)) {
|
||||
try {
|
||||
sessionSPI.removeTemporaryQueue(SimpleString.toSimpleString(target.getAddress()));
|
||||
sessionSPI.removeTemporaryQueue(SimpleString.of(target.getAddress()));
|
||||
} catch (Exception e) {
|
||||
//ignore on close, its temp anyway and will be removed later
|
||||
}
|
||||
|
|
|
@ -298,7 +298,7 @@ public class AMQPMessageTest {
|
|||
assertTrue(encodedProtonMessage.length < decoded.getMemoryEstimate());
|
||||
assertEquals(estimate, decoded.getMemoryEstimate());
|
||||
|
||||
decoded.putStringProperty(new SimpleString("newProperty"), "newValue");
|
||||
decoded.putStringProperty(SimpleString.of("newProperty"), "newValue");
|
||||
decoded.reencode();
|
||||
|
||||
assertNotEquals(estimate, decoded.getMemoryEstimate());
|
||||
|
@ -424,7 +424,7 @@ public class AMQPMessageTest {
|
|||
|
||||
@Test
|
||||
public void testSetLastValueFromMessageWithNone() {
|
||||
SimpleString lastValue = new SimpleString("last-address");
|
||||
SimpleString lastValue = SimpleString.of("last-address");
|
||||
|
||||
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
|
||||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage);
|
||||
|
@ -556,7 +556,7 @@ public class AMQPMessageTest {
|
|||
@Test
|
||||
public void testSetAddressFromMessage() {
|
||||
final String ADDRESS = "myQueue";
|
||||
final SimpleString NEW_ADDRESS = new SimpleString("myQueue-1");
|
||||
final SimpleString NEW_ADDRESS = SimpleString.of("myQueue-1");
|
||||
|
||||
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
|
||||
protonMessage.setAddress(ADDRESS);
|
||||
|
@ -571,7 +571,7 @@ public class AMQPMessageTest {
|
|||
@Test
|
||||
public void testSetAddressFromMessageUpdatesPropertiesOnReencode() {
|
||||
final String ADDRESS = "myQueue";
|
||||
final SimpleString NEW_ADDRESS = new SimpleString("myQueue-1");
|
||||
final SimpleString NEW_ADDRESS = SimpleString.of("myQueue-1");
|
||||
|
||||
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
|
||||
protonMessage.setAddress(ADDRESS);
|
||||
|
@ -857,7 +857,7 @@ public class AMQPMessageTest {
|
|||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage);
|
||||
assertNull(decoded.getReplyTo());
|
||||
|
||||
decoded.setReplyTo(new SimpleString(REPLY_TO));
|
||||
decoded.setReplyTo(SimpleString.of(REPLY_TO));
|
||||
decoded.reencode();
|
||||
|
||||
assertEquals(REPLY_TO, decoded.getReplyTo().toString());
|
||||
|
@ -872,7 +872,7 @@ public class AMQPMessageTest {
|
|||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage);
|
||||
assertNull(decoded.getReplyTo());
|
||||
|
||||
decoded.setReplyTo(new SimpleString(REPLY_TO));
|
||||
decoded.setReplyTo(SimpleString.of(REPLY_TO));
|
||||
decoded.reencode();
|
||||
|
||||
assertEquals(REPLY_TO, decoded.getReplyTo().toString());
|
||||
|
@ -1374,8 +1374,8 @@ public class AMQPMessageTest {
|
|||
public void testGetAnnotation() {
|
||||
AMQPStandardMessage message = new AMQPStandardMessage(0, encodedProtonMessage, null);
|
||||
|
||||
Object result = message.getAnnotation(new SimpleString(TEST_MESSAGE_ANNOTATION_KEY));
|
||||
String stringResult = message.getAnnotationString(new SimpleString(TEST_MESSAGE_ANNOTATION_KEY));
|
||||
Object result = message.getAnnotation(SimpleString.of(TEST_MESSAGE_ANNOTATION_KEY));
|
||||
String stringResult = message.getAnnotationString(SimpleString.of(TEST_MESSAGE_ANNOTATION_KEY));
|
||||
|
||||
assertEquals(result, stringResult);
|
||||
}
|
||||
|
@ -1384,9 +1384,9 @@ public class AMQPMessageTest {
|
|||
public void testRemoveAnnotation() {
|
||||
AMQPStandardMessage message = new AMQPStandardMessage(0, encodedProtonMessage, null);
|
||||
|
||||
assertNotNull(message.getAnnotation(new SimpleString(TEST_MESSAGE_ANNOTATION_KEY)));
|
||||
message.removeAnnotation(new SimpleString(TEST_MESSAGE_ANNOTATION_KEY));
|
||||
assertNull(message.getAnnotation(new SimpleString(TEST_MESSAGE_ANNOTATION_KEY)));
|
||||
assertNotNull(message.getAnnotation(SimpleString.of(TEST_MESSAGE_ANNOTATION_KEY)));
|
||||
message.removeAnnotation(SimpleString.of(TEST_MESSAGE_ANNOTATION_KEY));
|
||||
assertNull(message.getAnnotation(SimpleString.of(TEST_MESSAGE_ANNOTATION_KEY)));
|
||||
|
||||
message.reencode();
|
||||
|
||||
|
@ -1397,7 +1397,7 @@ public class AMQPMessageTest {
|
|||
public void testSetAnnotation() {
|
||||
AMQPStandardMessage message = new AMQPStandardMessage(0, encodedProtonMessage, null);
|
||||
|
||||
final SimpleString newAnnotation = new SimpleString("testSetAnnotation");
|
||||
final SimpleString newAnnotation = SimpleString.of("testSetAnnotation");
|
||||
final String newValue = "newValue";
|
||||
|
||||
message.setAnnotation(newAnnotation, newValue);
|
||||
|
@ -1417,7 +1417,7 @@ public class AMQPMessageTest {
|
|||
|
||||
assertProtonMessageEquals(protonMessage, message.getProtonMessage());
|
||||
|
||||
message.setAnnotation(new SimpleString("testGetProtonMessage"), "1");
|
||||
message.setAnnotation(SimpleString.of("testGetProtonMessage"), "1");
|
||||
message.messageChanged();
|
||||
|
||||
assertProtonMessageNotEquals(protonMessage, message.getProtonMessage());
|
||||
|
@ -1566,7 +1566,7 @@ public class AMQPMessageTest {
|
|||
|
||||
@Test
|
||||
public void testMessageAnnotationsReencodeAfterUpdate() {
|
||||
final SimpleString TEST_ANNOTATION = new SimpleString("testMessageAnnotationsReencodeAfterUpdate");
|
||||
final SimpleString TEST_ANNOTATION = SimpleString.of("testMessageAnnotationsReencodeAfterUpdate");
|
||||
|
||||
MessageImpl protonMessage = createProtonMessage();
|
||||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage);
|
||||
|
@ -1588,7 +1588,7 @@ public class AMQPMessageTest {
|
|||
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
|
||||
|
||||
byte[] value = RandomUtil.randomBytes();
|
||||
SimpleString name = SimpleString.toSimpleString("myProperty");
|
||||
SimpleString name = SimpleString.of("myProperty");
|
||||
|
||||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage);
|
||||
|
||||
|
@ -1608,7 +1608,7 @@ public class AMQPMessageTest {
|
|||
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
|
||||
|
||||
byte[] original = RandomUtil.randomBytes();
|
||||
SimpleString name = SimpleString.toSimpleString("myProperty");
|
||||
SimpleString name = SimpleString.of("myProperty");
|
||||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage);
|
||||
decoded.setAddress("someAddress");
|
||||
decoded.setMessageID(33);
|
||||
|
@ -1780,9 +1780,9 @@ public class AMQPMessageTest {
|
|||
assertEquals(TEST_STRING_BODY, ((AmqpValue) message.getBody()).getValue());
|
||||
|
||||
// Update the message
|
||||
message.setAnnotation(new SimpleString("x-opt-extra-1"), "test-1");
|
||||
message.setAnnotation(new SimpleString("x-opt-extra-2"), "test-2");
|
||||
message.setAnnotation(new SimpleString("x-opt-extra-3"), "test-3");
|
||||
message.setAnnotation(SimpleString.of("x-opt-extra-1"), "test-1");
|
||||
message.setAnnotation(SimpleString.of("x-opt-extra-2"), "test-2");
|
||||
message.setAnnotation(SimpleString.of("x-opt-extra-3"), "test-3");
|
||||
|
||||
// Reencode and then decode the message again
|
||||
message.reencode();
|
||||
|
@ -2413,8 +2413,8 @@ public class AMQPMessageTest {
|
|||
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
|
||||
|
||||
TypedProperties extraProperties = new TypedProperties();
|
||||
extraProperties.putProperty(new SimpleString(TEST_EXTRA_PROPERTY_KEY1), TEST_EXTRA_PROPERTY_VALUE1);
|
||||
extraProperties.putProperty(new SimpleString(TEST_EXTRA_PROPERTY_KEY2), TEST_EXTRA_PROPERTY_VALUE2);
|
||||
extraProperties.putProperty(SimpleString.of(TEST_EXTRA_PROPERTY_KEY1), TEST_EXTRA_PROPERTY_VALUE1);
|
||||
extraProperties.putProperty(SimpleString.of(TEST_EXTRA_PROPERTY_KEY2), TEST_EXTRA_PROPERTY_VALUE2);
|
||||
|
||||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage, extraProperties);
|
||||
|
||||
|
@ -2543,8 +2543,8 @@ public class AMQPMessageTest {
|
|||
Message protonMessage = Message.Factory.create();
|
||||
AMQPStandardMessage decoded = encodeAndDecodeMessage(protonMessage);
|
||||
TypedProperties props = decoded.createExtraProperties();
|
||||
props.putSimpleStringProperty(new SimpleString("firstString"), new SimpleString("firstValue"));
|
||||
props.putLongProperty(new SimpleString("secondLong"), 1234567);
|
||||
props.putSimpleStringProperty(SimpleString.of("firstString"), SimpleString.of("firstValue"));
|
||||
props.putLongProperty(SimpleString.of("secondLong"), 1234567);
|
||||
|
||||
// same as toPropertyMap(false,5)
|
||||
Map<String, Object> map = decoded.toPropertyMap(-1);
|
||||
|
|
|
@ -92,7 +92,7 @@ public class AMQPPersisterTest {
|
|||
@Test
|
||||
public void testEncodeSize() throws Exception {
|
||||
|
||||
Message message = createMessage(SimpleString.toSimpleString("Test"), 1, new byte[10]);
|
||||
Message message = createMessage(SimpleString.of("Test"), 1, new byte[10]);
|
||||
|
||||
MessagePersister persister = AMQPMessagePersisterV3.getInstance();
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ public class AMQPSessionCallbackTest {
|
|||
// Credit is above threshold
|
||||
Mockito.when(receiver.getCredit()).thenReturn(AMQP_LOW_CREDITS_DEFAULT + 1);
|
||||
|
||||
session.flow(new SimpleString("test"), ProtonServerReceiverContext.createCreditRunnable(AMQP_CREDITS_DEFAULT, AMQP_LOW_CREDITS_DEFAULT, receiver, connection));
|
||||
session.flow(SimpleString.of("test"), ProtonServerReceiverContext.createCreditRunnable(AMQP_CREDITS_DEFAULT, AMQP_LOW_CREDITS_DEFAULT, receiver, connection));
|
||||
|
||||
// Run the credit refill code.
|
||||
Mockito.verify(pagingStore).checkMemory(argument.capture(), Mockito.isA(Consumer.class));
|
||||
|
@ -182,7 +182,7 @@ public class AMQPSessionCallbackTest {
|
|||
// Credit is at threshold
|
||||
Mockito.when(receiver.getCredit()).thenReturn(AMQP_LOW_CREDITS_DEFAULT);
|
||||
|
||||
session.flow(new SimpleString("test"), ProtonServerReceiverContext.createCreditRunnable(AMQP_CREDITS_DEFAULT, AMQP_LOW_CREDITS_DEFAULT, receiver, connection));
|
||||
session.flow(SimpleString.of("test"), ProtonServerReceiverContext.createCreditRunnable(AMQP_CREDITS_DEFAULT, AMQP_LOW_CREDITS_DEFAULT, receiver, connection));
|
||||
|
||||
// Run the credit refill code.
|
||||
Mockito.verify(pagingStore).checkMemory(argument.capture(), Mockito.isA(Consumer.class));
|
||||
|
@ -243,7 +243,7 @@ public class AMQPSessionCallbackTest {
|
|||
// Credit is at threshold
|
||||
Mockito.when(receiver.getCredit()).thenReturn(AMQP_LOW_CREDITS_DEFAULT);
|
||||
|
||||
session.flow(new SimpleString("test"), ProtonServerReceiverContext.createCreditRunnable(1, AMQP_LOW_CREDITS_DEFAULT, receiver, connection));
|
||||
session.flow(SimpleString.of("test"), ProtonServerReceiverContext.createCreditRunnable(1, AMQP_LOW_CREDITS_DEFAULT, receiver, connection));
|
||||
|
||||
// Run the credit refill code.
|
||||
Mockito.verify(pagingStore).checkMemory(argument.capture(), Mockito.isA(Consumer.class));
|
||||
|
|
|
@ -147,7 +147,7 @@ public class AMQPFederationPolicySupportTest {
|
|||
|
||||
final AMQPMessage message = AMQPFederationPolicySupport.encodeQueuePolicyControlMessage(policy);
|
||||
|
||||
assertEquals(ADD_QUEUE_POLICY, message.getAnnotation(SimpleString.toSimpleString(OPERATION_TYPE.toString())));
|
||||
assertEquals(ADD_QUEUE_POLICY, message.getAnnotation(SimpleString.of(OPERATION_TYPE.toString())));
|
||||
|
||||
assertNotNull(message.getBody());
|
||||
assertTrue(message.getBody() instanceof AmqpValue);
|
||||
|
@ -251,7 +251,7 @@ public class AMQPFederationPolicySupportTest {
|
|||
|
||||
final AMQPMessage message = AMQPFederationPolicySupport.encodeAddressPolicyControlMessage(policy);
|
||||
|
||||
assertEquals(ADD_ADDRESS_POLICY, message.getAnnotation(SimpleString.toSimpleString(OPERATION_TYPE.toString())));
|
||||
assertEquals(ADD_ADDRESS_POLICY, message.getAnnotation(SimpleString.of(OPERATION_TYPE.toString())));
|
||||
|
||||
assertNotNull(message.getBody());
|
||||
assertTrue(message.getBody() instanceof AmqpValue);
|
||||
|
|
|
@ -26,13 +26,13 @@ public class MirrorAddressFilterTest {
|
|||
|
||||
@Test
|
||||
public void testAddressFilter() {
|
||||
assertTrue(new MirrorAddressFilter("").match(new SimpleString("any")));
|
||||
assertTrue(new MirrorAddressFilter("test").match(new SimpleString("test123")));
|
||||
assertTrue(new MirrorAddressFilter("a,b").match(new SimpleString("b")));
|
||||
assertTrue(new MirrorAddressFilter("!c").match(new SimpleString("a")));
|
||||
assertTrue(new MirrorAddressFilter("!a,!").match(new SimpleString("b123")));
|
||||
assertFalse(new MirrorAddressFilter("a,b,!ab").match(new SimpleString("ab")));
|
||||
assertFalse(new MirrorAddressFilter("!a,!b").match(new SimpleString("b123")));
|
||||
assertFalse(new MirrorAddressFilter("a,").match(new SimpleString("b")));
|
||||
assertTrue(new MirrorAddressFilter("").match(SimpleString.of("any")));
|
||||
assertTrue(new MirrorAddressFilter("test").match(SimpleString.of("test123")));
|
||||
assertTrue(new MirrorAddressFilter("a,b").match(SimpleString.of("b")));
|
||||
assertTrue(new MirrorAddressFilter("!c").match(SimpleString.of("a")));
|
||||
assertTrue(new MirrorAddressFilter("!a,!").match(SimpleString.of("b123")));
|
||||
assertFalse(new MirrorAddressFilter("a,b,!ab").match(SimpleString.of("ab")));
|
||||
assertFalse(new MirrorAddressFilter("!a,!b").match(SimpleString.of("b123")));
|
||||
assertFalse(new MirrorAddressFilter("a,").match(SimpleString.of("b")));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,9 +144,9 @@ public class TestConversions {
|
|||
|
||||
private TypedProperties createTypedPropertiesMap() {
|
||||
TypedProperties typedProperties = new TypedProperties();
|
||||
typedProperties.putBooleanProperty(new SimpleString("true"), Boolean.TRUE);
|
||||
typedProperties.putBooleanProperty(new SimpleString("false"), Boolean.FALSE);
|
||||
typedProperties.putSimpleStringProperty(new SimpleString("foo"), new SimpleString("bar"));
|
||||
typedProperties.putBooleanProperty(SimpleString.of("true"), Boolean.TRUE);
|
||||
typedProperties.putBooleanProperty(SimpleString.of("false"), Boolean.FALSE);
|
||||
typedProperties.putSimpleStringProperty(SimpleString.of("foo"), SimpleString.of("bar"));
|
||||
return typedProperties;
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class TestConversions {
|
|||
|
||||
AMQPMessage encodedMessage = encodeAndCreateAMQPMessage(message);
|
||||
TypedProperties extraProperties = createTypedPropertiesMap();
|
||||
extraProperties.putBytesProperty(new SimpleString("bytesProp"), "value".getBytes());
|
||||
extraProperties.putBytesProperty(SimpleString.of("bytesProp"), "value".getBytes());
|
||||
encodedMessage.setExtraProperties(extraProperties);
|
||||
|
||||
ICoreMessage serverMessage = encodedMessage.toCore();
|
||||
|
@ -419,7 +419,7 @@ public class TestConversions {
|
|||
|
||||
AMQPMessage encodedMessage = encodeAndCreateAMQPMessage(message);
|
||||
TypedProperties extraProperties = new TypedProperties();
|
||||
encodedMessage.setAddress(SimpleString.toSimpleString("xxxx.v1.queue"));
|
||||
encodedMessage.setAddress(SimpleString.of("xxxx.v1.queue"));
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -453,7 +453,7 @@ public class TestConversions {
|
|||
|
||||
AMQPMessage encodedMessage = encodeAndCreateAMQPMessage(message);
|
||||
TypedProperties extraProperties = new TypedProperties();
|
||||
encodedMessage.setAddress(SimpleString.toSimpleString("xxxx.v1.queue"));
|
||||
encodedMessage.setAddress(SimpleString.of("xxxx.v1.queue"));
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
encodedMessage.putStringProperty("another" + i, "value" + i);
|
||||
|
@ -497,14 +497,14 @@ public class TestConversions {
|
|||
|
||||
AMQPMessage encodedMessage = encodeAndCreateAMQPMessage(message);
|
||||
TypedProperties extraProperties = new TypedProperties();
|
||||
encodedMessage.setAddress(SimpleString.toSimpleString("xxxx.v1.queue"));
|
||||
encodedMessage.setAddress(SimpleString.of("xxxx.v1.queue"));
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
encodedMessage.setMessageID(333L);
|
||||
if (i % 3 == 0) {
|
||||
encodedMessage.referenceOriginalMessage(encodedMessage, SimpleString.toSimpleString("SOME-OTHER-QUEUE-DOES-NOT-MATTER-WHAT"));
|
||||
encodedMessage.referenceOriginalMessage(encodedMessage, SimpleString.of("SOME-OTHER-QUEUE-DOES-NOT-MATTER-WHAT"));
|
||||
} else {
|
||||
encodedMessage.referenceOriginalMessage(encodedMessage, SimpleString.toSimpleString("XXX"));
|
||||
encodedMessage.referenceOriginalMessage(encodedMessage, SimpleString.of("XXX"));
|
||||
}
|
||||
encodedMessage.putStringProperty("another " + i, "value " + i);
|
||||
encodedMessage.messageChanged();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue