aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorARUL NAMBI <arul.nambi@amdocs.com>2017-08-11 15:46:09 -0400
committerARUL NAMBI <arul.nambi@amdocs.com>2017-08-11 15:50:27 -0400
commit1b7c1f5c9c09720defb16d11b8f22c7e4550f3e2 (patch)
treea941a06763fb6a372d62816863790f77dcd1704b /src/main/java
parent72c57e8251e724c609a9a1c64fa7d0f56446ee36 (diff)
[AAI-159] Synapse not creating autosuggest ndexes
Issue-ID: AAI-159 Change-Id: Ida3bd4d0334fa9becdc6c24a2997a96a1dfeaa7b Signed-off-by: ARUL NAMBI <arul.nambi@amdocs.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/openecomp/datarouter/policy/EntityEventPolicy.java41
1 files changed, 5 insertions, 36 deletions
diff --git a/src/main/java/org/openecomp/datarouter/policy/EntityEventPolicy.java b/src/main/java/org/openecomp/datarouter/policy/EntityEventPolicy.java
index 7b57cc0..290c47f 100644
--- a/src/main/java/org/openecomp/datarouter/policy/EntityEventPolicy.java
+++ b/src/main/java/org/openecomp/datarouter/policy/EntityEventPolicy.java
@@ -22,11 +22,8 @@
*/
package org.openecomp.datarouter.policy;
-import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
@@ -35,14 +32,9 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.UUID;
-
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
-import org.eclipse.jetty.util.security.Password;
import org.eclipse.persistence.dynamic.DynamicType;
import org.eclipse.persistence.internal.helper.DatabaseField;
import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
@@ -60,7 +52,6 @@ import org.openecomp.datarouter.entity.TopographicalEntity;
import org.openecomp.datarouter.entity.UebEventHeader;
import org.openecomp.datarouter.logging.EntityEventPolicyMsgs;
import org.openecomp.datarouter.util.CrossEntityReference;
-import org.openecomp.datarouter.util.DataRouterConstants;
import org.openecomp.datarouter.util.EntityOxmReferenceHelper;
import org.openecomp.datarouter.util.ExternalOxmModelProcessor;
import org.openecomp.datarouter.util.NodeUtils;
@@ -72,8 +63,6 @@ import org.openecomp.datarouter.util.Version;
import org.openecomp.datarouter.util.VersionedOxmEntities;
import org.openecomp.restclient.client.Headers;
import org.openecomp.restclient.client.OperationResult;
-import org.openecomp.restclient.client.RestClient;
-import org.openecomp.restclient.enums.RestAuthenticationMode;
import org.openecomp.restclient.rest.HttpUtil;
import org.slf4j.MDC;
@@ -82,7 +71,6 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
public class EntityEventPolicy implements Processor {
@@ -118,10 +106,7 @@ public class EntityEventPolicy implements Processor {
/** Search index name for suggestive search data. */
private String aggregateGenericVnfIndex;
- private String entitySearchTarget = null;
- private String topographicalSearchTarget = null;
- private String autoSuggestSearchTarget = null;
- private String aggregationSearchVnfTarget = null;
+ private String autosuggestIndex;
private String srcDomain;
@@ -155,21 +140,6 @@ public class EntityEventPolicy implements Processor {
config.getSearchEndpointDocuments(),
logger);
- entitySearchTarget =
- EntityEventPolicy.concatSubUri(config.getSearchBaseUrl(), config.getSearchEndpoint(),
- config.getSearchEntitySearchIndex(), config.getSearchEndpointDocuments());
-
- topographicalSearchTarget = EntityEventPolicy.concatSubUri(config.getSearchBaseUrl(),
- config.getSearchEndpoint(), config.getSearchTopographySearchIndex());
-
- autoSuggestSearchTarget =
- EntityEventPolicy.concatSubUri(config.getSearchBaseUrl(), config.getSearchEndpoint(),
- config.getSearchEntityAutoSuggestIndex(), config.getSearchEndpointDocuments());
-
- aggregationSearchVnfTarget =
- EntityEventPolicy.concatSubUri(config.getSearchBaseUrl(), config.getSearchEndpoint(),
- config.getSearchAggregationVnfIndex(), config.getSearchEndpointDocuments());
-
this.externalOxmModelProcessors = new ArrayList<ExternalOxmModelProcessor>();
this.externalOxmModelProcessors.add(EntityOxmReferenceHelper.getInstance());
OxmModelLoader.registerExternalOxmModelProcessors(externalOxmModelProcessors);
@@ -586,7 +556,7 @@ public class EntityEventPolicy implements Processor {
ae.setLink(entityLink);
ae.deriveFields(uebAsJson);
- handleSearchServiceOperation(ae, action, this.aggregationSearchVnfTarget);
+ handleSearchServiceOperation(ae, action, aggregateGenericVnfIndex);
/*
* It was decided to silently ignore DELETE requests for resources we don't allow to be
@@ -617,8 +587,7 @@ public class EntityEventPolicy implements Processor {
+ e.getLocalizedMessage());
}
- handleSearchServiceOperation(suggestionSearchEntity, action,
- this.autoSuggestSearchTarget);
+ handleSearchServiceOperation(suggestionSearchEntity, action, autosuggestIndex);
}
}
}
@@ -932,7 +901,7 @@ public class EntityEventPolicy implements Processor {
headers.put(Headers.IF_MATCH, etag);
} else {
logger.error(EntityEventPolicyMsgs.NO_ETAG_AVAILABLE_FAILURE,
- entitySearchTarget + entityId, entityId);
+ entitySearchIndex, entityId);
}
ArrayList<JsonNode> sourceObject = new ArrayList<JsonNode>();
@@ -1094,7 +1063,7 @@ public class EntityEventPolicy implements Processor {
"Cannot create unique SHA digest for topographical data.");
}
- this.handleSearchServiceOperation(topoEntity, action, this.topographicalSearchTarget);
+ this.handleSearchServiceOperation(topoEntity, action, topographicalSearchIndex);
}