X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FClusterWrapperImpl.java;h=d7bfae1b42b88a36be7a9e29124af53231111757;hp=857510ad4b5360ef3870ac16bce00e188cee88a7;hb=37f0504d391efd8b7d61403759fcc22a6dd3a093;hpb=8600573a11d7a0fa1c03e6c3f014473096e6a97c diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ClusterWrapperImpl.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ClusterWrapperImpl.java index 857510ad4b..d7bfae1b42 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ClusterWrapperImpl.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ClusterWrapperImpl.java @@ -10,6 +10,7 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorRef; import akka.actor.ActorSystem; +import akka.actor.Address; import akka.cluster.Cluster; import akka.cluster.ClusterEvent; import com.google.common.base.Preconditions; @@ -17,7 +18,7 @@ import com.google.common.base.Preconditions; public class ClusterWrapperImpl implements ClusterWrapper { private final Cluster cluster; private final String currentMemberName; - private final String selfAddress; + private final Address selfAddress; public ClusterWrapperImpl(ActorSystem actorSystem){ Preconditions.checkNotNull(actorSystem, "actorSystem should not be null"); @@ -31,9 +32,8 @@ public class ClusterWrapperImpl implements ClusterWrapper { "member-3 here would be the name of the member" ); - currentMemberName = (String) cluster.getSelfRoles().toArray()[0]; - selfAddress = cluster.selfAddress().toString(); - + currentMemberName = cluster.getSelfRoles().iterator().next(); + selfAddress = cluster.selfAddress(); } public void subscribeToMemberEvents(ActorRef actorRef){ @@ -48,7 +48,7 @@ public class ClusterWrapperImpl implements ClusterWrapper { return currentMemberName; } - public String getSelfAddress() { + public Address getSelfAddress() { return selfAddress; } }