diff options
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.java | 34 |
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) { + } + } +} |