From a813f54f56f933aed461b367068651deec6518cb Mon Sep 17 00:00:00 2001 From: "Kajur, Harish (vk250x)" Date: Wed, 28 Mar 2018 23:47:11 -0400 Subject: Update camel jms to using spring jms Issue-ID: AAI-586 Change-Id: Iac662424d9d912bfc1792c2a495821b0c9ff6339 Signed-off-by: Kajur, Harish (vk250x) --- aai-client-loadbalancer/pom.xml | 5 ++++ aai-core/pom.xml | 18 +++++------- .../main/java/org/onap/aai/util/AAIApiVersion.java | 32 ++-------------------- aai-utils/pom.xml | 2 +- 4 files changed, 16 insertions(+), 41 deletions(-) diff --git a/aai-client-loadbalancer/pom.xml b/aai-client-loadbalancer/pom.xml index 5ed63d4a..58454d6c 100644 --- a/aai-client-loadbalancer/pom.xml +++ b/aai-client-loadbalancer/pom.xml @@ -81,6 +81,11 @@ spring-retry 1.2.1.RELEASE + + io.netty + netty-codec-http + 4.0.29.Final + diff --git a/aai-core/pom.xml b/aai-core/pom.xml index c2f3410d..67fafa42 100644 --- a/aai-core/pom.xml +++ b/aai-core/pom.xml @@ -50,6 +50,7 @@ 5.15.3 0.50 3.2.2 + 9.4.6.v20170531 @@ -469,12 +470,7 @@ org.eclipse.jetty jetty-util - 9.4.2.v20170220 - - - org.apache.cxf - cxf-core - 3.0.6 + ${jetty.version} com.fasterxml.jackson.module @@ -607,11 +603,6 @@ - - org.apache.camel - camel-jms - 2.15.5 - org.powermock powermock-module-javaagent @@ -639,6 +630,11 @@ gremlin-groovy ${gremlin.version} + + org.springframework + spring-jms + 4.3.2.RELEASE + diff --git a/aai-core/src/main/java/org/onap/aai/util/AAIApiVersion.java b/aai-core/src/main/java/org/onap/aai/util/AAIApiVersion.java index c26261a9..b3e4add7 100644 --- a/aai-core/src/main/java/org/onap/aai/util/AAIApiVersion.java +++ b/aai-core/src/main/java/org/onap/aai/util/AAIApiVersion.java @@ -19,14 +19,10 @@ */ package org.onap.aai.util; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.cxf.message.Message; -import org.apache.cxf.phase.PhaseInterceptorChain; - import org.onap.aai.exceptions.AAIException; +import java.util.regex.Pattern; + public class AAIApiVersion { private static final Pattern versionPattern = Pattern.compile("(^|\\/)(v\\d+)\\/"); @@ -42,29 +38,7 @@ public class AAIApiVersion { public static String get() throws AAIException { String apiVersion = null; - try { - Message message = PhaseInterceptorChain.getCurrentMessage(); - String requestURI = (String) message.get(Message.REQUEST_URI); - - if (requestURI != null) { - Matcher matcher = versionPattern.matcher(requestURI); - if (matcher.find() && matcher.groupCount() >= 2) { - apiVersion = matcher.group(2); - } - if (apiVersion == null) { - Matcher latestMatcher = latestVersionPattern.matcher(requestURI); - if (latestMatcher.find() && latestMatcher.groupCount() >= 2) { - apiVersion = AAIConfig.get(AAIConstants.AAI_DEFAULT_API_VERSION_PROP, AAIConstants.AAI_DEFAULT_API_VERSION); - } - } - - } - - } catch (Exception e) { - // TODO: we may want to log an error here - } - // TODO: should this check the value a little closer and look for a pattern? - if (apiVersion == null || !apiVersion.startsWith("v")) { + if (apiVersion == null || !apiVersion.startsWith("v")) { apiVersion = AAIConfig.get (AAIConstants.AAI_DEFAULT_API_VERSION_PROP, AAIConstants.AAI_DEFAULT_API_VERSION); //apiVersion = AAIConstants.AAI_DEFAULT_API_VERSION; } diff --git a/aai-utils/pom.xml b/aai-utils/pom.xml index 3775658a..c44227a9 100644 --- a/aai-utils/pom.xml +++ b/aai-utils/pom.xml @@ -113,4 +113,4 @@ - \ No newline at end of file + -- cgit 1.2.3-korg