1 25 26 package org.objectweb.jonas.webapp.jonasadmin.security; 27 28 import java.io.IOException ; 29 30 import javax.management.ObjectName ; 31 import javax.servlet.ServletException ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpServletResponse ; 34 35 import org.apache.struts.action.ActionForm; 36 import org.apache.struts.action.ActionForward; 37 import org.apache.struts.action.ActionMapping; 38 import org.objectweb.jonas.jmx.JonasManagementRepr; 39 import org.objectweb.jonas.jmx.JonasObjectName; 40 41 44 public class ApplyConfirmRealmsAction extends BaseSecurityAction { 45 46 48 public ActionForward executeAction(ActionMapping p_Mapping, ActionForm p_Form 49 , HttpServletRequest p_Request, HttpServletResponse p_Response) 50 throws IOException , ServletException { 51 52 String sForward = null; 53 54 ItemsRealmsForm oForm = (ItemsRealmsForm) p_Form; 56 57 try { 59 if (oForm.getAction().equals("remove") == true) { 61 RealmItem oRealmItem = null; 62 String [] asParam = new String [1]; 63 String [] asSignature = { 64 "java.lang.String"}; 65 ObjectName onSecurity = JonasObjectName.securityService(); 66 for (int i = 0; i < oForm.getSelectedRealmItem().size(); i++) { 67 oRealmItem = (RealmItem) oForm.getSelectedRealmItem().get(i); 68 asParam[0] = oRealmItem.getName(); 69 JonasManagementRepr.invoke(onSecurity, "removeJResource", asParam, asSignature); 70 } 71 } 72 m_Session.removeAttribute("itemsRealmsForm"); 74 refreshTree(); 76 } 77 78 catch (Throwable t) { 79 addGlobalError(t); 80 saveErrors(p_Request, m_Errors); 81 return (p_Mapping.findForward("Global Error")); 82 } 83 84 return (p_Mapping.findForward("ActionListRealms")); 86 } 87 88 90 } 91 | Popular Tags |