Examples of ApplicationConfig


Examples of org.jmanage.core.config.ApplicationConfig

            throws Exception{

        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_APPLICATIONS);

        ApplicationConfig config = context.getApplicationConfig();

        ConnectorForm connForm = (ConnectorForm)actionForm;

        connForm.setApplicationId(config.getApplicationId());
        connForm.setName(config.getName());
        connForm.setType(config.getType());

        Map paramValues = config.getParamValues();
        String connId = (String) paramValues.get(ConnectorForm.CONNECTOR_ID);
        ConnectorConfigData cfgData =
                ConnectorConfigRegistry.getConnectorConfigData(connId);

        String[] attrNames = cfgData.getFieldNames();
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

        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

Examples of org.jmanage.core.config.ApplicationConfig

    public ActionForward execute(WebContext context, ActionMapping mapping,
                                 ActionForm form, HttpServletRequest request,
                                 HttpServletResponse response)
        throws Exception {
        AccessController.checkAccess(Utils.getServiceContext(context),ACL_EDIT_ALERT);
        ApplicationConfig appConfig = context.getApplicationConfig();
        AlertConfig alertConfig = appConfig.removeAlert(
                request.getParameter(RequestParams.ALERT_ID));
        if(alertConfig != null){
            ApplicationConfigManager.updateApplication(appConfig);
            AlertEngine.getInstance().removeAlertConfig(alertConfig);
        }
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

    public ActionForward execute(WebContext context, ActionMapping mapping,
                                     ActionForm form, HttpServletRequest request,
                                     HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(Utils.getServiceContext(context),ACL_EDIT_GRAPH);
        ApplicationConfig appConfig = context.getApplicationConfig();
        if((appConfig.removeGraph(
                request.getParameter(RequestParams.GRAPH_ID))!=null)){
            ApplicationConfigManager.updateApplication(appConfig);

        }
        return mapping.findForward(Forwards.SUCCESS);
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(context.getServiceContext(),
                ACL_EDIT_APPLICATIONS);
        ApplicationForm appForm = (ApplicationForm)actionForm;
        ApplicationConfig config=ApplicationConfigManager.deleteApplication
                (appForm.getApplicationId());

        String appType = config.getType();
        if ("connector".equals(appType)) {
            ConnectorRegistry.remove(config);
        }
       
        /* unregister alerts for this application */
        AlertEngine.getInstance().removeApplication(config);

        UserActivityLogger.getInstance().logActivity(
                context.getUser().getUsername(),
                "Deleted application "+"\""+config.getName()+"\"");
        return mapping.findForward(Forwards.SUCCESS);
    }
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

                                 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(),
                logMsg);
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

    public int doStartTag() throws JspException{

        HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
        WebContext context = WebContext.get(request);
        ApplicationConfig appConfig = context.getApplicationConfig();
        // graphs at cluster level are not yet supported
        assert !appConfig.isCluster();
        GraphConfig graphConfig = appConfig.findGraph(id);

        HtmlElement applet = new HtmlElement("applet");
        applet.addAttribute("code", "org/jmanage/webui/applets/GraphApplet.class");
        applet.addAttribute("archive", "/applets/applets.jar,/applets/jfreechart-0.9.20.jar,/applets/jcommon-0.9.5.jar");
        applet.addAttribute("width", width);
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

                                 HttpServletResponse response)
            throws Exception {
        AccessController.checkAccess(Utils.getServiceContext(context), ACL_EDIT_ALERT);
        AlertForm form = (AlertForm)actionForm;
        String alertId = request.getParameter(RequestParams.ALERT_ID);
        ApplicationConfig appConfig = context.getApplicationConfig();
        AlertConfig alertConfig = appConfig.findAlertById(alertId);
        if(alertConfig!=null){
            form.setAlertName(alertConfig.getAlertName());
            form.setAlertDelivery(alertConfig.getAlertDelivery());
            form.setEmailAddress(alertConfig.getEmailAddress());
            AlertSourceConfig alertSrcConfig = alertConfig.getAlertSourceConfig();
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

     *
     * @param context
     * @return String representaion of HTML content that renders the component.
     */
    public String draw(DashboardContext context) {
        ApplicationConfig appConfig = context.getWebContext().getApplicationConfig();
        assert appConfig != null: "No application context present";
        try{
          if(getType().equalsIgnoreCase("PieChart")){

            StringBuffer graphComponent =
              new StringBuffer().append("<div id=\""+getId()+"\"><IFRAME width=\"500\" height=\"400\" style=\"border:0px\" src=\"/app/drawPieChartDashboardComponent.do?").append(
                  RequestParams.APPLICATION_ID).append("=").append(appConfig.getApplicationId()).append(
                  "&displayNames=").append(getAttributeDisplayNamesForGraph()).append(
                  "&attributes=").append(getAttributesForGraph(appConfig.getName())).append("&"+System.currentTimeMillis()+"\"></IFRAME></div>");
            return graphComponent.toString();
          }else{
            StringBuffer graphComponent = new StringBuffer().append(
            "<applet code=\"org/jmanage/webui/applets/GraphApplet.class\"").append(
            " width=\"{0}\" height=\"{1}\"").append(
            " archive=\"/applets/applets.jar,/applets/jfreechart-0.9.20.jar,").append(
            "/applets/jcommon-0.9.5.jar\" >").append(
                "<param name=\"graphTitle\" value=\""+getName()+"\"></param>").append(
                    "<param name=\"pollingInterval\" value=\""+getPollingIntervalInSeconds()+"\"></param>").append(
                        "<param name=\"remoteURL\" value=\""+context.getServerPath()+"/app/fetchAttributeValues.do;jsessionid={2}\"></param>").append(
                        "<param name=\"displayNames\" value=\"").append(getAttributeDisplayNamesForGraph()).append("\"></param>").append(
                        "<param name=\"attributes\" value=\"").append(getAttributesForGraph(appConfig.getName())).append("\"></param>").append(
                        "<param value=\"\" name=\"yAxisLabel\"></param>").append("</applet>");
            return graphComponent.toString();
          }
        }catch(Exception e){
            return "Failure rendering component";
View Full Code Here

Examples of org.jmanage.core.config.ApplicationConfig

    public int doStartTag() throws JspException{
        HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
        WebContext context = null;
        try{
            context = WebContext.get(request);
            ApplicationConfig appConfig = context.getApplicationConfig();
           
            // Graphs at cluster level are not supported yet
            assert !appConfig.isCluster();
            String dashboardId = request.getParameter("dashBID");
            DashboardConfig currentDashboardConfig = DashboardRepository.getInstance().get(dashboardId);
           
            assert currentDashboardConfig != null : "Error retrieving dashboard details";
            DashboardComponent component =
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.