Adding UI extensibility
[aai/sparky-be.git] / src / main / java / org / onap / aai / sparky / sync / entity / IndexableCrossEntityReference.java
  *
  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
-package org.onap.aai.sparky.synchronizer.entity;
+package org.onap.aai.sparky.sync.entity;
 
 import java.util.ArrayList;
 
-import org.onap.aai.sparky.config.oxm.OxmModelLoader;
 import org.onap.aai.sparky.util.NodeUtils;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 
 
 /**
@@ -38,49 +37,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 public class IndexableCrossEntityReference extends IndexableEntity implements IndexDocument {
 
   protected String crossReferenceEntityValues;
-
-  /**
-   * @return the crossReferenceEntityValues
-   */
-  public String getCrossReferenceEntityValues() {
-    return crossReferenceEntityValues;
-  }
-
-  /**
-   * @param crossReferenceEntityValues the crossReferenceEntityValues to set
-   */
-  public void setCrossReferenceEntityValues(String crossReferenceEntityValues) {
-    this.crossReferenceEntityValues = crossReferenceEntityValues;
-  }
-
-  /**
-   * @return the crossEntityReferenceCollection
-   */
-  public ArrayList<String> getCrossEntityReferenceCollection() {
-    return crossEntityReferenceCollection;
-  }
-
-  /**
-   * @param crossEntityReferenceCollection the crossEntityReferenceCollection to set
-   */
-  public void setCrossEntityReferenceCollection(ArrayList<String> crossEntityReferenceCollection) {
-    this.crossEntityReferenceCollection = crossEntityReferenceCollection;
-  }
-
-  /**
-   * @return the mapper
-   */
-  public ObjectMapper getMapper() {
-    return mapper;
-  }
-
-  /**
-   * @param mapper the mapper to set
-   */
-  public void setMapper(ObjectMapper mapper) {
-    this.mapper = mapper;
-  }
-
   protected ArrayList<String> crossEntityReferenceCollection = new ArrayList<String>();
   protected ObjectMapper mapper = new ObjectMapper();
 
@@ -91,15 +47,6 @@ public class IndexableCrossEntityReference extends IndexableEntity implements In
     super();
   }
 
-  /**
-   * Instantiates a new indexable cross entity reference.
-   *
-   * @param loader the loader
-   */
-  public IndexableCrossEntityReference(OxmModelLoader loader) {
-    super(loader);
-  }
-
   /**
    * Adds the cross entity reference value.
    *
@@ -111,10 +58,18 @@ public class IndexableCrossEntityReference extends IndexableEntity implements In
     }
   }
 
+  public String getCrossReferenceEntityValues() {
+    return crossReferenceEntityValues;
+  }
+
+  public void setCrossReferenceEntityValues(String crossReferenceEntityValues) {
+    this.crossReferenceEntityValues = crossReferenceEntityValues;
+  }
+
   /*
    * (non-Javadoc)
    * 
-   * @see org.onap.aai.sparky.synchronizer.entity.IndexDocument#deriveFields()
+   * @see org.openecomp.sparky.synchronizer.entity.IndexDocument#deriveFields()
    */
   @Override
   public void deriveFields() {
@@ -123,27 +78,12 @@ public class IndexableCrossEntityReference extends IndexableEntity implements In
   }
 
   @Override
-  public String getIndexDocumentJson() {
-    ObjectNode rootNode = mapper.createObjectNode();
-    rootNode.put("entityType", this.getEntityType());
-    rootNode.put("entityPrimaryKeyValue", this.getEntityPrimaryKeyValue());
-    rootNode.put("crossEntityReferenceValues", crossReferenceEntityValues);
-    rootNode.put("link", link);
-    rootNode.put("lastmodTimestamp", this.getEntityTimeStamp());
-    return rootNode.toString();
-  }
+  public String getAsJson() throws JsonProcessingException {
+
+    return NodeUtils.convertObjectToJson(this, false);
 
-  @Override
-  public ObjectNode getBulkImportEntity() {
-    // TODO Auto-generated method stub
-    return null;
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.lang.Object#toString()
-   */
   @Override
   public String toString() {
     return "IndexableCrossEntityReference ["
@@ -151,13 +91,9 @@ public class IndexableCrossEntityReference extends IndexableEntity implements In
             ? "crossReferenceEntityValues=" + crossReferenceEntityValues + ", " : "")
         + (crossEntityReferenceCollection != null
             ? "crossEntityReferenceCollection=" + crossEntityReferenceCollection + ", " : "")
-        + (mapper != null ? "mapper=" + mapper + ", " : "") + (id != null ? "id=" + id + ", " : "")
-        + (entityType != null ? "entityType=" + entityType + ", " : "")
-        + (entityPrimaryKeyValue != null ? "entityPrimaryKeyValue=" + entityPrimaryKeyValue + ", "
-            : "")
-        + (lastmodTimestamp != null ? "lastmodTimestamp=" + lastmodTimestamp + ", " : "")
-        + (link != null ? "link=" + link + ", " : "") + (loader != null ? "loader=" + loader : "")
-        + "]";
+        + (mapper != null ? "mapper=" + mapper : "") + "]";
   }
 
+
+
 }