Package org.jmanage.webui.forms

Examples of org.jmanage.webui.forms.MBeanConfigForm


                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {

        MBeanConfigForm form = (MBeanConfigForm)actionForm;
        form.setObjectName("*:*");
        String managedObjLink = "/config/showMBeans.do?"
                + RequestParams.END_URL + "="
                + Utils.urlEncode("/config/showAddMBeanConfig.do")
                + "&" + RequestParams.SHOW_END_URL + "=true"
                + "&" + RequestParams.APPLY_ATTRIB_FILTER + "=false&"
View Full Code Here


                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(context.getServiceContext(), ACL_ADD_MBEAN_CONFIG);
        MBeanConfigForm mbeanConfigForm = (MBeanConfigForm)actionForm;
        ApplicationConfig applicationConfig = context.getApplicationConfig();

        if(mbeanConfigForm.isApplicationCluster()){
            /* mbean has to be added to the cluster */
            applicationConfig = applicationConfig.getClusterConfig();
            assert applicationConfig != null: "application not part of cluster";
        }
        String logMsg = null;
        //TODO: Usage of DynaForm should clean up this.
        if(request.getParameter(RequestParams.MULTI_MBEAN_CONFIG) != null){
            final String[] objectNames = mbeanConfigForm.getName();
            for(int mbeanCtr=0; mbeanCtr < objectNames.length; mbeanCtr++ ){
                final String configName = request.getParameter(objectNames[mbeanCtr]);
                if(GenericValidator.isBlankOrNull(configName) ||
                        applicationConfig.containsMBean(objectNames[mbeanCtr]))
                    continue;
                applicationConfig.addMBean(new MBeanConfig(configName,
                        objectNames[mbeanCtr]));
                ApplicationConfigManager.updateApplication(applicationConfig);

                if(mbeanConfigForm.isApplicationCluster()){
                    logMsg = "Added "+objectNames[mbeanCtr]+" to " +
                            "application cluster " + applicationConfig.getName();
                }else{
                    logMsg = "Added "+objectNames[mbeanCtr]+" to " +
                            "application " + applicationConfig.getName();
                }
                logMsg += "\n";
            }
        }else{
            final String configName = mbeanConfigForm.getName()[0];
            applicationConfig.addMBean(new MBeanConfig(configName,
                    mbeanConfigForm.getObjectName()));
            ApplicationConfigManager.updateApplication(applicationConfig);

            if(mbeanConfigForm.isApplicationCluster()){
                logMsg = "Added "+mbeanConfigForm.getObjectName()+" to " +
                        "application cluster " + applicationConfig.getName();
            }else{
                logMsg = "Added "+mbeanConfigForm.getObjectName()+" to " +
                        "application " + applicationConfig.getName();
            }
        }
        UserActivityLogger.getInstance().logActivity(
                context.getUser().getUsername(),
View Full Code Here

                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_MBEAN_CONFIG);
        String logMsg = null;
        MBeanConfigForm mbeanConfigForm = (MBeanConfigForm)actionForm;
        ApplicationConfig applicationConfig = context.getApplicationConfig();
        if(applicationConfig.removeMBean(mbeanConfigForm.getObjectName())
                != null){
            ApplicationConfigManager.updateApplication(applicationConfig);
            logMsg = "Removed mbean " + mbeanConfigForm.getObjectName() +
                        " from application "+ applicationConfig.getName();
        }else{
            ApplicationConfig clusterConfig =
                    applicationConfig.getClusterConfig();
            if(clusterConfig != null){
                clusterConfig.removeMBean(mbeanConfigForm.getObjectName());
                ApplicationConfigManager.updateApplication(clusterConfig);
                logMsg = "Removed mbean " + mbeanConfigForm.getObjectName() +
                    " from application cluster "+ clusterConfig.getName();
            }
        }

        if(logMsg != null){
View Full Code Here

        request.setAttribute("objInfo", objInfo);
        request.setAttribute("appConfigToAttrListMap", appConfigToAttrListMap);

        /* setup the form to be used in the html form */
        MBeanConfigForm mbeanConfigForm = (MBeanConfigForm)actionForm;
        mbeanConfigForm.setObjectName(objectName.getCanonicalName());

        ApplicationConfig appConfig = context.getApplicationConfig();
        MBeanConfig mbeanConfig =
                appConfig.findMBeanByObjectName(objectName.getCanonicalName());
        if(mbeanConfig != null){
View Full Code Here

TOP

Related Classes of org.jmanage.webui.forms.MBeanConfigForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.