summaryrefslogtreecommitdiffstats
path: root/aai-core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core/src/main')
-rw-r--r--aai-core/src/main/java/org/onap/aai/util/AAIApiVersion.java32
1 files changed, 3 insertions, 29 deletions
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;
}