Remove deprecated value() method
Change-Id: I3056a47f4630a5667f9dc05280a6d0ab1a2c7ca8
diff --git a/core/security/src/main/java/org/onosproject/security/store/DistributedSecurityModeStore.java b/core/security/src/main/java/org/onosproject/security/store/DistributedSecurityModeStore.java
index 4cf4201..e642369 100644
--- a/core/security/src/main/java/org/onosproject/security/store/DistributedSecurityModeStore.java
+++ b/core/security/src/main/java/org/onosproject/security/store/DistributedSecurityModeStore.java
@@ -42,6 +42,7 @@
import org.onosproject.store.service.MapEventListener;
import org.onosproject.store.service.Serializer;
import org.onosproject.store.service.StorageService;
+import org.onosproject.store.service.Versioned;
import org.slf4j.Logger;
import java.util.HashSet;
@@ -232,7 +233,8 @@
return;
}
ApplicationId appId = event.key();
- SecurityInfo info = event.value().value();
+ Versioned<SecurityInfo> value = event.type() == MapEvent.Type.REMOVE ? event.oldValue() : event.newValue();
+ SecurityInfo info = value.value();
if (event.type() == MapEvent.Type.INSERT || event.type() == MapEvent.Type.UPDATE) {
switch (info.getState()) {
diff --git a/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java b/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java
index d179288..35dedbd 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java
@@ -49,6 +49,7 @@
import org.onosproject.store.service.Serializer;
import org.onosproject.store.service.StorageService;
import org.onosproject.store.service.DistributedPrimitive.Status;
+import org.onosproject.store.service.Versioned;
import org.slf4j.Logger;
import java.util.Collection;
@@ -420,7 +421,8 @@
private class HostLocationTracker implements MapEventListener<HostId, DefaultHost> {
@Override
public void event(MapEvent<HostId, DefaultHost> event) {
- DefaultHost host = checkNotNull(event.value().value());
+ Versioned<DefaultHost> value = event.type() == MapEvent.Type.REMOVE ? event.oldValue() : event.newValue();
+ DefaultHost host = checkNotNull(value.value());
switch (event.type()) {
case INSERT:
updateHostsByIp(host);
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/meter/impl/DistributedMeterStore.java b/incubator/store/src/main/java/org/onosproject/incubator/store/meter/impl/DistributedMeterStore.java
index 7124a1f..a39e405 100644
--- a/incubator/store/src/main/java/org/onosproject/incubator/store/meter/impl/DistributedMeterStore.java
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/meter/impl/DistributedMeterStore.java
@@ -448,7 +448,8 @@
@Override
public void event(MapEvent<MeterKey, MeterData> event) {
MeterKey key = event.key();
- MeterData data = event.value().value();
+ Versioned<MeterData> value = event.type() == MapEvent.Type.REMOVE ? event.oldValue() : event.newValue();
+ MeterData data = value.value();
NodeId master = mastershipService.getMasterFor(data.meter().deviceId());
switch (event.type()) {
case INSERT: