Bidirectional optical intents (ONOS-2055).
Removed dead code.
Bugfix in device resource store.
Change-Id: Ic81e0b6985813d8dd696440610bee967a9fc2fc7
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDeviceResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDeviceResourceStore.java
index b519652..c2299ef 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDeviceResourceStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentDeviceResourceStore.java
@@ -33,6 +33,7 @@
import org.onosproject.store.service.StorageService;
import org.onosproject.store.service.TransactionContext;
import org.onosproject.store.service.TransactionalMap;
+import org.onosproject.store.service.Versioned;
import org.slf4j.Logger;
import java.util.Collections;
@@ -169,16 +170,16 @@
@Override
public boolean allocateMapping(IntentId keyIntentId, IntentId valIntentId) {
- Set<IntentId> intents = intentMapping.get(keyIntentId).value();
+ Versioned<Set<IntentId>> versionedIntents = intentMapping.get(keyIntentId);
- if (intents == null) {
- intents = Collections.singleton(valIntentId);
+
+ if (versionedIntents == null) {
+ intentMapping.put(keyIntentId, Collections.singleton(valIntentId));
} else {
- intents.add(valIntentId);
+ versionedIntents.value().add(valIntentId);
+ intentMapping.put(keyIntentId, versionedIntents.value());
}
- intentMapping.put(keyIntentId, intents);
-
return true;
}