Sonar Fixes, Formatting
[aaf/authz.git] / auth / auth-certman / src / main / java / org / onap / aaf / auth / cm / api / API_Cert.java
index 625fed6..0f239ad 100644 (file)
@@ -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.
@@ -36,7 +36,7 @@ import org.onap.aaf.misc.env.Slot;
 
 /**
  * API Apis.. using Redirect for mechanism
- * 
+ *
  * @author Jonathan
  *
  */
@@ -46,7 +46,7 @@ public class API_Cert {
 
     /**
      * Normal Init level APIs
-     * 
+     *
      * @param aafCM
      * @param facade
      * @throws Exception
@@ -54,7 +54,7 @@ public class API_Cert {
     public static void init(final AAF_CM aafCM) throws Exception {
         // Check for Created Certificate Authorities in TRANS
         sCertAuth = aafCM.env.slot(CERT_AUTH);
-        
+
         ////////
         // Overall APIs
         ///////
@@ -63,12 +63,12 @@ public class API_Cert {
             public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
                 String key = pathParam(req, ":ca");
                 CA ca;
-                if((ca = aafCM.getCA(key))==null) {
+                if ((ca = aafCM.getCA(key))==null) {
                     context.error(trans,resp,Result.ERR_BadData,"CA %s is not supported",key);
                 } else {
                     trans.put(sCertAuth, ca);
                     Result<Void> r = context.requestCert(trans, req, resp, ca);
-                    if(r.isOK()) {
+                    if (r.isOK()) {
                         resp.setStatus(HttpStatus.OK_200);
                     } else {
                         context.error(trans,resp,r);
@@ -76,18 +76,18 @@ public class API_Cert {
                 }
             }
         });
-        
+
         aafCM.route(HttpMethods.GET,"/cert/:ca/personal",API.CERT,new Code(aafCM,"Request Personal Certificate") {
             @Override
             public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
                 String key = pathParam(req, ":ca");
                 CA ca;
-                if((ca = aafCM.getCA(key))==null) {
+                if ((ca = aafCM.getCA(key))==null) {
                     context.error(trans,resp,Result.ERR_BadData,"CA %s is not supported",key);
                 } else {
                     trans.put(sCertAuth, ca);
                     Result<Void> r = context.requestPersonalCert(trans, req, resp, ca);
-                    if(r.isOK()) {
+                    if (r.isOK()) {
                         resp.setStatus(HttpStatus.OK_200);
                     } else {
                         context.error(trans,resp,r);
@@ -96,15 +96,15 @@ public class API_Cert {
             }
         });
 
-        
+
         /**
-         * 
+         *
          */
         aafCM.route(HttpMethods.GET, "/cert/may/:perm", API.VOID, new Code(aafCM,"Check Permission") {
             @Override
             public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
                 Result<Void> r = context.check(trans, resp, pathParam(req,"perm"));
-                if(r.isOK()) {
+                if (r.isOK()) {
                     resp.setStatus(HttpStatus.OK_200);
                 } else {
                     trans.checkpoint(r.errorString());
@@ -114,10 +114,10 @@ public class API_Cert {
         });
 
         /**
-         * Get Cert by ID and Machine 
+         * Get Cert by ID and Machine
          */
 
-        
+
         /**
          * Get Certs by ID
          */
@@ -125,7 +125,7 @@ public class API_Cert {
             @Override
             public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
                 Result<Void> r = context.readCertsByMechID(trans, resp, pathParam(req,"id"));
-                if(r.isOK()) {
+                if (r.isOK()) {
                     resp.setStatus(HttpStatus.OK_200);
                 } else {
                     context.error(trans,resp,r);
@@ -133,10 +133,10 @@ public class API_Cert {
             }
         });
 
-        
+
         /**
          * Get Certs by Machine
          */
-        
+
     }
 }