Package org.jmanage.core.config

Examples of org.jmanage.core.config.ApplicationConfig


    private List<ApplicationConfig> getNewChildApplications(String[] childAppIds){
        /* build list of new child applications */
        List<ApplicationConfig> newChildApplications = new LinkedList<ApplicationConfig>();
        if(childAppIds != null){
            for(int i=0; i < childAppIds.length; i++){
                ApplicationConfig newChildApplication =
                        ApplicationConfigManager.getApplicationConfig(childAppIds[i]);
                newChildApplications.add(
                        newChildApplication);
            }
        }
View Full Code Here


        appConfigData = service.addApplication(Utils.getServiceContext(context), appConfigData);
       
        // TODO: This should be handled in a listener to NewApplicationEvent
        //      and ApplicationChangedEvent -rk
        /* add qualifying dashboards */
        ApplicationConfig appConfig =
            ApplicationConfigManager.getApplicationConfig(appConfigData.getApplicationId());
        List<String> dashboardIDs =
            DashboardRepository.getInstance().getQualifyingDashboardIDs(appConfig);
        appConfig.setDashboards(dashboardIDs);
        ApplicationConfigManager.updateApplication(appConfig);
       
        return mapping.findForward(Forwards.SUCCESS);
    }
View Full Code Here

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

        ApplicationConfig appConfig = context.getApplicationConfig();
        GraphForm form = (GraphForm)actionForm;
        String[] attributes = form.getAttributes();
        String[] displayNames = request.getParameterValues("displayNames");
        List<GraphAttributeConfig> graphAttrConfigs =
          new ArrayList<GraphAttributeConfig>(attributes.length);
        for(int i=0; i<attributes.length; i++){
            Expression expression = new Expression(attributes[i]);
            GraphAttributeConfig graphAttrConfig = new GraphAttributeConfig(
                    expression.getMBeanName(),expression.getTargetName(),
                    displayNames[i]);
            graphAttrConfigs.add(graphAttrConfig);
        }
        String graphId = request.getParameter(RequestParams.GRAPH_ID);
        GraphConfig graphConfig = null;
        if(graphId==null || graphId.equals("")){
            graphConfig = new GraphConfig(GraphConfig.getNextGraphId(),
                    form.getGraphName(), Long.parseLong(form.getPollInterval()),
                    appConfig, graphAttrConfigs);
            graphConfig.setYAxisLabel(form.getYAxisLabel());
            if(form.getScaleFactor() != null){
                graphConfig.setScaleFactor(new Double(form.getScaleFactor()));
                graphConfig.setScaleUp(Boolean.valueOf(form.getScaleUp()));
            }
            appConfig.addGraph(graphConfig);
        }else{
            graphConfig = appConfig.findGraph(graphId);
            graphConfig.setName(form.getGraphName());
            graphConfig.setAttributes(graphAttrConfigs);
            graphConfig.setPollingInterval(Long.parseLong(form.getPollInterval()));
            graphConfig.setYAxisLabel(form.getYAxisLabel());
            if(form.getScaleFactor() != null){
View Full Code Here


        AlertForm alertForm = (AlertForm)actionForm;
        String sourceType = alertForm.getAlertSourceType();
        assert sourceType != null;
        ApplicationConfig appConfig= context.getApplicationConfig();
       
        if(sourceType.equals(AlertSourceConfig.SOURCE_TYPE_APPLICATION_DOWN)){
            String url = "/config/showAddAlert.do?"
                +  RequestParams.APPLICATION_ID + "="
                + appConfig.getApplicationId() + "&"
                + RequestParams.ALERT_SOURCE_TYPE + "="
                + AlertSourceConfig.SOURCE_TYPE_APPLICATION_DOWN;
            return new ActionForward(url);
        }else if(sourceType.equals(AlertSourceConfig.SOURCE_TYPE_GAUGE_MONITOR)){
            String url = "/config/showMBeans.do?"
                    +  RequestParams.APPLICATION_ID + "="
                    + appConfig.getApplicationId() + "&"
                    + RequestParams.END_URL + "="
                    + Utils.urlEncode("/config/showAddAlert.do")+ "&"
                    + RequestParams.MULTIPLE + "=false&"
                    + RequestParams.ALERT_SOURCE_TYPE + "="
                    + AlertSourceConfig.SOURCE_TYPE_GAUGE_MONITOR + "&"
                    + RequestParams.DATA_TYPE + "=java.lang.Number&"
                    //+ RequestParams.DATA_TYPE + "=javax.management.openmbean.CompositeData&"
                    + RequestParams.NAVIGATION + "=Add Alert";
            return new ActionForward(url);
        } else if(sourceType.equals(AlertSourceConfig.SOURCE_TYPE_STRING_MONITOR)){
            String url = "/config/showMBeans.do?"
                    +  RequestParams.APPLICATION_ID + "="
                    + appConfig.getApplicationId() + "&"
                    + RequestParams.END_URL + "="
                    + Utils.urlEncode("/config/showAddAlert.do")+ "&"
                    + RequestParams.MULTIPLE + "=false&"
                    + RequestParams.ALERT_SOURCE_TYPE + "="
                    + AlertSourceConfig.SOURCE_TYPE_STRING_MONITOR +"&"
View Full Code Here

        ApplicationClusterForm clusterForm =
                (ApplicationClusterForm)actionForm;
        String applicationId = clusterForm.getApplicationId();
        List selectedApplications = null;
        if(applicationId != null){
            ApplicationConfig clusterConfig =
                    ApplicationConfigManager.getApplicationConfig(applicationId);
            assert clusterConfig.isCluster();
            clusterForm.setName(clusterConfig.getName());
            selectedApplications = clusterConfig.getApplications();
        }else{
            selectedApplications = new LinkedList();
        }

        List<ApplicationConfig> applications = new LinkedList<ApplicationConfig>();
        for(Iterator it=ApplicationConfigManager.getApplications().iterator();
            it.hasNext();){
            ApplicationConfig config = (ApplicationConfig)it.next();
            if(!config.isCluster() && !selectedApplications.contains(config)){
                applications.add(config);
            }
        }
        request.setAttribute("applications", applications);
        request.setAttribute("selectedApplications", selectedApplications);
View Full Code Here

                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        DashboardRepository instance = DashboardRepository.getInstance();
        ApplicationConfig appConfig = context.getApplicationConfig();
        String currentDashboardId = request.getParameter("dashBID");
        DashboardConfig currentDashboardConfig = null;
        for(String dashboardId : appConfig.getDashboards()){
            if(currentDashboardId.equals(dashboardId)){
                currentDashboardConfig = instance.get(dashboardId);
                break;
            }
        }
View Full Code Here

                                 ActionMapping mapping,
                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        ApplicationConfig appConfig = context.getApplicationConfig();
        DashboardSelectionForm dbForm = (DashboardSelectionForm)actionForm;
        dbForm.setDashboards(appConfig.getDashboards().toArray(new String[]{}));
        Collection<DashboardConfig> qualifyingDashboards =
                instance.getQualifyingDashboards(appConfig);
        request.setAttribute(RequestAttributes.QUALIFYING_DASHBOARDS,
                qualifyingDashboards);
        return mapping.findForward(Forwards.SUCCESS);
View Full Code Here

                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(context.getServiceContext(),ACL_EDIT_DASHBOARD);
        ApplicationConfig appConfig = context.getApplicationConfig();
        List<String> currentDashboards = appConfig.getDashboards();
        String dbToBeRemoved = request.getParameter(RequestParams.DASHBOARD_ID);
        assert((dbToBeRemoved != null && !dbToBeRemoved.trim().equals("")));
        currentDashboards.remove(dbToBeRemoved);
        appConfig.setDashboards(currentDashboards);
        ApplicationConfigManager.updateApplication(appConfig);
        return mapping.findForward(Forwards.SUCCESS);
    }
View Full Code Here

                                 HttpServletResponse response)
            throws Exception {
  AccessController.checkAccess(context.getServiceContext(),ACL_ADD_DASHBOARD);
  List<String> appConfigDashboards = new LinkedList<String>();
        DashboardSelectionForm dbForm = (DashboardSelectionForm)actionForm;
        ApplicationConfig appConfig = context.getApplicationConfig();
        for(String dbID : dbForm.getDashboards()){
            appConfigDashboards.add(dbID);
        }
        appConfig.setDashboards(appConfigDashboards);
        ApplicationConfigManager.updateApplication(appConfig);
        return mapping.findForward(Forwards.SUCCESS);
    }
View Full Code Here

                                 ActionForm actionForm,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        AlertForm form = (AlertForm)actionForm;
        ApplicationConfig appConfig = context.getApplicationConfig();
        AlertConfig alertConfig = null;
        String alertId = request.getParameter(RequestParams.ALERT_ID);
        if(alertId==null || alertId.equals("")){
            alertConfig = new AlertConfig(AlertConfig.getNextAlertId(),
                    form.getAlertName(),
                    form.getAlertDelivery(),
                    form.getEmailAddress());
            alertConfig.setAlertSourceConfig(getAlertSourceConfig(context,form));
            appConfig.addAlert(alertConfig);
        }else{
            alertConfig = appConfig.findAlertById(form.getAlertId());
            alertConfig.setAlertName(form.getAlertName());
            alertConfig.setAlertDelivery(form.getAlertDelivery());
            if(form.getEmailAddress()!=null){
                alertConfig.setEmailAddress(form.getEmailAddress());
            }
View Full Code Here

TOP

Related Classes of org.jmanage.core.config.ApplicationConfig

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.