aboutsummaryrefslogtreecommitdiffstats
path: root/champ-service/src
diff options
context:
space:
mode:
authorSteven Blimkie <Steven.Blimkie@amdocs.com>2018-08-24 12:55:12 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-24 12:55:12 +0000
commit7cba39765f30ef9f4cd89598e3dc790a480f32ec (patch)
tree99f91caf37f975100f09050b6ec1990485b58f03 /champ-service/src
parent4a9171d7b444042e78cacd558dac5413c478d8a2 (diff)
parentee8f94200b47a174be360b374d081eba43311b5b (diff)
Merge "Create champ key index on startup"
Diffstat (limited to 'champ-service/src')
-rw-r--r--champ-service/src/main/java/org/onap/champ/service/ChampDataService.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/champ-service/src/main/java/org/onap/champ/service/ChampDataService.java b/champ-service/src/main/java/org/onap/champ/service/ChampDataService.java
index 8432a8d..48c4183 100644
--- a/champ-service/src/main/java/org/onap/champ/service/ChampDataService.java
+++ b/champ-service/src/main/java/org/onap/champ/service/ChampDataService.java
@@ -29,7 +29,9 @@ import org.onap.aai.champcore.exceptions.ChampSchemaViolationException;
import org.onap.aai.champcore.exceptions.ChampTransactionException;
import org.onap.aai.champcore.exceptions.ChampUnmarshallingException;
import org.onap.aai.champcore.model.ChampElement;
+import org.onap.aai.champcore.model.ChampField;
import org.onap.aai.champcore.model.ChampObject;
+import org.onap.aai.champcore.model.ChampObjectIndex;
import org.onap.aai.champcore.model.ChampRelationship;
import org.onap.aai.champcore.model.fluent.object.ObjectBuildOrPropertiesStep;
import org.onap.aai.cl.api.Logger;
@@ -64,6 +66,14 @@ public class ChampDataService {
this.champUUIDService = champUUIDService;
this.graphImpl = graphImpl;
+
+ ChampField field = new ChampField.Builder(ChampProperties.get("keyName"))
+ .type(ChampField.Type.STRING)
+ .build();
+ ChampObjectIndex index = new ChampObjectIndex.Builder(ChampProperties.get("keyName"), "STRING", field).build();
+
+ graphImpl.storeObjectIndex(index);
+
this.cache = cache;
}