From 8f103711ebf97c1a17ceccae67ff52fd45a75e8b Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Wed, 17 Jul 2024 12:02:53 +0100 Subject: [PATCH] ENT-12008: Fixed deprecated methods. --- .../nodeapi/internal/ArtemisMessagingComponent.kt | 14 +++++++------- .../internal/bridging/BridgeControlListener.kt | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingComponent.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingComponent.kt index 7e61e90630..25172487ac 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingComponent.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingComponent.kt @@ -42,18 +42,18 @@ class ArtemisMessagingComponent { // We should probably try to unify our notion of "topic" (really, just a string that identifies an endpoint // that will handle messages, like a URL) with the terminology used by underlying MQ libraries, to avoid // confusion. - val topicProperty = SimpleString("platform-topic") - val cordaVendorProperty = SimpleString("corda-vendor") - val releaseVersionProperty = SimpleString("release-version") - val platformVersionProperty = SimpleString("platform-version") - val senderUUID = SimpleString("sender-uuid") - val senderSeqNo = SimpleString("send-seq-no") + val topicProperty = SimpleString.of("platform-topic") + val cordaVendorProperty = SimpleString.of("corda-vendor") + val releaseVersionProperty = SimpleString.of("release-version") + val platformVersionProperty = SimpleString.of("platform-version") + val senderUUID = SimpleString.of("sender-uuid") + val senderSeqNo = SimpleString.of("send-seq-no") /** * In the operation mode where we have an out of process bridge we cannot correctly populate the Artemis validated user header * as the TLS does not terminate directly onto Artemis. We therefore use this internal only header to forward * the equivalent information from the Float. */ - val bridgedCertificateSubject = SimpleString("sender-subject-name") + val bridgedCertificateSubject = SimpleString.of("sender-subject-name") object Type { const val KEY = "corda_p2p_message_type" diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/bridging/BridgeControlListener.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/bridging/BridgeControlListener.kt index 84974450d4..9c60a9885f 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/bridging/BridgeControlListener.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/bridging/BridgeControlListener.kt @@ -88,7 +88,7 @@ class BridgeControlListener(private val keyStore: CertificateStore, registerBridgeControlListener(artemisSession) registerBridgeDuplicateChecker(artemisSession) // Attempt to read available inboxes directly from Artemis before requesting updates from connected nodes - validInboundQueues.addAll(artemisSession.addressQuery(SimpleString("$P2P_PREFIX#")).queueNames.map { it.toString() }) + validInboundQueues.addAll(artemisSession.addressQuery(SimpleString.of("$P2P_PREFIX#")).queueNames.map { it.toString() }) log.info("Found inboxes: $validInboundQueues") if (active) { _activeChange.onNext(true) @@ -107,7 +107,7 @@ class BridgeControlListener(private val keyStore: CertificateStore, private fun registerBridgeControlListener(artemisSession: ClientSession) { try { artemisSession.createQueue( - QueueConfiguration(bridgeControlQueue).setAddress(BRIDGE_CONTROL).setRoutingType(RoutingType.MULTICAST) + QueueConfiguration.of(bridgeControlQueue).setAddress(BRIDGE_CONTROL).setRoutingType(RoutingType.MULTICAST) .setTemporary(true).setDurable(false)) } catch (ex: ActiveMQQueueExistsException) { // Ignore if there is a queue still not cleaned up @@ -129,7 +129,7 @@ class BridgeControlListener(private val keyStore: CertificateStore, private fun registerBridgeDuplicateChecker(artemisSession: ClientSession) { try { artemisSession.createQueue( - QueueConfiguration(bridgeNotifyQueue).setAddress(BRIDGE_NOTIFY).setRoutingType(RoutingType.MULTICAST) + QueueConfiguration.of(bridgeNotifyQueue).setAddress(BRIDGE_NOTIFY).setRoutingType(RoutingType.MULTICAST) .setTemporary(true).setDurable(false)) } catch (ex: ActiveMQQueueExistsException) { // Ignore if there is a queue still not cleaned up @@ -189,11 +189,11 @@ class BridgeControlListener(private val keyStore: CertificateStore, } private fun validateInboxQueueName(queueName: String): Boolean { - return queueName.startsWith(P2P_PREFIX) && artemis!!.started!!.session.queueQuery(SimpleString(queueName)).isExists + return queueName.startsWith(P2P_PREFIX) && artemis!!.started!!.session.queueQuery(SimpleString.of(queueName)).isExists } private fun validateBridgingQueueName(queueName: String): Boolean { - return queueName.startsWith(PEERS_PREFIX) && artemis!!.started!!.session.queueQuery(SimpleString(queueName)).isExists + return queueName.startsWith(PEERS_PREFIX) && artemis!!.started!!.session.queueQuery(SimpleString.of(queueName)).isExists } private fun processControlMessage(msg: ClientMessage) {