diff options
Diffstat (limited to 'restconf-client')
-rw-r--r-- | restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java | 57 |
1 files changed, 1 insertions, 56 deletions
diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java index ac0897e8f..620df282f 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java @@ -46,8 +46,6 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.ccsdk.sli.plugins.restapicall.Format; import org.onap.ccsdk.sli.plugins.restapicall.HttpResponse; import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode; -import org.onap.ccsdk.sli.plugins.restapicall.RetryException; -import org.onap.ccsdk.sli.plugins.restapicall.RetryPolicy; import org.onap.ccsdk.sli.plugins.restapicall.XmlParser; import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DataFormatSerializer; import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DataFormatSerializerContext; @@ -165,14 +163,9 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { public void sendRequest(Map<String, String> paramMap, SvcLogicContext ctx, Integer retryCount) throws SvcLogicException { RestapiCallNode rest = getRestapiCallNode(); - RetryPolicy retryPolicy = null; HttpResponse r = new HttpResponse(); try { YangParameters p = getYangParameters(paramMap); - if (p.partner != null) { - retryPolicy = rest.getRetryPolicyStore() - .getRetryPolicy(p.partner); - } String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; Map<String, String> props = new HashMap<>((Map)ctx.toProperties()); @@ -215,30 +208,7 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { log.error(REQ_ERR + e.getMessage(), e); String prefix = parseParam(paramMap, RES_PRE, false, null); - if (retryPolicy == null || !shouldRetry) { - setFailureResponseStatus(ctx, prefix, e.getMessage()); - } else { - if (retryCount == null) { - retryCount = 0; - } - log.debug(format(ATTEMPTS_MSG, retryCount, - retryPolicy.getMaximumRetries())); - try { - retryCount = retryCount + 1; - if (retryCount < retryPolicy.getMaximumRetries() + 1) { - setRetryUri(paramMap, retryPolicy); - log.debug(format(RETRY_COUNT, retryCount, retryPolicy - .getMaximumRetries())); - sendRequest(paramMap, ctx, retryCount); - } else { - log.debug(MAX_RETRY_ERR); - setFailureResponseStatus(ctx, prefix, e.getMessage()); - } - } catch (Exception ex) { - log.error(NO_MORE_RETRY, ex); - setFailureResponseStatus(ctx, prefix, RETRY_FAIL); - } - } + setFailureResponseStatus(ctx, prefix, e.getMessage()); } if (r != null && r.code >= 300) { @@ -403,31 +373,6 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { } /** - * Sets the retry URI to the param map from the retry policies different - * host. - * - * @param paramMap parameter map - * @param retryPolicy retry policy - * @throws URISyntaxException when new URI creation fails - * @throws RetryException when retry policy cannot give another host - */ - private void setRetryUri(Map<String, String> paramMap, - RetryPolicy retryPolicy) - throws URISyntaxException, RetryException { - URI uri = new URI(paramMap.get(REST_API_URL)); - String hostName = uri.getHost(); - String retryString = retryPolicy.getNextHostName(uri.toString()); - - URI uriTwo = new URI(retryString); - URI retryUri = UriBuilder.fromUri(uri).host(uriTwo.getHost()).port( - uriTwo.getPort()).scheme(uriTwo.getScheme()).build(); - - paramMap.put(REST_API_URL, retryUri.toString()); - log.debug(UPDATED_URL + retryUri.toString()); - log.debug(format(COMM_FAIL, hostName, retryString)); - } - - /** * Updates request message for JSON and XML data format, when the HTTP * method points it as PUT or PATCH. * |