Miscellaneous clean-up of provider IDs.
Change-Id: If7b3adf96425f8a655ea9af07b6da27a1a66a6f2
Showing
4 changed files
with
11 additions
and
8 deletions
... | @@ -15,6 +15,8 @@ | ... | @@ -15,6 +15,8 @@ |
15 | */ | 15 | */ |
16 | package org.onlab.onos.core; | 16 | package org.onlab.onos.core; |
17 | 17 | ||
18 | +import org.onlab.onos.net.provider.ProviderId; | ||
19 | + | ||
18 | import java.util.Set; | 20 | import java.util.Set; |
19 | 21 | ||
20 | /** | 22 | /** |
... | @@ -22,6 +24,9 @@ import java.util.Set; | ... | @@ -22,6 +24,9 @@ import java.util.Set; |
22 | */ | 24 | */ |
23 | public interface CoreService { | 25 | public interface CoreService { |
24 | 26 | ||
27 | + public static final ProviderId CORE_PROVIDER_ID = | ||
28 | + new ProviderId("core", "org.onlab.onos.core"); | ||
29 | + | ||
25 | /** | 30 | /** |
26 | * Returns the product version. | 31 | * Returns the product version. |
27 | * | 32 | * | ... | ... |
... | @@ -31,7 +31,6 @@ import org.onlab.onos.net.link.LinkEvent; | ... | @@ -31,7 +31,6 @@ import org.onlab.onos.net.link.LinkEvent; |
31 | import org.onlab.onos.net.link.LinkListener; | 31 | import org.onlab.onos.net.link.LinkListener; |
32 | import org.onlab.onos.net.link.LinkService; | 32 | import org.onlab.onos.net.link.LinkService; |
33 | import org.onlab.onos.net.provider.AbstractProvider; | 33 | import org.onlab.onos.net.provider.AbstractProvider; |
34 | -import org.onlab.onos.net.provider.ProviderId; | ||
35 | import org.onlab.onos.net.topology.DefaultGraphDescription; | 34 | import org.onlab.onos.net.topology.DefaultGraphDescription; |
36 | import org.onlab.onos.net.topology.GraphDescription; | 35 | import org.onlab.onos.net.topology.GraphDescription; |
37 | import org.onlab.onos.net.topology.TopologyProvider; | 36 | import org.onlab.onos.net.topology.TopologyProvider; |
... | @@ -45,6 +44,7 @@ import java.util.Timer; | ... | @@ -45,6 +44,7 @@ import java.util.Timer; |
45 | import java.util.concurrent.ExecutorService; | 44 | import java.util.concurrent.ExecutorService; |
46 | 45 | ||
47 | import static java.util.concurrent.Executors.newFixedThreadPool; | 46 | import static java.util.concurrent.Executors.newFixedThreadPool; |
47 | +import static org.onlab.onos.core.CoreService.CORE_PROVIDER_ID; | ||
48 | import static org.onlab.onos.net.device.DeviceEvent.Type.*; | 48 | import static org.onlab.onos.net.device.DeviceEvent.Type.*; |
49 | import static org.onlab.util.Tools.namedThreads; | 49 | import static org.onlab.util.Tools.namedThreads; |
50 | import static org.slf4j.LoggerFactory.getLogger; | 50 | import static org.slf4j.LoggerFactory.getLogger; |
... | @@ -93,7 +93,7 @@ public class DefaultTopologyProvider extends AbstractProvider | ... | @@ -93,7 +93,7 @@ public class DefaultTopologyProvider extends AbstractProvider |
93 | * Creates a provider with the supplier identifier. | 93 | * Creates a provider with the supplier identifier. |
94 | */ | 94 | */ |
95 | public DefaultTopologyProvider() { | 95 | public DefaultTopologyProvider() { |
96 | - super(new ProviderId("core", "org.onlab.onos.provider.topology")); | 96 | + super(CORE_PROVIDER_ID); |
97 | } | 97 | } |
98 | 98 | ||
99 | @Activate | 99 | @Activate | ... | ... |
... | @@ -48,6 +48,7 @@ import static com.google.common.base.MoreObjects.toStringHelper; | ... | @@ -48,6 +48,7 @@ import static com.google.common.base.MoreObjects.toStringHelper; |
48 | import static com.google.common.collect.ImmutableSetMultimap.Builder; | 48 | import static com.google.common.collect.ImmutableSetMultimap.Builder; |
49 | import static org.onlab.graph.GraphPathSearch.Result; | 49 | import static org.onlab.graph.GraphPathSearch.Result; |
50 | import static org.onlab.graph.TarjanGraphSearch.SCCResult; | 50 | import static org.onlab.graph.TarjanGraphSearch.SCCResult; |
51 | +import static org.onlab.onos.core.CoreService.CORE_PROVIDER_ID; | ||
51 | import static org.onlab.onos.net.Link.Type.INDIRECT; | 52 | import static org.onlab.onos.net.Link.Type.INDIRECT; |
52 | 53 | ||
53 | /** | 54 | /** |
... | @@ -61,8 +62,6 @@ public class DefaultTopology extends AbstractModel implements Topology { | ... | @@ -61,8 +62,6 @@ public class DefaultTopology extends AbstractModel implements Topology { |
61 | private static final TarjanGraphSearch<TopologyVertex, TopologyEdge> TARJAN = | 62 | private static final TarjanGraphSearch<TopologyVertex, TopologyEdge> TARJAN = |
62 | new TarjanGraphSearch<>(); | 63 | new TarjanGraphSearch<>(); |
63 | 64 | ||
64 | - private static final ProviderId PID = new ProviderId("core", "org.onlab.onos.net"); | ||
65 | - | ||
66 | private final long time; | 65 | private final long time; |
67 | private final TopologyGraph graph; | 66 | private final TopologyGraph graph; |
68 | 67 | ||
... | @@ -296,7 +295,7 @@ public class DefaultTopology extends AbstractModel implements Topology { | ... | @@ -296,7 +295,7 @@ public class DefaultTopology extends AbstractModel implements Topology { |
296 | for (TopologyEdge edge : path.edges()) { | 295 | for (TopologyEdge edge : path.edges()) { |
297 | links.add(edge.link()); | 296 | links.add(edge.link()); |
298 | } | 297 | } |
299 | - return new DefaultPath(PID, links, path.cost()); | 298 | + return new DefaultPath(CORE_PROVIDER_ID, links, path.cost()); |
300 | } | 299 | } |
301 | 300 | ||
302 | 301 | ... | ... |
... | @@ -48,6 +48,7 @@ import static com.google.common.base.MoreObjects.toStringHelper; | ... | @@ -48,6 +48,7 @@ import static com.google.common.base.MoreObjects.toStringHelper; |
48 | import static com.google.common.collect.ImmutableSetMultimap.Builder; | 48 | import static com.google.common.collect.ImmutableSetMultimap.Builder; |
49 | import static org.onlab.graph.GraphPathSearch.Result; | 49 | import static org.onlab.graph.GraphPathSearch.Result; |
50 | import static org.onlab.graph.TarjanGraphSearch.SCCResult; | 50 | import static org.onlab.graph.TarjanGraphSearch.SCCResult; |
51 | +import static org.onlab.onos.core.CoreService.CORE_PROVIDER_ID; | ||
51 | import static org.onlab.onos.net.Link.Type.INDIRECT; | 52 | import static org.onlab.onos.net.Link.Type.INDIRECT; |
52 | 53 | ||
53 | /** | 54 | /** |
... | @@ -61,8 +62,6 @@ public class DefaultTopology extends AbstractModel implements Topology { | ... | @@ -61,8 +62,6 @@ public class DefaultTopology extends AbstractModel implements Topology { |
61 | private static final TarjanGraphSearch<TopologyVertex, TopologyEdge> TARJAN = | 62 | private static final TarjanGraphSearch<TopologyVertex, TopologyEdge> TARJAN = |
62 | new TarjanGraphSearch<>(); | 63 | new TarjanGraphSearch<>(); |
63 | 64 | ||
64 | - private static final ProviderId PID = new ProviderId("core", "org.onlab.onos.net"); | ||
65 | - | ||
66 | private final long time; | 65 | private final long time; |
67 | private final TopologyGraph graph; | 66 | private final TopologyGraph graph; |
68 | 67 | ||
... | @@ -295,7 +294,7 @@ public class DefaultTopology extends AbstractModel implements Topology { | ... | @@ -295,7 +294,7 @@ public class DefaultTopology extends AbstractModel implements Topology { |
295 | for (TopologyEdge edge : path.edges()) { | 294 | for (TopologyEdge edge : path.edges()) { |
296 | links.add(edge.link()); | 295 | links.add(edge.link()); |
297 | } | 296 | } |
298 | - return new DefaultPath(PID, links, path.cost()); | 297 | + return new DefaultPath(CORE_PROVIDER_ID, links, path.cost()); |
299 | } | 298 | } |
300 | 299 | ||
301 | 300 | ... | ... |
-
Please register or login to post a comment