Refactor to move from openecomp to onap
[aai/gizmo.git] / src / main / java / org / onap / crud / dao / champ / ChampDao.java
@@ -21,7 +21,7 @@
  *
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
-package org.openecomp.crud.dao.champ;
+package org.onap.crud.dao.champ;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -31,24 +31,24 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import org.openecomp.aai.champcore.ChampGraph;
-import org.openecomp.aai.champcore.ChampTransaction;
-import org.openecomp.aai.champcore.exceptions.ChampMarshallingException;
-import org.openecomp.aai.champcore.exceptions.ChampObjectNotExistsException;
-import org.openecomp.aai.champcore.exceptions.ChampRelationshipNotExistsException;
-import org.openecomp.aai.champcore.exceptions.ChampSchemaViolationException;
-import org.openecomp.aai.champcore.exceptions.ChampTransactionException;
-import org.openecomp.aai.champcore.exceptions.ChampUnmarshallingException;
-import org.openecomp.aai.champcore.model.ChampObject;
-import org.openecomp.aai.champcore.model.ChampRelationship;
-import org.openecomp.aai.champcore.model.fluent.object.ObjectBuildOrPropertiesStep;
-import org.openecomp.cl.api.Logger;
-import org.openecomp.cl.eelf.LoggerFactory;
-import org.openecomp.crud.dao.GraphDao;
-import org.openecomp.crud.entity.Edge;
-import org.openecomp.crud.entity.Vertex;
-import org.openecomp.crud.exception.CrudException;
-import org.openecomp.crud.logging.CrudServiceMsgs;
+import org.onap.aai.champcore.ChampGraph;
+import org.onap.aai.champcore.ChampTransaction;
+import org.onap.aai.champcore.exceptions.ChampMarshallingException;
+import org.onap.aai.champcore.exceptions.ChampObjectNotExistsException;
+import org.onap.aai.champcore.exceptions.ChampRelationshipNotExistsException;
+import org.onap.aai.champcore.exceptions.ChampSchemaViolationException;
+import org.onap.aai.champcore.exceptions.ChampTransactionException;
+import org.onap.aai.champcore.exceptions.ChampUnmarshallingException;
+import org.onap.aai.champcore.model.ChampObject;
+import org.onap.aai.champcore.model.ChampRelationship;
+import org.onap.aai.champcore.model.fluent.object.ObjectBuildOrPropertiesStep;
+import org.onap.aai.cl.api.Logger;
+import org.onap.aai.cl.eelf.LoggerFactory;
+import org.onap.crud.dao.GraphDao;
+import org.onap.crud.entity.Edge;
+import org.onap.crud.entity.Vertex;
+import org.onap.crud.exception.CrudException;
+import org.onap.crud.logging.CrudServiceMsgs;
 
 /**
  * This is the integration layer between the CRUD API service and the low level
@@ -106,7 +106,7 @@ public class ChampDao implements GraphDao {
 
       Optional<ChampObject> retrievedVertex = champApi.retrieveObject(idAsLong);
 
-      String nodeType = org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName();
+      String nodeType = org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName();
       if (retrievedVertex.isPresent() && retrievedVertex.get().getProperties().get(nodeType) != null) {
         return vertexFromChampObject(retrievedVertex.get(),
             retrievedVertex.get().getProperties().get(nodeType).toString());
@@ -142,9 +142,9 @@ public class ChampDao implements GraphDao {
       // Did we find it?
       if (retrievedVertex.isPresent()
           && retrievedVertex.get().getProperties()
-              .get(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()) != null
+              .get(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()) != null
           && retrievedVertex.get().getProperties()
-              .get(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()).toString()
+              .get(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()).toString()
               .equalsIgnoreCase(type)) {
 
         // Yup, convert it to a Vector object and return it.
@@ -222,7 +222,7 @@ public class ChampDao implements GraphDao {
     }
 
     // Add the aai_node_type so that AAI can read the data created by gizmo
-    properties.put(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
+    properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
 
     // Create an object to represent our vertex in the format expected by the
     // Champ library.
@@ -250,7 +250,7 @@ public class ChampDao implements GraphDao {
       logger.debug("Update vertex with id: " + id + " with properties: " + propertiesMapToString(properties));
     }
     // Add the aai_node_type so that AAI can read the data created by gizmo
-    properties.put(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
+    properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
 
     try {
       // Now, build the updated version of the Champ Object...
@@ -276,7 +276,7 @@ public class ChampDao implements GraphDao {
           + propertiesMapToString(filter));
     }
 
-    filter.put(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
+    filter.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
 
     Stream<ChampObject> retrievedVertices;
     try {
@@ -582,16 +582,16 @@ public class ChampDao implements GraphDao {
     Edge.Builder edgeBuilder = new Edge.Builder(relationship.getType()).id(relationshipId.toString());
     edgeBuilder.source(vertexFromChampObject(relationship.getSource(),
         relationship.getSource().getProperties()
-            .get(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()) == null
+            .get(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()) == null
                 ? relationship.getSource().getType()
                 : relationship.getSource().getProperties()
-                    .get(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()).toString()));
+                    .get(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()).toString()));
     edgeBuilder.target(vertexFromChampObject(relationship.getTarget(),
         relationship.getTarget().getProperties()
-            .get(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()) == null
+            .get(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()) == null
                 ? relationship.getTarget().getType()
                 : relationship.getTarget().getProperties()
-                    .get(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()).toString()));
+                    .get(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName()).toString()));
 
     for (String key : relationship.getProperties().keySet()) {
       edgeBuilder.property(key, relationship.getProperties().get(key).toString());
@@ -674,7 +674,7 @@ public class ChampDao implements GraphDao {
     }
 
     // Add the aai_node_type so that AAI can read the data created by gizmo
-    properties.put(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
+    properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
 
     // Create an object to represent our vertex in the format expected by the
     // Champ library.
@@ -738,7 +738,7 @@ public class ChampDao implements GraphDao {
       logger.debug("Update vertex with id: " + id + " with properties: " + propertiesMapToString(properties));
     }
     // Add the aai_node_type so that AAI can read the data created by gizmo
-    properties.put(org.openecomp.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
+    properties.put(org.onap.schema.OxmModelValidator.Metadata.NODE_TYPE.propertyName(), type);
 
     try {
       // Now, build the updated version of the Champ Object...