Use partitionId instead of clusterName in CopycatTransport
Change-Id: I8e7ab3863a36944ac9e48e187037fb43695ebde3
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportConnection.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportConnection.java
index 58928b3..3c5b649 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportConnection.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CopycatTransportConnection.java
@@ -32,6 +32,7 @@
import org.apache.commons.io.IOUtils;
import org.onlab.packet.IpAddress;
import org.onlab.util.Tools;
+import org.onosproject.cluster.PartitionId;
import org.onosproject.store.cluster.messaging.Endpoint;
import org.onosproject.store.cluster.messaging.MessagingService;
@@ -77,7 +78,7 @@
CopycatTransportConnection(long connectionId,
CopycatTransport.Mode mode,
- String clusterName,
+ PartitionId partitionId,
Address address,
MessagingService messagingService,
ThreadContext context) {
@@ -86,11 +87,11 @@
this.remoteAddress = checkNotNull(address);
this.messagingService = checkNotNull(messagingService);
if (mode == CopycatTransport.Mode.CLIENT) {
- this.outboundMessageSubject = String.format("onos-copycat-%s", clusterName);
- this.inboundMessageSubject = String.format("onos-copycat-%s-%d", clusterName, connectionId);
+ this.outboundMessageSubject = String.format("onos-copycat-%s", partitionId);
+ this.inboundMessageSubject = String.format("onos-copycat-%s-%d", partitionId, connectionId);
} else {
- this.outboundMessageSubject = String.format("onos-copycat-%s-%d", clusterName, connectionId);
- this.inboundMessageSubject = String.format("onos-copycat-%s", clusterName);
+ this.outboundMessageSubject = String.format("onos-copycat-%s-%d", partitionId, connectionId);
+ this.inboundMessageSubject = String.format("onos-copycat-%s", partitionId);
}
this.context = checkNotNull(context);
}