Brian O'Connor

Updating SimpleIntentStore

Change-Id: Ide940216f05a69875fcb844d36b073e2e4b9988e
......@@ -51,6 +51,14 @@
<scope>test</scope>
</dependency>
<!-- FIXME remove when we figure out the trivial store -->
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-core-dist</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-core-common</artifactId>
......
......@@ -48,7 +48,7 @@ import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.IntentTestsMocks;
import org.onosproject.net.intent.Key;
import org.onosproject.net.resource.LinkResourceAllocations;
import org.onosproject.store.trivial.impl.SimpleIntentStore;
import org.onosproject.store.intent.impl.SimpleIntentStore;
import java.util.Collection;
import java.util.Collections;
......
......@@ -170,6 +170,7 @@ public class SimpleIntentStore
// current version is less than or equal to newData's
// Note: current and newData's versions will be equal for state updates
currentData.version().compareTo(newData.version()) <= 0) {
// FIXME need to check that the validity of state transition if ==
current.put(newData.key(), newData);
if (pendingData != null
......@@ -204,7 +205,9 @@ public class SimpleIntentStore
@Override
public void addPending(IntentData data) {
data.setVersion(new SystemClockTimestamp());
if (data.version() != null) { // recompiled intents will already have a version
data.setVersion(new SystemClockTimestamp());
}
synchronized (this) {
IntentData existingData = pending.get(data.key());
if (existingData == null ||
......