Thomas Vachuska

Miscellaneous clean-up of provider IDs.

Change-Id: If7b3adf96425f8a655ea9af07b6da27a1a66a6f2
......@@ -15,6 +15,8 @@
*/
package org.onlab.onos.core;
import org.onlab.onos.net.provider.ProviderId;
import java.util.Set;
/**
......@@ -22,6 +24,9 @@ import java.util.Set;
*/
public interface CoreService {
public static final ProviderId CORE_PROVIDER_ID =
new ProviderId("core", "org.onlab.onos.core");
/**
* Returns the product version.
*
......
......@@ -31,7 +31,6 @@ import org.onlab.onos.net.link.LinkEvent;
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.Timer;
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 @@ public class DefaultTopologyProvider extends AbstractProvider
* Creates a provider with the supplier identifier.
*/
public DefaultTopologyProvider() {
super(new ProviderId("core", "org.onlab.onos.provider.topology"));
super(CORE_PROVIDER_ID);
}
@Activate
......
......@@ -48,6 +48,7 @@ import static com.google.common.base.MoreObjects.toStringHelper;
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 @@ public class DefaultTopology extends AbstractModel implements Topology {
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 @@ public class DefaultTopology extends AbstractModel implements Topology {
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());
}
......
......@@ -48,6 +48,7 @@ import static com.google.common.base.MoreObjects.toStringHelper;
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 @@ public class DefaultTopology extends AbstractModel implements Topology {
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 @@ public class DefaultTopology extends AbstractModel implements Topology {
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());
}
......