X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-gui%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fgui%2Fpages%2FUserRoleExtend.java;h=04e0e8450aaa9c26428b52bf5b87e896eb4b1906;hb=4b5a7d721d994a49057e9bfb403c7bff1b376660;hp=8a78fd74ee02b611ae1ae5a948cc157e0f41fa9b;hpb=6261a19e61138e861f5c7eaf37835205f19f1fe0;p=aaf%2Fauthz.git diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.java index 8a78fd74..04e0e845 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/UserRoleExtend.java @@ -42,58 +42,58 @@ import org.onap.aaf.misc.xgen.DynamicCode; import org.onap.aaf.misc.xgen.html.HTMLGen; public class UserRoleExtend extends Page { - public static final String HREF = "/gui/urExtend"; - static final String NAME = "Extend User Role"; - static final String fields[] = {"user","role"}; + public static final String HREF = "/gui/urExtend"; + static final String NAME = "Extend User Role"; + static final String fields[] = {"user","role"}; - public UserRoleExtend(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { - super(gui.env,NAME, HREF, fields, - new BreadCrumbs(breadcrumbs), - new NamedCode(true, "content") { - @Override - public void code(final Cache cache, final HTMLGen hgen) throws APIException, IOException { - final Slot sUser = gui.env.slot(NAME+".user"); - final Slot sRole = gui.env.slot(NAME+".role"); - - - cache.dynamic(hgen, new DynamicCode() { - @Override - public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache cache, final HTMLGen hgen) throws APIException, IOException { - final String user = trans.get(sUser, ""); - final String role = trans.get(sRole, ""); + public UserRoleExtend(final AAF_GUI gui, final Page ... breadcrumbs) throws APIException, IOException { + super(gui.env,NAME, HREF, fields, + new BreadCrumbs(breadcrumbs), + new NamedCode(true, "content") { + @Override + public void code(final Cache cache, final HTMLGen hgen) throws APIException, IOException { + final Slot sUser = gui.env.slot(NAME+".user"); + final Slot sRole = gui.env.slot(NAME+".role"); + + + cache.dynamic(hgen, new DynamicCode() { + @Override + public void code(final AAF_GUI gui, final AuthzTrans trans, final Cache cache, final HTMLGen hgen) throws APIException, IOException { + final String user = trans.get(sUser, ""); + final String role = trans.get(sRole, ""); - TimeTaken tt = trans.start("Request to extend user role",Env.REMOTE); - try { - gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { - @Override - public Void code(Rcli client)throws CadiException, ConnectException, APIException { - Future fv = client.update("/authz/userRole/extend/"+user+"/"+role+"?request=true"); - if(fv.get(5000)) { - // not sure if we'll ever hit this - hgen.p("Extended User ["+ user+"] in Role [" +role+"]"); - } else { - if (fv.code() == 202 ) { - hgen.p("User ["+ user+"] in Role [" +role+"] Extension sent for Approval"); - } else { - gui.writeError(trans, fv, hgen,0); - } - } - return null; - } - }); - } catch (Exception e) { - trans.error().log(e); - e.printStackTrace(); - } finally { - tt.done(); - } - - - } - }); - } - - }); - } + TimeTaken tt = trans.start("Request to extend user role",Env.REMOTE); + try { + gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { + @Override + public Void code(Rcli client)throws CadiException, ConnectException, APIException { + Future fv = client.update("/authz/userRole/extend/"+user+"/"+role+"?request=true"); + if(fv.get(5000)) { + // not sure if we'll ever hit this + hgen.p("Extended User ["+ user+"] in Role [" +role+"]"); + } else { + if (fv.code() == 202 ) { + hgen.p("User ["+ user+"] in Role [" +role+"] Extension sent for Approval"); + } else { + gui.writeError(trans, fv, hgen,0); + } + } + return null; + } + }); + } catch (Exception e) { + trans.error().log(e); + e.printStackTrace(); + } finally { + tt.done(); + } + + + } + }); + } + + }); + } }