summaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap/aai/datarouter/policy/SpikeAutosuggestProcessorStubbed.java
diff options
context:
space:
mode:
authorrv871f <richard.vondadelszen@amdocs.com>2018-03-20 10:21:42 -0400
committerrv871f <richard.vondadelszen@amdocs.com>2018-03-20 11:03:34 -0400
commitbf99eb77b31a4cfbc590762cc6ba669820c21439 (patch)
tree6251d665e64a09eb98e79540967dff832f4226b4 /src/test/java/org/onap/aai/datarouter/policy/SpikeAutosuggestProcessorStubbed.java
parent1aae9de4d596a1108818c2d035225a3ba2737501 (diff)
Process VNF event from spike
Issue-ID: AAI-899 Change-Id: I2d056734e6af0fe0b4efe92681971e2b74153a0e Signed-off-by: rv871f <richard.vondadelszen@amdocs.com>
Diffstat (limited to 'src/test/java/org/onap/aai/datarouter/policy/SpikeAutosuggestProcessorStubbed.java')
-rw-r--r--src/test/java/org/onap/aai/datarouter/policy/SpikeAutosuggestProcessorStubbed.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/java/org/onap/aai/datarouter/policy/SpikeAutosuggestProcessorStubbed.java b/src/test/java/org/onap/aai/datarouter/policy/SpikeAutosuggestProcessorStubbed.java
new file mode 100644
index 0000000..cf3b255
--- /dev/null
+++ b/src/test/java/org/onap/aai/datarouter/policy/SpikeAutosuggestProcessorStubbed.java
@@ -0,0 +1,34 @@
+package org.onap.aai.datarouter.policy;
+
+import java.io.FileNotFoundException;
+
+import org.onap.aai.datarouter.entity.DocumentStoreDataEntity;
+
+public class SpikeAutosuggestProcessorStubbed extends SpikeAutosuggestIndexProcessor {
+
+
+ public SpikeAutosuggestProcessorStubbed(SpikeEventPolicyConfig config) throws FileNotFoundException {
+ super(config);
+
+ }
+
+ protected void handleSearchServiceOperation(DocumentStoreDataEntity eventEntity, String action, String index) {
+ //Stub out the actual call to Search Data service and instead store/update documents in memory
+ try {
+ switch (action.toLowerCase()) {
+ case "create":
+ InMemorySearchDatastore.put(eventEntity.getId(), eventEntity.getAsJson()); // they are executed if variable == c1
+ break;
+ case "update":
+ InMemorySearchDatastore.put(eventEntity.getId(), eventEntity.getAsJson()); // they are executed if variable == c1
+ break;
+ case "delete":
+ InMemorySearchDatastore.remove(eventEntity.getId()); // they are executed if variable == c1
+ break;
+ default:
+ break;
+ }
+ } catch (Exception ex) {
+ }
+ }
+}