From: Daniel Silverthorn Date: Thu, 23 Aug 2018 17:52:54 +0000 (-0400) Subject: Create champ key index on startup X-Git-Tag: 1.3.0~7^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fchamp.git;a=commitdiff_plain;h=ee8f94200b47a174be360b374d081eba43311b5b Create champ key index on startup Change-Id: Ia664d61783606785dcc307845ad2c0b3ce17bbee Issue-ID: AAI-1539 Signed-off-by: Daniel Silverthorn --- 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; }