*
* 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;
/**
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();
super();
}
- /**
- * Instantiates a new indexable cross entity reference.
- *
- * @param loader the loader
- */
- public IndexableCrossEntityReference(OxmModelLoader loader) {
- super(loader);
- }
-
/**
* Adds the cross entity reference value.
*
}
}
+ 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() {
}
@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 ["
? "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 : "") + "]";
}
+
+
}