Package com.sun.appserv.management.config

Examples of com.sun.appserv.management.config.ManagementRuleConfig


        boolean hasOrig = (selectedList == null || selectedList.size()==0) ? false: true;
       
        List result = new ArrayList();
        if (iter != null){
            while(iter.hasNext()){
                ManagementRuleConfig mgRuleConfig = (ManagementRuleConfig) iter.next();
                HashMap oneRow = new HashMap();
                String name = mgRuleConfig.getName();
                oneRow.put("name", name); //NOI18N
                oneRow.put("selected", (hasOrig)? ConnectorsHandlers.isSelected(name, selectedList): false); //NOI18N
                boolean rulesEnabled = mgRuleConfig.getEnabled();
                String rulesStatus = null;
                if(rulesEnabled) {
                    rulesStatus = "Enabled"; //NOI18N
                } else {
                    rulesStatus = "Disabled"; //NOI18N
                }  
                String eventType = mgRuleConfig.getEventConfig().getType();
                oneRow.put("ruleStatus", (rulesStatus == null) ? " ": rulesStatus); //NOI18N
                oneRow.put("eventType", (eventType == null) ? " ": eventType); //NOI18N
                result.add(oneRow);
            }
        }
View Full Code Here


        public static void getManagementRuleValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName");
            String ruleName = (String) handlerCtx.getInputValue("RuleName");
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            handlerCtx.setOutputValue("Status", mgRuleConfig.getEnabled());
            handlerCtx.setOutputValue("RuleDesc", mgRuleConfig.getDescription());
            handlerCtx.setOutputValue("RecordEvent", mgRuleConfig.getEventConfig().getRecordEvent());
            handlerCtx.setOutputValue("LogLevel", mgRuleConfig.getEventConfig().getLevel());
            handlerCtx.setOutputValue("EventDesc", mgRuleConfig.getEventConfig().getDescription());
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        public static void getCommonEventValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName"); //NOI18N
            String ruleName = (String) handlerCtx.getInputValue("RuleName"); //NOI18N
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            Map<String,String> propMap = mgRuleConfig.getEventConfig().getProperties();
            SelectItem[] events = null;
            String type = mgRuleConfig.getEventConfig().getType();
            if(type.equals("lifecycle")){
                events = ConfigurationHandlers.getOptions(lifeCycleEvents);
            }else if(type.equals("trace")){
                events = ConfigurationHandlers.getOptions(traceEvents);
            }
            if(mgRuleConfig.getActionConfig() != null){
                handlerCtx.setOutputValue("Action", mgRuleConfig.getActionConfig().getActionMBeanName()); //NOI18N
            }
            handlerCtx.setOutputValue("Event", propMap.get("event")); //NOI18N
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
View Full Code Here

        public static void saveCommonEventValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName"); //NOI18N
            String ruleName = (String) handlerCtx.getInputValue("RuleName"); //NOI18N
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            String type = mgRuleConfig.getEventConfig().getType();
            mgRuleConfig.setEnabled(((Boolean)handlerCtx.getInputValue("Status")).booleanValue());
            mgRuleConfig.setDescription((String)handlerCtx.getInputValue("RuleDesc"));
            mgRuleConfig.getEventConfig().setRecordEvent(((Boolean)handlerCtx.getInputValue("RecordEvent")).booleanValue());
            mgRuleConfig.getEventConfig().setLevel((String)handlerCtx.getInputValue("LogLevel"));
            mgRuleConfig.getEventConfig().setDescription((String)handlerCtx.getInputValue("EventDesc"));
            if(type.equals("lifecycle") || type.equals("trace")) { //NOI18N
                mgRuleConfig.getEventConfig().setPropertyValue("event", (String) handlerCtx.getInputValue("Event"));
            }
            saveActionProperty(mgRuleConfig, handlerCtx);
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
View Full Code Here

        public static void getNotifEventValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName"); //NOI18N
            String ruleName = (String) handlerCtx.getInputValue("RuleName"); //NOI18N
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            Map<String,String> propMap = mgRuleConfig.getEventConfig().getProperties();
            String mbeanName = propMap.get("sourceobjectname"); //NOI18N
            String[] beanNames = getSourceMbeansNames("notification", configName);
            if(Arrays.asList(beanNames).contains(mbeanName)){
                handlerCtx.setOutputValue("SrcGroup", "1"); //NOI18N
                handlerCtx.setOutputValue("CustomMbeanName", mbeanName);
            }else{
                handlerCtx.setOutputValue("SrcGroup", "2"); //NOI18N
                handlerCtx.setOutputValue("ObjName", mbeanName);
            }
            handlerCtx.setOutputValue("CustomMbeanList", getSourceMbeans("notification", configName)); //NOI18N
            handlerCtx.setOutputValue("NotifType", propMap.get("type")); //NOI18N
            if(mgRuleConfig.getActionConfig() != null){
                handlerCtx.setOutputValue("Action", mgRuleConfig.getActionConfig().getActionMBeanName()); //NOI18N
            }
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        public static void getMonitorEventValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName");
            String ruleName = (String) handlerCtx.getInputValue("RuleName");
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            Map<String,String> propMap = mgRuleConfig.getEventConfig().getProperties();
            SelectItem[] numtypes = ConfigurationHandlers.getOptions(numTypes);
            String monitorType = propMap.get("monitortype");
           
            handlerCtx.setOutputValue("ObservedMbean", propMap.get("observedobject"));
            handlerCtx.setOutputValue("ObservedAttr", propMap.get("observedattribute"));
            handlerCtx.setOutputValue("Granularity", propMap.get("granularityperiod"));
                       
            if(monitorType.equals("countermonitor") || monitorType.equals("gaugemonitor")){
                handlerCtx.setOutputValue("isString", false);
                handlerCtx.setOutputValue("DiffMode", propMap.get("differencemode"));
                handlerCtx.setOutputValue("NumType", propMap.get("numbertype"));
                handlerCtx.setOutputValue("NumTypesList", numtypes);
                if(monitorType.equals("countermonitor")){
                    handlerCtx.setOutputValue("isCounter", true);
                    handlerCtx.setOutputValue("isGauge", false);
                    handlerCtx.setOutputValue("MonitorType", "Counter");
                    handlerCtx.setOutputValue("InitThreshold", propMap.get("initthreshold"));
                    handlerCtx.setOutputValue("Offset", propMap.get("offset"));
                    handlerCtx.setOutputValue("Modulus", propMap.get("modulus"));
                }
                if(monitorType.equals("gaugemonitor")){
                    handlerCtx.setOutputValue("isGauge", true);
                    handlerCtx.setOutputValue("isCounter", false);
                    handlerCtx.setOutputValue("MonitorType", "Gauge");
                    handlerCtx.setOutputValue("LowThresh", propMap.get("lowthreshold"));
                    handlerCtx.setOutputValue("HighThresh", propMap.get("highthreshold"));
                }
            }
            if(monitorType.equals("stringmonitor")){
                handlerCtx.setOutputValue("isString", true);
                handlerCtx.setOutputValue("isCounter", false);
                handlerCtx.setOutputValue("isGauge", false);
                handlerCtx.setOutputValue("MonitorType", "String");
                SelectItem[] triggersList = ConfigurationHandlers.getOptions(triggerValues, triggerTypes)
                handlerCtx.setOutputValue("TriggersList", triggersList);
                handlerCtx.setOutputValue("Trigger", propMap.get("stringnotify"));
                handlerCtx.setOutputValue("ValueProp", propMap.get("stringtocompare"));
            }
            if(mgRuleConfig.getActionConfig() != null){
                handlerCtx.setOutputValue("Action", mgRuleConfig.getActionConfig().getActionMBeanName()); //NOI18N
            }
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        public static void getTimerEventValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName"); //NOI18N
            String ruleName = (String) handlerCtx.getInputValue("RuleName"); //NOI18N
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            Map<String,String> propMap = mgRuleConfig.getEventConfig().getProperties();
            handlerCtx.setOutputValue("DateString", propMap.get("datestring")); //NOI18N
            handlerCtx.setOutputValue("Pattern", propMap.get("pattern")); //NOI18N
            handlerCtx.setOutputValue("Period", propMap.get("period")); //NOI18N
            handlerCtx.setOutputValue("NoOccurences", propMap.get("numberofoccurrences")); //NOI18N
            handlerCtx.setOutputValue("Message", propMap.get("message")); //NOI18N
            if(mgRuleConfig.getActionConfig() != null){
                handlerCtx.setOutputValue("Action", mgRuleConfig.getActionConfig().getActionMBeanName()); //NOI18N
            }
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        public static void getLogEventValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName"); //NOI18N
            String ruleName = (String) handlerCtx.getInputValue("RuleName"); //NOI18N
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            Map<String,String> propMap = mgRuleConfig.getEventConfig().getProperties();
            handlerCtx.setOutputValue("Level", propMap.get("level")); //NOI18N
            String[] loggers = getLoggerNames();
            SelectItem[] options = ConfigurationHandlers.getOptions(loggers);
            handlerCtx.setOutputValue("LoggerList", options);
            if(loggers.length > 0){
                handlerCtx.setOutputValue("Logger", propMap.get("loggernames")); //NOI18N
            }
            if(mgRuleConfig.getActionConfig() != null){
                handlerCtx.setOutputValue("Action", mgRuleConfig.getActionConfig().getActionMBeanName()); //NOI18N
            }
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        public static void getClusterEventValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName"); //NOI18N
            String ruleName = (String) handlerCtx.getInputValue("RuleName"); //NOI18N
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
            Map<String,String> propMap = mgRuleConfig.getEventConfig().getProperties();
            handlerCtx.setOutputValue("Event", propMap.get("name")); //NOI18N
            handlerCtx.setOutputValue("ServerName", propMap.get("servername")); //NOI18N
            handlerCtx.setOutputValue("ServerNamesList", ConfigurationHandlers.getOptions(getTargetNames())); //NOI18N
            if(mgRuleConfig.getActionConfig() != null){
                handlerCtx.setOutputValue("Action", mgRuleConfig.getActionConfig().getActionMBeanName()); //NOI18N
            }
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        public static void saveManagementRuleValues(HandlerContext handlerCtx) {
        try{
            String configName = (String) handlerCtx.getInputValue("ConfigName");
            String ruleName = (String) handlerCtx.getInputValue("RuleName");
            ConfigConfig config = AMXUtil.getConfig(configName);
            ManagementRuleConfig mgRuleConfig = config.getManagementRulesConfig().getManagementRuleConfigMap().get(ruleName);
           
            mgRuleConfig.setEnabled(((Boolean)handlerCtx.getInputValue("Status")).booleanValue());
            mgRuleConfig.setDescription((String)handlerCtx.getInputValue("RuleDesc"));
            mgRuleConfig.getEventConfig().setRecordEvent(((Boolean)handlerCtx.getInputValue("RecordEvent")).booleanValue());
            mgRuleConfig.getEventConfig().setLevel((String)handlerCtx.getInputValue("LogLevel"));
            mgRuleConfig.getEventConfig().setDescription((String)handlerCtx.getInputValue("EventDesc"));
        }catch (Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.config.ManagementRuleConfig

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.