Mass removal of all Tabs (Style Warnings)
[aaf/authz.git] / auth / auth-gui / src / main / java / org / onap / aaf / auth / gui / pages / RolesShow.java
index 80ff940..ffa8e3c 100644 (file)
@@ -56,85 +56,85 @@ import aaf.v2_0.UserRoles;
  *
  */
 public class RolesShow extends Page {
-       public static final String HREF = "/gui/myroles";
-       private static final String DATE_TIME_FORMAT = "yyyy-MM-dd";
-       
-       public RolesShow(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException {
-               super(gui.env, "MyRoles",HREF, NO_FIELDS,
-                       new BreadCrumbs(breadcrumbs), 
-                       new Table<AAF_GUI,AuthzTrans>("Roles",gui.env.newTransNoAvg(),new Model(), "class=std"));
-       }
+    public static final String HREF = "/gui/myroles";
+    private static final String DATE_TIME_FORMAT = "yyyy-MM-dd";
+    
+    public RolesShow(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException {
+        super(gui.env, "MyRoles",HREF, NO_FIELDS,
+            new BreadCrumbs(breadcrumbs), 
+            new Table<AAF_GUI,AuthzTrans>("Roles",gui.env.newTransNoAvg(),new Model(), "class=std"));
+    }
 
-       /**
-        * Implement the Table Content for Permissions by User
-        
-        * @author Jonathan
-        *
-        */
-       private static class Model extends TableData<AAF_GUI,AuthzTrans> {
-               private static final String[] headers = new String[] {"Role","Expires","Remediation","Actions"};
-               private static final String ROLE = "&role=";
-               private static final String USER = "?user=";
-               private static final String CLASS_EXPIRED = "class=expired";
+    /**
+     * Implement the Table Content for Permissions by User
+     * 
+     * @author Jonathan
+     *
+     */
+    private static class Model extends TableData<AAF_GUI,AuthzTrans> {
+        private static final String[] headers = new String[] {"Role","Expires","Remediation","Actions"};
+        private static final String ROLE = "&role=";
+        private static final String USER = "?user=";
+        private static final String CLASS_EXPIRED = "class=expired";
 
-               @Override
-               public String[] headers() {
-                       return headers;
-               }
-               
-               @Override
-               public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
-                       Cells rv = Cells.EMPTY;
+        @Override
+        public String[] headers() {
+            return headers;
+        }
+        
+        @Override
+        public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
+            Cells rv = Cells.EMPTY;
 
-                       try {
-                               rv = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Cells>() {
-                                       @Override
-                                       public Cells code(Rcli<?> client) throws CadiException, ConnectException, APIException {
-                                               ArrayList<AbsCell[]> rv = new ArrayList<>();
-                                               TimeTaken tt = trans.start("AAF Roles by User",Env.REMOTE);
-                                               try {
-                                                       Future<UserRoles> fur = client.read("/authz/userRoles/user/"+trans.user(),gui.getDF(UserRoles.class));
-                                                       if (fur.get(5000) && fur.value != null) for (UserRole u : fur.value.getUserRole()) {
-                                                                       if(u.getExpires().compare(Chrono.timeStamp()) < 0) {
-                                                                               AbsCell[] sa = new AbsCell[] {
-                                                                                               new TextCell(u.getRole() + "*", CLASS_EXPIRED),
-                                                                                               new TextCell(new SimpleDateFormat(DATE_TIME_FORMAT).format(u.getExpires().toGregorianCalendar().getTime()),CLASS_EXPIRED),
-                                                                                               new RefCell("Extend",
-                                                                                                               UserRoleExtend.HREF+USER+trans.user()+ROLE+u.getRole(),
-                                                                                                               false,
-                                                                                                               new String[]{CLASS_EXPIRED}),
-                                                                                               new RefCell("Remove",
-                                                                                                       UserRoleRemove.HREF+USER +trans.user()+ROLE+u.getRole(),
-                                                                                                       false,
-                                                                                                       new String[]{CLASS_EXPIRED})
-                                                                                                               
-                                                                                       };
-                                                                                       rv.add(sa);
-                                                                       } else {
-                                                                               AbsCell[] sa = new AbsCell[] {
-                                                                                               new RefCell(u.getRole(),
-                                                                                                               RoleDetail.HREF+"?role="+u.getRole(),
-                                                                                                               false),
-                                                                                               new TextCell(new SimpleDateFormat(DATE_TIME_FORMAT).format(u.getExpires().toGregorianCalendar().getTime())),
-                                                                                               AbsCell.Null,
-                                                                                               new RefCell("Remove",
-                                                                                                               UserRoleRemove.HREF+USER+trans.user()+ROLE+u.getRole(),
-                                                                                                               false)
-                                                                                       };
-                                                                                       rv.add(sa);
-                                                                       }
-                                                       }
-                                                       
-                                               } finally {
-                                                       tt.done();
-                                               }
-                                               return new Cells(rv,null);
-                                       }
-                               });
-                       } catch (Exception e) {
-                               trans.error().log(e);
-                       }
-                       return rv;
-               }
-       }
+            try {
+                rv = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Cells>() {
+                    @Override
+                    public Cells code(Rcli<?> client) throws CadiException, ConnectException, APIException {
+                        ArrayList<AbsCell[]> rv = new ArrayList<>();
+                        TimeTaken tt = trans.start("AAF Roles by User",Env.REMOTE);
+                        try {
+                            Future<UserRoles> fur = client.read("/authz/userRoles/user/"+trans.user(),gui.getDF(UserRoles.class));
+                            if (fur.get(5000) && fur.value != null) for (UserRole u : fur.value.getUserRole()) {
+                                    if(u.getExpires().compare(Chrono.timeStamp()) < 0) {
+                                        AbsCell[] sa = new AbsCell[] {
+                                                new TextCell(u.getRole() + "*", CLASS_EXPIRED),
+                                                new TextCell(new SimpleDateFormat(DATE_TIME_FORMAT).format(u.getExpires().toGregorianCalendar().getTime()),CLASS_EXPIRED),
+                                                new RefCell("Extend",
+                                                        UserRoleExtend.HREF+USER+trans.user()+ROLE+u.getRole(),
+                                                        false,
+                                                        new String[]{CLASS_EXPIRED}),
+                                                new RefCell("Remove",
+                                                    UserRoleRemove.HREF+USER +trans.user()+ROLE+u.getRole(),
+                                                    false,
+                                                    new String[]{CLASS_EXPIRED})
+                                                        
+                                            };
+                                            rv.add(sa);
+                                    } else {
+                                        AbsCell[] sa = new AbsCell[] {
+                                                new RefCell(u.getRole(),
+                                                        RoleDetail.HREF+"?role="+u.getRole(),
+                                                        false),
+                                                new TextCell(new SimpleDateFormat(DATE_TIME_FORMAT).format(u.getExpires().toGregorianCalendar().getTime())),
+                                                AbsCell.Null,
+                                                new RefCell("Remove",
+                                                        UserRoleRemove.HREF+USER+trans.user()+ROLE+u.getRole(),
+                                                        false)
+                                            };
+                                            rv.add(sa);
+                                    }
+                            }
+                            
+                        } finally {
+                            tt.done();
+                        }
+                        return new Cells(rv,null);
+                    }
+                });
+            } catch (Exception e) {
+                trans.error().log(e);
+            }
+            return rv;
+        }
+    }
 }