Refactored IntentPartitionService as WorkPartitionService
Change-Id: Ic5cf1978b7fce55b34f84eae9b03c8f9ddcfb9c1
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java
index 753b2e3..cebc4a4 100644
--- a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java
+++ b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentService.java
@@ -32,7 +32,7 @@
import org.onosproject.net.intent.IntentData;
import org.onosproject.net.intent.IntentEvent;
import org.onosproject.net.intent.IntentListener;
-import org.onosproject.net.intent.IntentPartitionService;
+import org.onosproject.net.intent.WorkPartitionService;
import org.onosproject.net.intent.IntentService;
import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.Key;
@@ -64,7 +64,7 @@
protected IntentService intentService;
protected VirtualNetworkStore store;
- protected IntentPartitionService partitionService;
+ protected WorkPartitionService partitionService;
private final VirtualNetwork network;
private final VirtualNetworkService manager;
@@ -83,7 +83,7 @@
this.manager = virtualNetworkManager;
this.store = serviceDirectory.get(VirtualNetworkStore.class);
this.intentService = serviceDirectory.get(IntentService.class);
- this.partitionService = serviceDirectory.get(IntentPartitionService.class);
+ this.partitionService = serviceDirectory.get(WorkPartitionService.class);
}
@Override
@@ -225,7 +225,7 @@
checkNotNull(intentKey, INTENT_KEY_NULL);
Intent intent = getIntent(intentKey);
checkNotNull(intent, INTENT_NULL);
- return partitionService.isMine(intentKey);
+ return partitionService.isMine(intentKey, Key::hash);
}
@Override
diff --git a/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentServiceTest.java b/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentServiceTest.java
index 5e2d06c..9f5eb61 100644
--- a/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentServiceTest.java
+++ b/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentServiceTest.java
@@ -54,8 +54,8 @@
import org.onosproject.net.intent.IntentEvent;
import org.onosproject.net.intent.IntentExtensionService;
import org.onosproject.net.intent.IntentListener;
-import org.onosproject.net.intent.IntentPartitionService;
-import org.onosproject.net.intent.IntentPartitionServiceAdapter;
+import org.onosproject.net.intent.WorkPartitionService;
+import org.onosproject.net.intent.WorkPartitionServiceAdapter;
import org.onosproject.net.intent.IntentService;
import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.IntentTestsMocks;
@@ -103,7 +103,7 @@
private VirtualNetworkIntentService vnetIntentService;
private TestIntentCompiler compiler = new TestIntentCompiler();
private IntentExtensionService intentExtensionService;
- private IntentPartitionService intentPartitionService;
+ private WorkPartitionService workPartitionService;
private ServiceDirectory testDirectory;
private TestListener listener = new TestListener();
private IdGenerator idGenerator = new MockIdGenerator();
@@ -142,11 +142,11 @@
withdrawn = new Semaphore(0, true);
purged = new Semaphore(0, true);
- intentPartitionService = new IntentPartitionServiceAdapter();
+ workPartitionService = new WorkPartitionServiceAdapter();
testDirectory = new TestServiceDirectory()
.add(VirtualNetworkStore.class, virtualNetworkManagerStore)
.add(IntentService.class, intentService)
- .add(IntentPartitionService.class, intentPartitionService);
+ .add(WorkPartitionService.class, workPartitionService);
BaseResource.setServiceDirectory(testDirectory);
}
@@ -215,7 +215,7 @@
vnetIntentService = new VirtualNetworkIntentService(manager, virtualNetwork, testDirectory);
vnetIntentService.intentService = intentService;
vnetIntentService.store = virtualNetworkManagerStore;
- vnetIntentService.partitionService = intentPartitionService;
+ vnetIntentService.partitionService = workPartitionService;
return virtualNetwork;
}