Refactoring
- Renamed Clock{Service, Provider} -> DeviceClock* - move from store -> net/device package Change-Id: Ib4ba5119146bb2df97d3148f48890fb1f47d6a9d
Showing
10 changed files
with
39 additions
and
37 deletions
1 | -package org.onlab.onos.store; | 1 | +package org.onlab.onos.net.device; |
2 | 2 | ||
3 | import org.onlab.onos.cluster.MastershipTerm; | 3 | import org.onlab.onos.cluster.MastershipTerm; |
4 | import org.onlab.onos.net.DeviceId; | 4 | import org.onlab.onos.net.DeviceId; |
... | @@ -8,7 +8,7 @@ import org.onlab.onos.net.DeviceId; | ... | @@ -8,7 +8,7 @@ import org.onlab.onos.net.DeviceId; |
8 | * Interface for feeding term information to a logical clock service | 8 | * Interface for feeding term information to a logical clock service |
9 | * that vends per device timestamps. | 9 | * that vends per device timestamps. |
10 | */ | 10 | */ |
11 | -public interface ClockProviderService { | 11 | +public interface DeviceClockProviderService { |
12 | 12 | ||
13 | /** | 13 | /** |
14 | * Updates the mastership term for the specified deviceId. | 14 | * Updates the mastership term for the specified deviceId. | ... | ... |
1 | -package org.onlab.onos.store; | 1 | +package org.onlab.onos.net.device; |
2 | 2 | ||
3 | import org.onlab.onos.net.DeviceId; | 3 | import org.onlab.onos.net.DeviceId; |
4 | +import org.onlab.onos.store.Timestamp; | ||
4 | 5 | ||
5 | // TODO: Consider renaming to DeviceClockService? | 6 | // TODO: Consider renaming to DeviceClockService? |
6 | /** | 7 | /** |
7 | * Interface for a logical clock service that vends per device timestamps. | 8 | * Interface for a logical clock service that vends per device timestamps. |
8 | */ | 9 | */ |
9 | -public interface ClockService { | 10 | +public interface DeviceClockService { |
10 | 11 | ||
11 | /** | 12 | /** |
12 | * Returns a new timestamp for the specified deviceId. | 13 | * Returns a new timestamp for the specified deviceId. | ... | ... |
... | @@ -28,6 +28,7 @@ import org.onlab.onos.net.Port; | ... | @@ -28,6 +28,7 @@ import org.onlab.onos.net.Port; |
28 | import org.onlab.onos.net.PortNumber; | 28 | import org.onlab.onos.net.PortNumber; |
29 | import org.onlab.onos.net.device.DefaultDeviceDescription; | 29 | import org.onlab.onos.net.device.DefaultDeviceDescription; |
30 | import org.onlab.onos.net.device.DeviceAdminService; | 30 | import org.onlab.onos.net.device.DeviceAdminService; |
31 | +import org.onlab.onos.net.device.DeviceClockProviderService; | ||
31 | import org.onlab.onos.net.device.DeviceDescription; | 32 | import org.onlab.onos.net.device.DeviceDescription; |
32 | import org.onlab.onos.net.device.DeviceEvent; | 33 | import org.onlab.onos.net.device.DeviceEvent; |
33 | import org.onlab.onos.net.device.DeviceListener; | 34 | import org.onlab.onos.net.device.DeviceListener; |
... | @@ -40,7 +41,6 @@ import org.onlab.onos.net.device.DeviceStoreDelegate; | ... | @@ -40,7 +41,6 @@ import org.onlab.onos.net.device.DeviceStoreDelegate; |
40 | import org.onlab.onos.net.device.PortDescription; | 41 | import org.onlab.onos.net.device.PortDescription; |
41 | import org.onlab.onos.net.provider.AbstractProviderRegistry; | 42 | import org.onlab.onos.net.provider.AbstractProviderRegistry; |
42 | import org.onlab.onos.net.provider.AbstractProviderService; | 43 | import org.onlab.onos.net.provider.AbstractProviderService; |
43 | -import org.onlab.onos.store.ClockProviderService; | ||
44 | import org.slf4j.Logger; | 44 | import org.slf4j.Logger; |
45 | 45 | ||
46 | /** | 46 | /** |
... | @@ -82,7 +82,7 @@ public class DeviceManager | ... | @@ -82,7 +82,7 @@ public class DeviceManager |
82 | protected MastershipTermService termService; | 82 | protected MastershipTermService termService; |
83 | 83 | ||
84 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 84 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
85 | - protected ClockProviderService clockProviderService; | 85 | + protected DeviceClockProviderService deviceClockProviderService; |
86 | 86 | ||
87 | @Activate | 87 | @Activate |
88 | public void activate() { | 88 | public void activate() { |
... | @@ -217,7 +217,7 @@ public class DeviceManager | ... | @@ -217,7 +217,7 @@ public class DeviceManager |
217 | return; | 217 | return; |
218 | } | 218 | } |
219 | // tell clock provider if this instance is the master | 219 | // tell clock provider if this instance is the master |
220 | - clockProviderService.setMastershipTerm(deviceId, term); | 220 | + deviceClockProviderService.setMastershipTerm(deviceId, term); |
221 | 221 | ||
222 | DeviceEvent event = store.createOrUpdateDevice(provider().id(), | 222 | DeviceEvent event = store.createOrUpdateDevice(provider().id(), |
223 | deviceId, deviceDescription); | 223 | deviceId, deviceDescription); |
... | @@ -333,7 +333,7 @@ public class DeviceManager | ... | @@ -333,7 +333,7 @@ public class DeviceManager |
333 | 333 | ||
334 | if (term.master().equals(myNodeId)) { | 334 | if (term.master().equals(myNodeId)) { |
335 | // only set the new term if I am the master | 335 | // only set the new term if I am the master |
336 | - clockProviderService.setMastershipTerm(did, term); | 336 | + deviceClockProviderService.setMastershipTerm(did, term); |
337 | } | 337 | } |
338 | 338 | ||
339 | // FIXME: we should check that the device is connected on our end. | 339 | // FIXME: we should check that the device is connected on our end. | ... | ... |
... | @@ -25,6 +25,7 @@ import org.onlab.onos.net.PortNumber; | ... | @@ -25,6 +25,7 @@ import org.onlab.onos.net.PortNumber; |
25 | import org.onlab.onos.net.device.DefaultDeviceDescription; | 25 | import org.onlab.onos.net.device.DefaultDeviceDescription; |
26 | import org.onlab.onos.net.device.DefaultPortDescription; | 26 | import org.onlab.onos.net.device.DefaultPortDescription; |
27 | import org.onlab.onos.net.device.DeviceAdminService; | 27 | import org.onlab.onos.net.device.DeviceAdminService; |
28 | +import org.onlab.onos.net.device.DeviceClockProviderService; | ||
28 | import org.onlab.onos.net.device.DeviceDescription; | 29 | import org.onlab.onos.net.device.DeviceDescription; |
29 | import org.onlab.onos.net.device.DeviceEvent; | 30 | import org.onlab.onos.net.device.DeviceEvent; |
30 | import org.onlab.onos.net.device.DeviceListener; | 31 | import org.onlab.onos.net.device.DeviceListener; |
... | @@ -35,7 +36,6 @@ import org.onlab.onos.net.device.DeviceService; | ... | @@ -35,7 +36,6 @@ import org.onlab.onos.net.device.DeviceService; |
35 | import org.onlab.onos.net.device.PortDescription; | 36 | import org.onlab.onos.net.device.PortDescription; |
36 | import org.onlab.onos.net.provider.AbstractProvider; | 37 | import org.onlab.onos.net.provider.AbstractProvider; |
37 | import org.onlab.onos.net.provider.ProviderId; | 38 | import org.onlab.onos.net.provider.ProviderId; |
38 | -import org.onlab.onos.store.ClockProviderService; | ||
39 | import org.onlab.onos.store.trivial.impl.SimpleDeviceStore; | 39 | import org.onlab.onos.store.trivial.impl.SimpleDeviceStore; |
40 | import org.onlab.packet.IpPrefix; | 40 | import org.onlab.packet.IpPrefix; |
41 | 41 | ||
... | @@ -88,7 +88,7 @@ public class DeviceManagerTest { | ... | @@ -88,7 +88,7 @@ public class DeviceManagerTest { |
88 | mgr.eventDispatcher = new TestEventDispatcher(); | 88 | mgr.eventDispatcher = new TestEventDispatcher(); |
89 | mgr.mastershipService = new TestMastershipService(); | 89 | mgr.mastershipService = new TestMastershipService(); |
90 | mgr.clusterService = new TestClusterService(); | 90 | mgr.clusterService = new TestClusterService(); |
91 | - mgr.clockProviderService = new TestClockProviderService(); | 91 | + mgr.deviceClockProviderService = new TestClockProviderService(); |
92 | mgr.activate(); | 92 | mgr.activate(); |
93 | 93 | ||
94 | service.addListener(listener); | 94 | service.addListener(listener); |
... | @@ -336,7 +336,7 @@ public class DeviceManagerTest { | ... | @@ -336,7 +336,7 @@ public class DeviceManagerTest { |
336 | } | 336 | } |
337 | 337 | ||
338 | private final class TestClockProviderService implements | 338 | private final class TestClockProviderService implements |
339 | - ClockProviderService { | 339 | + DeviceClockProviderService { |
340 | 340 | ||
341 | @Override | 341 | @Override |
342 | public void setMastershipTerm(DeviceId deviceId, MastershipTerm term) { | 342 | public void setMastershipTerm(DeviceId deviceId, MastershipTerm term) { | ... | ... |
... | @@ -12,8 +12,8 @@ import org.apache.felix.scr.annotations.Deactivate; | ... | @@ -12,8 +12,8 @@ import org.apache.felix.scr.annotations.Deactivate; |
12 | import org.apache.felix.scr.annotations.Service; | 12 | import org.apache.felix.scr.annotations.Service; |
13 | import org.onlab.onos.cluster.MastershipTerm; | 13 | import org.onlab.onos.cluster.MastershipTerm; |
14 | import org.onlab.onos.net.DeviceId; | 14 | import org.onlab.onos.net.DeviceId; |
15 | -import org.onlab.onos.store.ClockProviderService; | 15 | +import org.onlab.onos.net.device.DeviceClockProviderService; |
16 | -import org.onlab.onos.store.ClockService; | 16 | +import org.onlab.onos.net.device.DeviceClockService; |
17 | import org.onlab.onos.store.Timestamp; | 17 | import org.onlab.onos.store.Timestamp; |
18 | import org.onlab.onos.store.common.impl.MastershipBasedTimestamp; | 18 | import org.onlab.onos.store.common.impl.MastershipBasedTimestamp; |
19 | import org.slf4j.Logger; | 19 | import org.slf4j.Logger; |
... | @@ -23,7 +23,7 @@ import org.slf4j.Logger; | ... | @@ -23,7 +23,7 @@ import org.slf4j.Logger; |
23 | */ | 23 | */ |
24 | @Component(immediate = true) | 24 | @Component(immediate = true) |
25 | @Service | 25 | @Service |
26 | -public class DeviceClockManager implements ClockService, ClockProviderService { | 26 | +public class DeviceClockManager implements DeviceClockService, DeviceClockProviderService { |
27 | 27 | ||
28 | private final Logger log = getLogger(getClass()); | 28 | private final Logger log = getLogger(getClass()); |
29 | 29 | ... | ... |
... | @@ -25,6 +25,7 @@ import org.onlab.onos.net.Device.Type; | ... | @@ -25,6 +25,7 @@ import org.onlab.onos.net.Device.Type; |
25 | import org.onlab.onos.net.DeviceId; | 25 | import org.onlab.onos.net.DeviceId; |
26 | import org.onlab.onos.net.Port; | 26 | import org.onlab.onos.net.Port; |
27 | import org.onlab.onos.net.PortNumber; | 27 | import org.onlab.onos.net.PortNumber; |
28 | +import org.onlab.onos.net.device.DeviceClockService; | ||
28 | import org.onlab.onos.net.device.DeviceDescription; | 29 | import org.onlab.onos.net.device.DeviceDescription; |
29 | import org.onlab.onos.net.device.DeviceEvent; | 30 | import org.onlab.onos.net.device.DeviceEvent; |
30 | import org.onlab.onos.net.device.DeviceStore; | 31 | import org.onlab.onos.net.device.DeviceStore; |
... | @@ -32,7 +33,6 @@ import org.onlab.onos.net.device.DeviceStoreDelegate; | ... | @@ -32,7 +33,6 @@ import org.onlab.onos.net.device.DeviceStoreDelegate; |
32 | import org.onlab.onos.net.device.PortDescription; | 33 | import org.onlab.onos.net.device.PortDescription; |
33 | import org.onlab.onos.net.provider.ProviderId; | 34 | import org.onlab.onos.net.provider.ProviderId; |
34 | import org.onlab.onos.store.AbstractStore; | 35 | import org.onlab.onos.store.AbstractStore; |
35 | -import org.onlab.onos.store.ClockService; | ||
36 | import org.onlab.onos.store.Timestamp; | 36 | import org.onlab.onos.store.Timestamp; |
37 | import org.onlab.onos.store.cluster.messaging.ClusterCommunicationService; | 37 | import org.onlab.onos.store.cluster.messaging.ClusterCommunicationService; |
38 | import org.onlab.onos.store.cluster.messaging.ClusterMessage; | 38 | import org.onlab.onos.store.cluster.messaging.ClusterMessage; |
... | @@ -111,7 +111,7 @@ public class GossipDeviceStore | ... | @@ -111,7 +111,7 @@ public class GossipDeviceStore |
111 | private final Set<DeviceId> availableDevices = Sets.newConcurrentHashSet(); | 111 | private final Set<DeviceId> availableDevices = Sets.newConcurrentHashSet(); |
112 | 112 | ||
113 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 113 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
114 | - protected ClockService clockService; | 114 | + protected DeviceClockService deviceClockService; |
115 | 115 | ||
116 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 116 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
117 | protected ClusterCommunicationService clusterCommunicator; | 117 | protected ClusterCommunicationService clusterCommunicator; |
... | @@ -207,7 +207,7 @@ public class GossipDeviceStore | ... | @@ -207,7 +207,7 @@ public class GossipDeviceStore |
207 | public synchronized DeviceEvent createOrUpdateDevice(ProviderId providerId, | 207 | public synchronized DeviceEvent createOrUpdateDevice(ProviderId providerId, |
208 | DeviceId deviceId, | 208 | DeviceId deviceId, |
209 | DeviceDescription deviceDescription) { | 209 | DeviceDescription deviceDescription) { |
210 | - final Timestamp newTimestamp = clockService.getTimestamp(deviceId); | 210 | + final Timestamp newTimestamp = deviceClockService.getTimestamp(deviceId); |
211 | final Timestamped<DeviceDescription> deltaDesc = new Timestamped<>(deviceDescription, newTimestamp); | 211 | final Timestamped<DeviceDescription> deltaDesc = new Timestamped<>(deviceDescription, newTimestamp); |
212 | final DeviceEvent event; | 212 | final DeviceEvent event; |
213 | final Timestamped<DeviceDescription> mergedDesc; | 213 | final Timestamped<DeviceDescription> mergedDesc; |
... | @@ -323,7 +323,7 @@ public class GossipDeviceStore | ... | @@ -323,7 +323,7 @@ public class GossipDeviceStore |
323 | 323 | ||
324 | @Override | 324 | @Override |
325 | public DeviceEvent markOffline(DeviceId deviceId) { | 325 | public DeviceEvent markOffline(DeviceId deviceId) { |
326 | - final Timestamp timestamp = clockService.getTimestamp(deviceId); | 326 | + final Timestamp timestamp = deviceClockService.getTimestamp(deviceId); |
327 | final DeviceEvent event = markOfflineInternal(deviceId, timestamp); | 327 | final DeviceEvent event = markOfflineInternal(deviceId, timestamp); |
328 | if (event != null) { | 328 | if (event != null) { |
329 | log.info("Notifying peers of a device offline topology event for deviceId: {}", | 329 | log.info("Notifying peers of a device offline topology event for deviceId: {}", |
... | @@ -397,7 +397,7 @@ public class GossipDeviceStore | ... | @@ -397,7 +397,7 @@ public class GossipDeviceStore |
397 | DeviceId deviceId, | 397 | DeviceId deviceId, |
398 | List<PortDescription> portDescriptions) { | 398 | List<PortDescription> portDescriptions) { |
399 | 399 | ||
400 | - final Timestamp newTimestamp = clockService.getTimestamp(deviceId); | 400 | + final Timestamp newTimestamp = deviceClockService.getTimestamp(deviceId); |
401 | 401 | ||
402 | final Timestamped<List<PortDescription>> timestampedInput | 402 | final Timestamped<List<PortDescription>> timestampedInput |
403 | = new Timestamped<>(portDescriptions, newTimestamp); | 403 | = new Timestamped<>(portDescriptions, newTimestamp); |
... | @@ -553,7 +553,7 @@ public class GossipDeviceStore | ... | @@ -553,7 +553,7 @@ public class GossipDeviceStore |
553 | DeviceId deviceId, | 553 | DeviceId deviceId, |
554 | PortDescription portDescription) { | 554 | PortDescription portDescription) { |
555 | 555 | ||
556 | - final Timestamp newTimestamp = clockService.getTimestamp(deviceId); | 556 | + final Timestamp newTimestamp = deviceClockService.getTimestamp(deviceId); |
557 | final Timestamped<PortDescription> deltaDesc | 557 | final Timestamped<PortDescription> deltaDesc |
558 | = new Timestamped<>(portDescription, newTimestamp); | 558 | = new Timestamped<>(portDescription, newTimestamp); |
559 | final DeviceEvent event; | 559 | final DeviceEvent event; |
... | @@ -646,7 +646,7 @@ public class GossipDeviceStore | ... | @@ -646,7 +646,7 @@ public class GossipDeviceStore |
646 | 646 | ||
647 | @Override | 647 | @Override |
648 | public synchronized DeviceEvent removeDevice(DeviceId deviceId) { | 648 | public synchronized DeviceEvent removeDevice(DeviceId deviceId) { |
649 | - Timestamp timestamp = clockService.getTimestamp(deviceId); | 649 | + Timestamp timestamp = deviceClockService.getTimestamp(deviceId); |
650 | DeviceEvent event = removeDeviceInternal(deviceId, timestamp); | 650 | DeviceEvent event = removeDeviceInternal(deviceId, timestamp); |
651 | if (event != null) { | 651 | if (event != null) { |
652 | log.info("Notifying peers of a device removed topology event for deviceId: {}", | 652 | log.info("Notifying peers of a device removed topology event for deviceId: {}", | ... | ... |
... | @@ -29,6 +29,7 @@ import org.onlab.onos.net.SparseAnnotations; | ... | @@ -29,6 +29,7 @@ import org.onlab.onos.net.SparseAnnotations; |
29 | import org.onlab.onos.net.Link.Type; | 29 | import org.onlab.onos.net.Link.Type; |
30 | import org.onlab.onos.net.LinkKey; | 30 | import org.onlab.onos.net.LinkKey; |
31 | import org.onlab.onos.net.Provided; | 31 | import org.onlab.onos.net.Provided; |
32 | +import org.onlab.onos.net.device.DeviceClockService; | ||
32 | import org.onlab.onos.net.link.DefaultLinkDescription; | 33 | import org.onlab.onos.net.link.DefaultLinkDescription; |
33 | import org.onlab.onos.net.link.LinkDescription; | 34 | import org.onlab.onos.net.link.LinkDescription; |
34 | import org.onlab.onos.net.link.LinkEvent; | 35 | import org.onlab.onos.net.link.LinkEvent; |
... | @@ -36,7 +37,6 @@ import org.onlab.onos.net.link.LinkStore; | ... | @@ -36,7 +37,6 @@ import org.onlab.onos.net.link.LinkStore; |
36 | import org.onlab.onos.net.link.LinkStoreDelegate; | 37 | import org.onlab.onos.net.link.LinkStoreDelegate; |
37 | import org.onlab.onos.net.provider.ProviderId; | 38 | import org.onlab.onos.net.provider.ProviderId; |
38 | import org.onlab.onos.store.AbstractStore; | 39 | import org.onlab.onos.store.AbstractStore; |
39 | -import org.onlab.onos.store.ClockService; | ||
40 | import org.onlab.onos.store.Timestamp; | 40 | import org.onlab.onos.store.Timestamp; |
41 | import org.onlab.onos.store.cluster.messaging.ClusterCommunicationService; | 41 | import org.onlab.onos.store.cluster.messaging.ClusterCommunicationService; |
42 | import org.onlab.onos.store.cluster.messaging.ClusterMessage; | 42 | import org.onlab.onos.store.cluster.messaging.ClusterMessage; |
... | @@ -100,7 +100,7 @@ public class GossipLinkStore | ... | @@ -100,7 +100,7 @@ public class GossipLinkStore |
100 | private final Map<LinkKey, Timestamp> removedLinks = Maps.newHashMap(); | 100 | private final Map<LinkKey, Timestamp> removedLinks = Maps.newHashMap(); |
101 | 101 | ||
102 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 102 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
103 | - protected ClockService clockService; | 103 | + protected DeviceClockService deviceClockService; |
104 | 104 | ||
105 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 105 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
106 | protected ClusterCommunicationService clusterCommunicator; | 106 | protected ClusterCommunicationService clusterCommunicator; |
... | @@ -223,7 +223,7 @@ public class GossipLinkStore | ... | @@ -223,7 +223,7 @@ public class GossipLinkStore |
223 | LinkDescription linkDescription) { | 223 | LinkDescription linkDescription) { |
224 | 224 | ||
225 | DeviceId dstDeviceId = linkDescription.dst().deviceId(); | 225 | DeviceId dstDeviceId = linkDescription.dst().deviceId(); |
226 | - Timestamp newTimestamp = clockService.getTimestamp(dstDeviceId); | 226 | + Timestamp newTimestamp = deviceClockService.getTimestamp(dstDeviceId); |
227 | 227 | ||
228 | final Timestamped<LinkDescription> deltaDesc = new Timestamped<>(linkDescription, newTimestamp); | 228 | final Timestamped<LinkDescription> deltaDesc = new Timestamped<>(linkDescription, newTimestamp); |
229 | 229 | ||
... | @@ -344,7 +344,7 @@ public class GossipLinkStore | ... | @@ -344,7 +344,7 @@ public class GossipLinkStore |
344 | final LinkKey key = new LinkKey(src, dst); | 344 | final LinkKey key = new LinkKey(src, dst); |
345 | 345 | ||
346 | DeviceId dstDeviceId = dst.deviceId(); | 346 | DeviceId dstDeviceId = dst.deviceId(); |
347 | - Timestamp timestamp = clockService.getTimestamp(dstDeviceId); | 347 | + Timestamp timestamp = deviceClockService.getTimestamp(dstDeviceId); |
348 | 348 | ||
349 | LinkEvent event = removeLinkInternal(key, timestamp); | 349 | LinkEvent event = removeLinkInternal(key, timestamp); |
350 | 350 | ... | ... |
... | @@ -8,6 +8,7 @@ import static org.onlab.onos.net.device.DeviceEvent.Type.*; | ... | @@ -8,6 +8,7 @@ import static org.onlab.onos.net.device.DeviceEvent.Type.*; |
8 | import static org.onlab.onos.cluster.ControllerNode.State.*; | 8 | import static org.onlab.onos.cluster.ControllerNode.State.*; |
9 | import static org.onlab.onos.net.DefaultAnnotations.union; | 9 | import static org.onlab.onos.net.DefaultAnnotations.union; |
10 | import static java.util.Arrays.asList; | 10 | import static java.util.Arrays.asList; |
11 | + | ||
11 | import java.io.IOException; | 12 | import java.io.IOException; |
12 | import java.util.Arrays; | 13 | import java.util.Arrays; |
13 | import java.util.Collections; | 14 | import java.util.Collections; |
... | @@ -41,13 +42,13 @@ import org.onlab.onos.net.PortNumber; | ... | @@ -41,13 +42,13 @@ import org.onlab.onos.net.PortNumber; |
41 | import org.onlab.onos.net.SparseAnnotations; | 42 | import org.onlab.onos.net.SparseAnnotations; |
42 | import org.onlab.onos.net.device.DefaultDeviceDescription; | 43 | import org.onlab.onos.net.device.DefaultDeviceDescription; |
43 | import org.onlab.onos.net.device.DefaultPortDescription; | 44 | import org.onlab.onos.net.device.DefaultPortDescription; |
45 | +import org.onlab.onos.net.device.DeviceClockService; | ||
44 | import org.onlab.onos.net.device.DeviceDescription; | 46 | import org.onlab.onos.net.device.DeviceDescription; |
45 | import org.onlab.onos.net.device.DeviceEvent; | 47 | import org.onlab.onos.net.device.DeviceEvent; |
46 | import org.onlab.onos.net.device.DeviceStore; | 48 | import org.onlab.onos.net.device.DeviceStore; |
47 | import org.onlab.onos.net.device.DeviceStoreDelegate; | 49 | import org.onlab.onos.net.device.DeviceStoreDelegate; |
48 | import org.onlab.onos.net.device.PortDescription; | 50 | import org.onlab.onos.net.device.PortDescription; |
49 | import org.onlab.onos.net.provider.ProviderId; | 51 | import org.onlab.onos.net.provider.ProviderId; |
50 | -import org.onlab.onos.store.ClockService; | ||
51 | import org.onlab.onos.store.cluster.messaging.ClusterCommunicationService; | 52 | import org.onlab.onos.store.cluster.messaging.ClusterCommunicationService; |
52 | import org.onlab.onos.store.cluster.messaging.ClusterMessage; | 53 | import org.onlab.onos.store.cluster.messaging.ClusterMessage; |
53 | import org.onlab.onos.store.cluster.messaging.ClusterMessageHandler; | 54 | import org.onlab.onos.store.cluster.messaging.ClusterMessageHandler; |
... | @@ -112,7 +113,7 @@ public class GossipDeviceStoreTest { | ... | @@ -112,7 +113,7 @@ public class GossipDeviceStoreTest { |
112 | private DeviceStore deviceStore; | 113 | private DeviceStore deviceStore; |
113 | 114 | ||
114 | private DeviceClockManager deviceClockManager; | 115 | private DeviceClockManager deviceClockManager; |
115 | - private ClockService clockService; | 116 | + private DeviceClockService deviceClockService; |
116 | private ClusterCommunicationService clusterCommunicator; | 117 | private ClusterCommunicationService clusterCommunicator; |
117 | @BeforeClass | 118 | @BeforeClass |
118 | public static void setUpBeforeClass() throws Exception { | 119 | public static void setUpBeforeClass() throws Exception { |
... | @@ -127,7 +128,7 @@ public class GossipDeviceStoreTest { | ... | @@ -127,7 +128,7 @@ public class GossipDeviceStoreTest { |
127 | public void setUp() throws Exception { | 128 | public void setUp() throws Exception { |
128 | deviceClockManager = new DeviceClockManager(); | 129 | deviceClockManager = new DeviceClockManager(); |
129 | deviceClockManager.activate(); | 130 | deviceClockManager.activate(); |
130 | - clockService = deviceClockManager; | 131 | + deviceClockService = deviceClockManager; |
131 | 132 | ||
132 | deviceClockManager.setMastershipTerm(DID1, MastershipTerm.of(NID1, 1)); | 133 | deviceClockManager.setMastershipTerm(DID1, MastershipTerm.of(NID1, 1)); |
133 | deviceClockManager.setMastershipTerm(DID2, MastershipTerm.of(NID1, 2)); | 134 | deviceClockManager.setMastershipTerm(DID2, MastershipTerm.of(NID1, 2)); |
... | @@ -139,7 +140,7 @@ public class GossipDeviceStoreTest { | ... | @@ -139,7 +140,7 @@ public class GossipDeviceStoreTest { |
139 | replay(clusterCommunicator); | 140 | replay(clusterCommunicator); |
140 | ClusterService clusterService = new TestClusterService(); | 141 | ClusterService clusterService = new TestClusterService(); |
141 | 142 | ||
142 | - testGossipDeviceStore = new TestGossipDeviceStore(clockService, clusterService, clusterCommunicator); | 143 | + testGossipDeviceStore = new TestGossipDeviceStore(deviceClockService, clusterService, clusterCommunicator); |
143 | gossipDeviceStore = testGossipDeviceStore; | 144 | gossipDeviceStore = testGossipDeviceStore; |
144 | gossipDeviceStore.activate(); | 145 | gossipDeviceStore.activate(); |
145 | deviceStore = gossipDeviceStore; | 146 | deviceStore = gossipDeviceStore; |
... | @@ -797,10 +798,10 @@ public class GossipDeviceStoreTest { | ... | @@ -797,10 +798,10 @@ public class GossipDeviceStoreTest { |
797 | private static final class TestGossipDeviceStore extends GossipDeviceStore { | 798 | private static final class TestGossipDeviceStore extends GossipDeviceStore { |
798 | 799 | ||
799 | public TestGossipDeviceStore( | 800 | public TestGossipDeviceStore( |
800 | - ClockService clockService, | 801 | + DeviceClockService deviceClockService, |
801 | ClusterService clusterService, | 802 | ClusterService clusterService, |
802 | ClusterCommunicationService clusterCommunicator) { | 803 | ClusterCommunicationService clusterCommunicator) { |
803 | - this.clockService = clockService; | 804 | + this.deviceClockService = deviceClockService; |
804 | this.clusterService = clusterService; | 805 | this.clusterService = clusterService; |
805 | this.clusterCommunicator = clusterCommunicator; | 806 | this.clusterCommunicator = clusterCommunicator; |
806 | } | 807 | } | ... | ... |
... | @@ -4,15 +4,15 @@ import org.apache.felix.scr.annotations.Component; | ... | @@ -4,15 +4,15 @@ import org.apache.felix.scr.annotations.Component; |
4 | import org.apache.felix.scr.annotations.Service; | 4 | import org.apache.felix.scr.annotations.Service; |
5 | import org.onlab.onos.cluster.MastershipTerm; | 5 | import org.onlab.onos.cluster.MastershipTerm; |
6 | import org.onlab.onos.net.DeviceId; | 6 | import org.onlab.onos.net.DeviceId; |
7 | -import org.onlab.onos.store.ClockProviderService; | 7 | +import org.onlab.onos.net.device.DeviceClockProviderService; |
8 | 8 | ||
9 | // FIXME: Code clone in onos-core-trivial, onos-core-hz-net | 9 | // FIXME: Code clone in onos-core-trivial, onos-core-hz-net |
10 | /** | 10 | /** |
11 | - * Dummy implementation of {@link ClockProviderService}. | 11 | + * Dummy implementation of {@link DeviceClockProviderService}. |
12 | */ | 12 | */ |
13 | @Component(immediate = true) | 13 | @Component(immediate = true) |
14 | @Service | 14 | @Service |
15 | -public class NoOpClockProviderService implements ClockProviderService { | 15 | +public class NoOpClockProviderService implements DeviceClockProviderService { |
16 | 16 | ||
17 | @Override | 17 | @Override |
18 | public void setMastershipTerm(DeviceId deviceId, MastershipTerm term) { | 18 | public void setMastershipTerm(DeviceId deviceId, MastershipTerm term) { | ... | ... |
... | @@ -4,15 +4,15 @@ import org.apache.felix.scr.annotations.Component; | ... | @@ -4,15 +4,15 @@ import org.apache.felix.scr.annotations.Component; |
4 | import org.apache.felix.scr.annotations.Service; | 4 | import org.apache.felix.scr.annotations.Service; |
5 | import org.onlab.onos.cluster.MastershipTerm; | 5 | import org.onlab.onos.cluster.MastershipTerm; |
6 | import org.onlab.onos.net.DeviceId; | 6 | import org.onlab.onos.net.DeviceId; |
7 | -import org.onlab.onos.store.ClockProviderService; | 7 | +import org.onlab.onos.net.device.DeviceClockProviderService; |
8 | 8 | ||
9 | //FIXME: Code clone in onos-core-trivial, onos-core-hz-net | 9 | //FIXME: Code clone in onos-core-trivial, onos-core-hz-net |
10 | /** | 10 | /** |
11 | - * Dummy implementation of {@link ClockProviderService}. | 11 | + * Dummy implementation of {@link DeviceClockProviderService}. |
12 | */ | 12 | */ |
13 | @Component(immediate = true) | 13 | @Component(immediate = true) |
14 | @Service | 14 | @Service |
15 | -public class NoOpClockProviderService implements ClockProviderService { | 15 | +public class NoOpClockProviderService implements DeviceClockProviderService { |
16 | 16 | ||
17 | @Override | 17 | @Override |
18 | public void setMastershipTerm(DeviceId deviceId, MastershipTerm term) { | 18 | public void setMastershipTerm(DeviceId deviceId, MastershipTerm term) { | ... | ... |
-
Please register or login to post a comment