X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fcrud%2Fservice%2FAaiResourceService.java;h=f7bda6a0499877f599327d02d5900da24c90f11e;hb=0e7b5a7e16a4f807580b152f3de766d1512543f1;hp=2e4464d6f8f39393b6b220cf59128ad0ec0057da;hpb=94cbd3286b5fdd2f3f8fa3325835e713d71aac73;p=aai%2Fgizmo.git diff --git a/src/main/java/org/onap/crud/service/AaiResourceService.java b/src/main/java/org/onap/crud/service/AaiResourceService.java index 2e4464d..f7bda6a 100644 --- a/src/main/java/org/onap/crud/service/AaiResourceService.java +++ b/src/main/java/org/onap/crud/service/AaiResourceService.java @@ -51,7 +51,7 @@ import org.onap.aai.serialization.db.EdgeProperty; import org.onap.aai.serialization.db.EdgeRule; import org.onap.aai.serialization.db.EdgeRules; import org.onap.aai.serialization.db.EdgeType; -import org.openecomp.auth.Auth; +import org.onap.aaiauth.auth.Auth; import org.onap.aai.cl.api.Logger; import org.onap.aai.cl.eelf.LoggerFactory; import org.onap.crud.exception.CrudException; @@ -79,7 +79,7 @@ public class AaiResourceService { public static final String HTTP_PATCH_METHOD_OVERRIDE = "X-HTTP-Method-Override"; private Auth auth; - CrudGraphDataService crudGraphDataService; + AbstractGraphDataService graphDataService; Gson gson = new Gson(); private Logger logger = LoggerFactory.getInstance().getLogger(AaiResourceService.class.getName()); @@ -94,9 +94,9 @@ public class AaiResourceService { * * @throws Exception */ - public AaiResourceService(CrudGraphDataService crudGraphDataService) throws Exception { - this.crudGraphDataService = crudGraphDataService; - this.auth = new Auth(CrudServiceConstants.CRD_AUTH_FILE); + public AaiResourceService(AbstractGraphDataService graphDataService) throws Exception { + this.graphDataService = graphDataService; + this.auth = new Auth(CrudServiceConstants.CRD_AUTH_FILE); } /** @@ -168,7 +168,7 @@ public class AaiResourceService { } // Now, create our edge in the graph store. - String result = crudGraphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), type, payload); + String result = graphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), type, payload); response = Response.status(Status.CREATED).entity(result).type(mediaType).build(); } catch (CrudException e) { @@ -232,7 +232,7 @@ public class AaiResourceService { payload = applyEdgeRulesToPayload(payload); // Now, create our edge in the graph store. - String result = crudGraphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), payload.getType(), payload); + String result = graphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), payload.getType(), payload); response = Response.status(Status.CREATED).entity(result).type(mediaType).build(); } catch (CrudException ce) { @@ -307,10 +307,10 @@ public class AaiResourceService { String result; if (headers.getRequestHeaders().getFirst(HTTP_PATCH_METHOD_OVERRIDE) != null && headers.getRequestHeaders().getFirst(HTTP_PATCH_METHOD_OVERRIDE).equalsIgnoreCase("PATCH")) { - result = crudGraphDataService.patchEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload); + result = graphDataService.patchEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload); } else { - result = crudGraphDataService.updateEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload); + result = graphDataService.updateEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload); } response = Response.status(Status.OK).entity(result).type(mediaType).build();