public static final String HTTP_PATCH_METHOD_OVERRIDE = "X-HTTP-Method-Override";\r
\r
private Auth auth;\r
- CrudGraphDataService crudGraphDataService;\r
+ AbstractGraphDataService graphDataService;\r
Gson gson = new Gson();\r
\r
private Logger logger = LoggerFactory.getInstance().getLogger(AaiResourceService.class.getName());\r
* \r
* @throws Exception\r
*/\r
- public AaiResourceService(CrudGraphDataService crudGraphDataService) throws Exception {\r
- this.crudGraphDataService = crudGraphDataService;\r
- this.auth = new Auth(CrudServiceConstants.CRD_AUTH_FILE);\r
+ public AaiResourceService(AbstractGraphDataService graphDataService) throws Exception {\r
+ this.graphDataService = graphDataService;\r
+ this.auth = new Auth(CrudServiceConstants.CRD_AUTH_FILE);\r
}\r
\r
/**\r
}\r
\r
// Now, create our edge in the graph store.\r
- String result = crudGraphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), type, payload);\r
+ String result = graphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), type, payload);\r
response = Response.status(Status.CREATED).entity(result).type(mediaType).build();\r
\r
} catch (CrudException e) {\r
payload = applyEdgeRulesToPayload(payload);\r
\r
// Now, create our edge in the graph store.\r
- String result = crudGraphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), payload.getType(), payload);\r
+ String result = graphDataService.addEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), payload.getType(), payload);\r
response = Response.status(Status.CREATED).entity(result).type(mediaType).build();\r
\r
} catch (CrudException ce) {\r
String result;\r
if (headers.getRequestHeaders().getFirst(HTTP_PATCH_METHOD_OVERRIDE) != null &&\r
headers.getRequestHeaders().getFirst(HTTP_PATCH_METHOD_OVERRIDE).equalsIgnoreCase("PATCH")) {\r
- result = crudGraphDataService.patchEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload);\r
+ result = graphDataService.patchEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload);\r
} else {\r
\r
- result = crudGraphDataService.updateEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload);\r
+ result = graphDataService.updateEdge(RelationshipSchemaLoader.getLatestSchemaVersion(), id, type, payload);\r
}\r
\r
response = Response.status(Status.OK).entity(result).type(mediaType).build();\r