summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-core/src')
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java6
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java25
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CodeSetter.java2
3 files changed, 8 insertions, 25 deletions
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
index 867d2984..6d559de5 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
@@ -131,13 +131,13 @@ public class OrganizationFactory {
}
env.init().printf("Instantiated %s with %s%s",orgNS,orgClass,(isDefault?" as default":""));
}
- if (org==null) {
- if (defaultOrg!=null) {
+ if ( (org==null) && (defaultOrg!=null)){
+
org=defaultOrg;
orgs.put(orgNS, org);
}
}
- }
+
return org;
}
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java
index bd718e46..bf9f57e3 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java
@@ -45,8 +45,7 @@ class Acceptor<TRANS extends Trans> {
}
private boolean eval(HttpCode<TRANS,?> code, String str, List<String> props) {
-// int plus = str.indexOf('+');
-// if (plus<0) {
+
boolean ok = false;
boolean any = false;
for (Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>> type : types) {
@@ -61,23 +60,7 @@ class Acceptor<TRANS extends Trans> {
}
}
}
-// } else { // Handle Accepts with "+" as in application/xaml+xml
-// int prev = str.indexOf('/')+1;
-// String first = str.substring(0,prev);
-// String nstr;
-// while (prev!=0) {
-// nstr = first + (plus<0?str.substring(prev):str.substring(prev,plus));
-//
-// for (Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>> type : types) {
-// if (type.x.equals(nstr)) {
-// acceptable.add(type);
-// return type;
-// }
-// }
-// prev = plus+1;
-// plus=str.indexOf('+', prev);
-// };
-// }
+
return any;
}
@@ -93,9 +76,9 @@ class Acceptor<TRANS extends Trans> {
if (type.y!=null) {
for (Pair<String,Object> prop : type.y.y){
if (tag.equals(prop.x)) {
- if (tag.equals("charset")) {
+ if ( "charset".equals(tag)) {
return prop.x==null?false:prop.y.equals(value.toLowerCase()); // return True if Matched
- } else if (tag.equals("version")) {
+ } else if ("version".equals(tag)) {
return prop.y.equals(new Version(value)); // Note: Version Class knows Minor Version encoding
} else if (tag.equals(Content.Q)) { // replace Q value
try {
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CodeSetter.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CodeSetter.java
index 761fd8cc..172f386e 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CodeSetter.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CodeSetter.java
@@ -41,7 +41,7 @@ class CodeSetter<TRANS extends Trans> {
this.resp = resp;
}
- public boolean matches(Route<TRANS> route) throws IOException, ServletException {
+ public boolean matches(Route<TRANS> route) {
// Find best Code in Route based on "Accepts (Get) or Content-Type" (if exists)
return (code = route.getCode(trans, req, resp))!=null;
}