Miscellaneous clean-up of provider IDs.
Change-Id: If7b3adf96425f8a655ea9af07b6da27a1a66a6f2
diff --git a/core/api/src/main/java/org/onlab/onos/core/CoreService.java b/core/api/src/main/java/org/onlab/onos/core/CoreService.java
index 09efe22..28145eb 100644
--- a/core/api/src/main/java/org/onlab/onos/core/CoreService.java
+++ b/core/api/src/main/java/org/onlab/onos/core/CoreService.java
@@ -15,6 +15,8 @@
*/
package org.onlab.onos.core;
+import org.onlab.onos.net.provider.ProviderId;
+
import java.util.Set;
/**
@@ -22,6 +24,9 @@
*/
public interface CoreService {
+ public static final ProviderId CORE_PROVIDER_ID =
+ new ProviderId("core", "org.onlab.onos.core");
+
/**
* Returns the product version.
*
diff --git a/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java b/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java
index ac671da..a3e0d6c 100644
--- a/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java
+++ b/core/net/src/main/java/org/onlab/onos/net/topology/impl/DefaultTopologyProvider.java
@@ -31,7 +31,6 @@
import org.onlab.onos.net.link.LinkListener;
import org.onlab.onos.net.link.LinkService;
import org.onlab.onos.net.provider.AbstractProvider;
-import org.onlab.onos.net.provider.ProviderId;
import org.onlab.onos.net.topology.DefaultGraphDescription;
import org.onlab.onos.net.topology.GraphDescription;
import org.onlab.onos.net.topology.TopologyProvider;
@@ -45,6 +44,7 @@
import java.util.concurrent.ExecutorService;
import static java.util.concurrent.Executors.newFixedThreadPool;
+import static org.onlab.onos.core.CoreService.CORE_PROVIDER_ID;
import static org.onlab.onos.net.device.DeviceEvent.Type.*;
import static org.onlab.util.Tools.namedThreads;
import static org.slf4j.LoggerFactory.getLogger;
@@ -93,7 +93,7 @@
* Creates a provider with the supplier identifier.
*/
public DefaultTopologyProvider() {
- super(new ProviderId("core", "org.onlab.onos.provider.topology"));
+ super(CORE_PROVIDER_ID);
}
@Activate
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java b/core/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java
index f2e07f1..1850fa4 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/topology/impl/DefaultTopology.java
@@ -48,6 +48,7 @@
import static com.google.common.collect.ImmutableSetMultimap.Builder;
import static org.onlab.graph.GraphPathSearch.Result;
import static org.onlab.graph.TarjanGraphSearch.SCCResult;
+import static org.onlab.onos.core.CoreService.CORE_PROVIDER_ID;
import static org.onlab.onos.net.Link.Type.INDIRECT;
/**
@@ -61,8 +62,6 @@
private static final TarjanGraphSearch<TopologyVertex, TopologyEdge> TARJAN =
new TarjanGraphSearch<>();
- private static final ProviderId PID = new ProviderId("core", "org.onlab.onos.net");
-
private final long time;
private final TopologyGraph graph;
@@ -296,7 +295,7 @@
for (TopologyEdge edge : path.edges()) {
links.add(edge.link());
}
- return new DefaultPath(PID, links, path.cost());
+ return new DefaultPath(CORE_PROVIDER_ID, links, path.cost());
}
diff --git a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/DefaultTopology.java b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/DefaultTopology.java
index 9a232c1..7dd739e 100644
--- a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/DefaultTopology.java
+++ b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/DefaultTopology.java
@@ -48,6 +48,7 @@
import static com.google.common.collect.ImmutableSetMultimap.Builder;
import static org.onlab.graph.GraphPathSearch.Result;
import static org.onlab.graph.TarjanGraphSearch.SCCResult;
+import static org.onlab.onos.core.CoreService.CORE_PROVIDER_ID;
import static org.onlab.onos.net.Link.Type.INDIRECT;
/**
@@ -61,8 +62,6 @@
private static final TarjanGraphSearch<TopologyVertex, TopologyEdge> TARJAN =
new TarjanGraphSearch<>();
- private static final ProviderId PID = new ProviderId("core", "org.onlab.onos.net");
-
private final long time;
private final TopologyGraph graph;
@@ -295,7 +294,7 @@
for (TopologyEdge edge : path.edges()) {
links.add(edge.link());
}
- return new DefaultPath(PID, links, path.cost());
+ return new DefaultPath(CORE_PROVIDER_ID, links, path.cost());
}