blob: cdc0fadd842225a3115d96a23f3edb8bce23ca8c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package org.openecomp.datarouter.policy;
import java.io.FileNotFoundException;
import org.openecomp.datarouter.entity.DocumentStoreDataEntity;
public class EntityEventPolicyStubbed extends EntityEventPolicy {
public EntityEventPolicyStubbed(EntityEventPolicyConfig 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) {
}
}
}
|