summaryrefslogtreecommitdiffstats
path: root/auth/auth-hello
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-10-15 08:19:50 -0500
committerInstrumental <jonathan.gathman@att.com>2019-10-15 08:35:35 -0500
commit1296352d8eafee57f982a4342ad79ada4aa56d28 (patch)
tree355cdb89d85530a861319f892b0f24236e6adc50 /auth/auth-hello
parentbdce7667a6e272e2fa32e298d957a0d9090c5bc9 (diff)
Sonar Fixes, Formatting
Issue-ID: AAF-1019 Change-Id: Ica49d9e7323aad9622ff9d95cc21b87430c22c54 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-hello')
-rw-r--r--auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/AAF_Hello.java30
-rw-r--r--auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java24
-rw-r--r--auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java8
3 files changed, 31 insertions, 31 deletions
diff --git a/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/AAF_Hello.java b/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/AAF_Hello.java
index cd9965cf..e5366ac6 100644
--- a/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/AAF_Hello.java
+++ b/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/AAF_Hello.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,19 +52,19 @@ public class AAF_Hello extends AbsService<AuthzEnv,AuthzTrans> {
public Map<String, Dated> cacheUser;
public AAFAuthn<?> aafAuthn;
public AAFLurPerm aafLurPerm;
-
+
/**
* Construct AuthzAPI with all the Context Supporting Routes that Authz needs
- *
+ *
* @param env
- * @param si
- * @param dm
- * @param decryptor
- * @throws APIException
+ * @param si
+ * @param dm
+ * @param decryptor
+ * @throws APIException
*/
public AAF_Hello(final AuthzEnv env) throws Exception {
super(env.access(), env);
-
+
aafLurPerm = aafCon().newLur();
// Note: If you need both Authn and Authz construct the following:
aafAuthn = aafCon().newAuthn(aafLurPerm);
@@ -73,29 +73,29 @@ public class AAF_Hello extends AbsService<AuthzEnv,AuthzTrans> {
if (aaf_env==null) {
throw new APIException("aaf_env needs to be set");
}
-
+
// Initialize Facade for all uses
AuthzTrans trans = env.newTrans();
StringBuilder sb = new StringBuilder();
trans.auditTrail(2, sb);
trans.init().log(sb);
-
+
API_Hello.init(this);
}
-
+
/**
* Setup XML and JSON implementations for each supported Version type
- *
+ *
* We do this by taking the Code passed in and creating clones of these with the appropriate Facades and properties
* to do Versions and Content switches
- *
+ *
*/
public void route(HttpMethods meth, String path, API api, HttpCode<AuthzTrans, AAF_Hello> code){
String version = "1.0";
// Get Correct API Class from Mapper
route(env,meth,path,code,"text/plain;version="+version,"*/*");
}
-
+
@Override
public Filter[] _filters(Object ... additionalTafLurs) throws CadiException, LocatorException {
try {
diff --git a/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java b/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java
index 814dff27..4ffb1787 100644
--- a/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java
+++ b/auth/auth-hello/src/main/java/org/onap/aaf/auth/hello/API_Hello.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -48,10 +48,10 @@ public class API_Hello {
// Hide Public Constructor
private API_Hello() {}
-
+
/**
* Normal Init level APIs
- *
+ *
* @param oauthHello
* @param facade
* @throws Exception
@@ -60,7 +60,7 @@ public class API_Hello {
////////
// Simple "GET" API
///////
-
+
oauthHello.route(HttpMethods.GET,"/hello/:perm*",API.TOKEN,new HttpCode<AuthzTrans, AAF_Hello>(oauthHello,"Hello OAuth"){
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
@@ -86,10 +86,10 @@ public class API_Hello {
os.print(')');
}
os.println();
-
+
trans.info().printf("Said 'Hello' to %s, Authentication type: %s",trans.getUserPrincipal().getName(),trans.getUserPrincipal().getClass().getSimpleName());
}
- });
+ });
////////////////
// REST APIs
@@ -115,7 +115,7 @@ public class API_Hello {
resp.setStatus(406);
}
}
- },APPLICATION_JSON);
+ },APPLICATION_JSON);
////////////////
@@ -147,8 +147,8 @@ public class API_Hello {
os.println(sb.toString());
trans.info().printf("Said 'RESTful Hello' to %s, Authentication type: %s",trans.getUserPrincipal().getName(),trans.getUserPrincipal().getClass().getSimpleName());
}
- },APPLICATION_JSON);
-
+ },APPLICATION_JSON);
+
////////////////
// UPDATE/PUT
////////////////
@@ -170,7 +170,7 @@ public class API_Hello {
resp.setStatus(406);
}
}
- },APPLICATION_JSON);
+ },APPLICATION_JSON);
////////////////
@@ -182,7 +182,7 @@ public class API_Hello {
trans.info().printf("Delete requested on %s\n", pathParam(req, ":id"));
resp.setStatus(200 /* OK */);
}
- },APPLICATION_JSON);
+ },APPLICATION_JSON);
}
}
diff --git a/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java b/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java
index e85431d3..2ed4efb1 100644
--- a/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java
+++ b/auth/auth-hello/src/test/java/org/onap/aaf/auth/hello/test/HelloTester.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -52,7 +52,7 @@ public class HelloTester {
SecurityInfoC<HttpURLConnection> si = SecurityInfoC.instance(access, HttpURLConnection.class);
AAFLocator loc = new AAFLocator(si,new URI(uriPrefix+"/locate/"+Define.ROOT_NS()+".hello:1.0"));
AAFConHttp aafcon = new AAFConHttp(access,loc,si);
-
+
//
String pathinfo = "/hello";
final int iterations = Integer.parseInt(access.getProperty("iterations","5"));
@@ -68,7 +68,7 @@ public class HelloTester {
System.err.println("Ooops, missed one: " + fs.code() + ": " + fs.body());
}
return null;
-
+
}
});
Thread.sleep(500L);