Merge "AAFcli.java -Declare "value" on a separate line"
[aaf/authz.git] / auth / auth-gui / src / main / java / org / onap / aaf / auth / gui / pages / NssShow.java
index b2a6e36..3c3c0ed 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.
@@ -55,13 +55,13 @@ public class NssShow extends Page {
 
     public NssShow(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException {
         super(gui.env, "MyNamespaces",HREF, NO_FIELDS,
-                new BreadCrumbs(breadcrumbs), 
-                new Table<AAF_GUI,AuthzTrans>("Namespaces I administer",gui.env.newTransNoAvg(),new Model(true,"Administrator",gui.env), 
+                new BreadCrumbs(breadcrumbs),
+                new Table<AAF_GUI,AuthzTrans>("Namespaces I administer",gui.env.newTransNoAvg(),new Model(true,"Administrator",gui.env),
                         "class=std", "style=display: inline-block; width: 45%; margin: 10px;"),
                 new Table<AAF_GUI,AuthzTrans>("Namespaces I own",gui.env.newTransNoAvg(),new Model(false,"Owner",gui.env),
                         "class=std", "style=display: inline-block; width: 45%; margin: 10px;"));
     }
-    
+
     private static class Model extends TableData<AAF_GUI,AuthzTrans> {
         private String[] headers;
         private String privilege = null;
@@ -80,12 +80,12 @@ public class NssShow extends Page {
         public String[] headers() {
             return headers;
         }
-        
+
         @Override
         public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
             ArrayList<AbsCell[]> rv = new ArrayList<>();
             List<Ns> nss = trans.get(sNssByUser, null);
-            if(nss==null) {
+            if (nss==null) {
                 TimeTaken tt = trans.start("AAF Nss by User for " + privilege,Env.REMOTE);
                 try {
                     nss = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<List<Ns>>() {
@@ -93,10 +93,10 @@ public class NssShow extends Page {
                         public List<Ns> code(Rcli<?> client) throws CadiException, ConnectException, APIException {
                             List<Ns> nss = null;
                             Future<Nss> fp = client.read("/authz/nss/either/" + trans.user(),gui.getDF(Nss.class));
-                            if(fp.get(AAF_GUI.TIMEOUT)) {
+                            if (fp.get(AAF_GUI.TIMEOUT)) {
                                 TimeTaken tt = trans.start("Load Data for " + privilege, Env.SUB);
                                 try {
-                                    if(fp.value!=null) {
+                                    if (fp.value!=null) {
                                         nss = fp.value.getNs();
                                         Collections.sort(nss, new Comparator<Ns>() {
                                             public int compare(Ns ns1, Ns ns2) {
@@ -104,7 +104,7 @@ public class NssShow extends Page {
                                             }
                                         });
                                         trans.put(sNssByUser,nss);
-                                    } 
+                                    }
                                 } finally {
                                     tt.done();
                                 }
@@ -120,10 +120,10 @@ public class NssShow extends Page {
                     tt.done();
                 }
             }
-            
-            if(nss!=null) {
-                for(Ns n : nss) {
-                    if((isAdmin && !n.getAdmin().isEmpty())
+
+            if (nss!=null) {
+                for (Ns n : nss) {
+                    if ((isAdmin && !n.getAdmin().isEmpty())
                       || (!isAdmin && !n.getResponsible().isEmpty())) {
                         AbsCell[] sa = new AbsCell[] {
                             new RefCell(n.getName(),NsDetail.HREF
@@ -137,6 +137,6 @@ public class NssShow extends Page {
             return new Cells(rv,null);
         }
     }
-    
+
 
 }