Config to be able to route GET through datarouter
[aai/gizmo.git] / src / main / java / org / onap / crud / service / CrudAsyncGraphDataService.java
index 60a18d3..5e264b5 100644 (file)
@@ -84,12 +84,21 @@ public class CrudAsyncGraphDataService extends AbstractGraphDataService {
   public static Integer getRequestTimeOut() {
     return requestTimeOut;
   }
+  
+  public CrudAsyncGraphDataService(GraphDao dao, 
+          EventPublisher asyncRequestPublisher,
+          EventConsumer asyncResponseConsumer) throws CrudException {
+      this(dao,dao,asyncRequestPublisher,asyncResponseConsumer);
+  }
 
   public CrudAsyncGraphDataService(GraphDao dao, 
+          GraphDao daoForGet, 
                  EventPublisher asyncRequestPublisher,
                  EventConsumer asyncResponseConsumer) throws CrudException {
 
-     super(dao);
+    super();
+    this.dao = dao;
+    this.daoForGet = daoForGet;
      
     requestTimeOut = DEFAULT_REQUEST_TIMEOUT;
     try {
@@ -261,7 +270,7 @@ public class CrudAsyncGraphDataService extends AbstractGraphDataService {
   public String patchVertex(String version, String id, String type, VertexPayload payload)
     throws CrudException {
     Vertex existingVertex
-      = dao.getVertex(id, OxmModelValidator.resolveCollectionType(version, type));
+      = dao.getVertex(id, OxmModelValidator.resolveCollectionType(version, type), version);
     Vertex patchedVertex = OxmModelValidator.validateIncomingPatchPayload(id, version,
                                                                           type, payload.getProperties(),
                                                                           existingVertex);
@@ -443,5 +452,4 @@ public class CrudAsyncGraphDataService extends AbstractGraphDataService {
         + " , operation: " + event.getOperation().toString() + " , result: "
         + response.getResult() + " , error: " + response.getErrorMessage());
   }
-  
 }
\ No newline at end of file