summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/crud/service/AaiResourceService.java
diff options
context:
space:
mode:
authorsblimkie <steven.blimkie@amdocs.com>2017-12-20 10:15:36 -0500
committersblimkie <steven.blimkie@amdocs.com>2017-12-20 10:21:46 -0500
commit0e7b5a7e16a4f807580b152f3de766d1512543f1 (patch)
treec5b50902b1115e3be89111a53852609e32735227 /src/main/java/org/onap/crud/service/AaiResourceService.java
parent382e07e97ccd5f7bd47bdd735143ab3658661a68 (diff)
Consolidate syncrounous and asyncronous APIs
Gizmo to present a single API, and the mode in which it interacts with the backend is configurable at deploy time. Change-Id: Iab96f71c9f99dd1d8d70f01a90478a975c50bff1 Issue-ID: AAI-482 Signed-off-by: sblimkie <steven.blimkie@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/crud/service/AaiResourceService.java')
-rw-r--r--src/main/java/org/onap/crud/service/AaiResourceService.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/onap/crud/service/AaiResourceService.java b/src/main/java/org/onap/crud/service/AaiResourceService.java
index 98f83af..f7bda6a 100644
--- a/src/main/java/org/onap/crud/service/AaiResourceService.java
+++ b/src/main/java/org/onap/crud/service/AaiResourceService.java
@@ -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();