eliminate package dependency cycle
Change-Id: I7c30e5db9f5d17d24d28252b4dc58ce23835b6d8
diff --git a/core/api/src/main/java/org/onlab/onos/net/LinkKey.java b/core/api/src/main/java/org/onlab/onos/net/LinkKey.java
index 56c96e0..f751938 100644
--- a/core/api/src/main/java/org/onlab/onos/net/LinkKey.java
+++ b/core/api/src/main/java/org/onlab/onos/net/LinkKey.java
@@ -4,8 +4,6 @@
import java.util.Objects;
-import org.onlab.onos.net.link.LinkDescription;
-
import com.google.common.base.MoreObjects;
// TODO Consider renaming.
@@ -69,16 +67,6 @@
return new LinkKey(link.src(), link.dst());
}
- /**
- * Creates a link identifier for the specified link.
- *
- * @param desc link description
- * @return a link identifier
- */
- public static LinkKey linkKey(LinkDescription desc) {
- return new LinkKey(desc.src(), desc.dst());
- }
-
@Override
public int hashCode() {
return Objects.hash(src(), dst);
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java b/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java
index e59d65d..ce39c5b 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java
@@ -238,7 +238,7 @@
final Timestamped<LinkDescription> deltaDesc = new Timestamped<>(linkDescription, newTimestamp);
- LinkKey key = linkKey(linkDescription);
+ LinkKey key = linkKey(linkDescription.src(), linkDescription.dst());
final LinkEvent event;
final Timestamped<LinkDescription> mergedDesc;
synchronized (getLinkDescriptions(key)) {
@@ -265,7 +265,8 @@
ProviderId providerId,
Timestamped<LinkDescription> linkDescription) {
- LinkKey key = linkKey(linkDescription.value());
+ LinkKey key = linkKey(linkDescription.value().src(),
+ linkDescription.value().dst());
ConcurrentMap<ProviderId, Timestamped<LinkDescription>> descs = getLinkDescriptions(key);
synchronized (descs) {
diff --git a/core/store/hz/net/src/main/java/org/onlab/onos/store/link/impl/DistributedLinkStore.java b/core/store/hz/net/src/main/java/org/onlab/onos/store/link/impl/DistributedLinkStore.java
index 5e1ff1a..90ae6fe 100644
--- a/core/store/hz/net/src/main/java/org/onlab/onos/store/link/impl/DistributedLinkStore.java
+++ b/core/store/hz/net/src/main/java/org/onlab/onos/store/link/impl/DistributedLinkStore.java
@@ -151,7 +151,7 @@
@Override
public LinkEvent createOrUpdateLink(ProviderId providerId,
LinkDescription linkDescription) {
- LinkKey key = linkKey(linkDescription);
+ LinkKey key = linkKey(linkDescription.src(), linkDescription.dst());
Optional<DefaultLink> link = links.getUnchecked(key);
if (!link.isPresent()) {
return createLink(providerId, key, linkDescription);
diff --git a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleLinkStore.java b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleLinkStore.java
index 47ef6fa..bcddda3 100644
--- a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleLinkStore.java
+++ b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleLinkStore.java
@@ -149,7 +149,7 @@
@Override
public LinkEvent createOrUpdateLink(ProviderId providerId,
LinkDescription linkDescription) {
- LinkKey key = linkKey(linkDescription);
+ LinkKey key = linkKey(linkDescription.src(), linkDescription.dst());
ConcurrentMap<ProviderId, LinkDescription> descs = getLinkDescriptions(key);
synchronized (descs) {