summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openecomp/crud/service
diff options
context:
space:
mode:
authorabatos <adrian.batos-parac@amdocs.com>2017-08-22 14:23:21 -0400
committerabatos <adrian.batos-parac@amdocs.com>2017-08-22 15:33:04 -0400
commitddc73b563fcd2b3e47b5d0f54139f20ed3cdcba1 (patch)
tree91bf9c18725f0a982468ad71f963ffe26f8c2d58 /src/main/java/org/openecomp/crud/service
parent7e69be504213aa92893fd3354a767128b3a583f1 (diff)
Split out Titan specific dependencies from core
Remove the Titan specific references within the gizmo core and prepare for dependency on new champ core library. Change-Id: I29a4e7b6528e8357715b095d8db5456cd01eb636 Issue-ID: AAI-21 Signed-off-by: abatos <adrian.batos-parac@amdocs.com>
Diffstat (limited to 'src/main/java/org/openecomp/crud/service')
-rw-r--r--src/main/java/org/openecomp/crud/service/CrudGraphDataService.java37
1 files changed, 3 insertions, 34 deletions
diff --git a/src/main/java/org/openecomp/crud/service/CrudGraphDataService.java b/src/main/java/org/openecomp/crud/service/CrudGraphDataService.java
index 8693505..e6d6748 100644
--- a/src/main/java/org/openecomp/crud/service/CrudGraphDataService.java
+++ b/src/main/java/org/openecomp/crud/service/CrudGraphDataService.java
@@ -23,16 +23,13 @@
*/
package org.openecomp.crud.service;
-import org.onap.aai.event.api.EventPublisher;
-
+import org.openecomp.aai.champcore.ChampGraph;
import org.openecomp.crud.dao.GraphDao;
import org.openecomp.crud.dao.champ.ChampDao;
import org.openecomp.crud.entity.Edge;
import org.openecomp.crud.entity.Vertex;
import org.openecomp.crud.exception.CrudException;
import org.openecomp.crud.parser.CrudResponseBuilder;
-import org.openecomp.crud.util.CrudProperties;
-import org.openecomp.crud.util.CrudServiceConstants;
import org.openecomp.schema.OxmModelLoader;
import org.openecomp.schema.OxmModelValidator;
import org.openecomp.schema.RelationshipSchemaLoader;
@@ -40,42 +37,14 @@ import org.openecomp.schema.RelationshipSchemaValidator;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
public class CrudGraphDataService {
private GraphDao dao;
- public CrudGraphDataService(EventPublisher champEventPublisher) throws CrudException {
-
- // Configure the GraphDao and wire it
- Properties champProperties = new Properties();
- champProperties.put(ChampDao.CONFIG_STORAGE_BACKEND, "titan");
- champProperties.put(ChampDao.CONFIG_STORAGE_BACKEND_DB,
- CrudProperties.get(CrudServiceConstants.CRD_STORAGE_BACKEND_DB, "hbase"));
- champProperties.put(ChampDao.CONFIG_STORAGE_HOSTNAMES,
- CrudProperties.get(CrudServiceConstants.CRD_GRAPH_HOST));
- champProperties.put(ChampDao.CONFIG_STORAGE_PORT,
- CrudProperties.get(CrudServiceConstants.CRD_GRAPH_PORT, "2181"));
- champProperties.put(ChampDao.CONFIG_HBASE_ZNODE_PARENT,
- CrudProperties.get(CrudServiceConstants.CRD_HBASE_ZNODE_PARENT, "/hbase-unsecure"));
-
- if (CrudProperties.get("crud.graph.name") != null) {
- champProperties.put(ChampDao.CONFIG_GRAPH_NAME, CrudProperties.get("crud.graph.name"));
- }
-
- if (champEventPublisher != null) {
- champProperties.put(ChampDao.CONFIG_EVENT_STREAM_PUBLISHER, champEventPublisher);
- }
-
- if (CrudProperties.get(ChampDao.CONFIG_EVENT_STREAM_NUM_PUBLISHERS) != null) {
- champProperties.put(ChampDao.CONFIG_EVENT_STREAM_NUM_PUBLISHERS,
- Integer.parseInt(CrudProperties.get(ChampDao.CONFIG_EVENT_STREAM_NUM_PUBLISHERS)));
- }
-
- ChampDao champDao = new ChampDao(champProperties);
+ public CrudGraphDataService(ChampGraph graphImpl) throws CrudException {
- this.dao = champDao;
+ this.dao = new ChampDao(graphImpl);
//load the schemas
OxmModelLoader.loadModels();