Examples of AlertConfig


Examples of com.dianping.cat.home.alert.config.entity.AlertConfig

    try {
      if (StringUtils.isEmpty(allOnOrOff)) {
        return originXml;
      }
     
      AlertConfig tmpConfig = DefaultSaxParser.parse(originXml);

      if (allOnOrOff.equals("on")) {
        turnOnOrOffConfig(tmpConfig, true);
      } else if (allOnOrOff.equals("off")) {
        turnOnOrOffConfig(tmpConfig, false);
      }
     
      return tmpConfig.toString();
    } catch (Exception e) {
      Cat.logError(e);
      return null;
    }
   }
View Full Code Here

Examples of com.dianping.cat.home.alert.config.entity.AlertConfig

      }
    } catch (Exception e) {
      Cat.logError(e);
    }
    if (m_config == null) {
      m_config = new AlertConfig();
    }
  }
View Full Code Here

Examples of org.jmanage.core.config.AlertConfig

    private AlertEngine(){}

    public void start(){
        List alertConfigs = ApplicationConfigManager.getAllAlerts();
        for(Iterator it=alertConfigs.iterator(); it.hasNext();){
            AlertConfig alertConfig = (AlertConfig)it.next();
            Alert alert = new Alert(alertConfig);
            alert.register();
        }
        /* get EmailAlerts to start the email delivery thread */
        EmailAlerts.getInstance();
View Full Code Here

Examples of org.jmanage.core.config.AlertConfig

        }
    }

    public synchronized void updateApplication(ApplicationConfig config){
        for(Iterator it=config.getAlerts().iterator(); it.hasNext(); ){
            AlertConfig alertConfig = (AlertConfig)it.next();
            updateAlertConfig(alertConfig);
        }
    }
View Full Code Here

Examples of org.jmanage.core.config.AlertConfig

        }
    }

    public synchronized void removeApplication(ApplicationConfig config){
        for(Iterator it=config.getAlerts().iterator(); it.hasNext(); ){
            AlertConfig alertConfig = (AlertConfig)it.next();
            removeAlertConfig(alertConfig);
        }
    }
View Full Code Here

Examples of org.jmanage.core.config.AlertConfig

                                 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());
            }
            alertConfig.setAlertSourceConfig(getAlertSourceConfig(context,form));
        }
        ApplicationConfigManager.updateApplication(appConfig);

        /* tell the AlertEngine about the new or modified AlertConfig*/
        AlertEngine.getInstance().updateAlertConfig(alertConfig);
View Full Code Here

Examples of org.jmanage.core.config.AlertConfig

                                 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.AlertConfig

            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();
            String sourceType = alertSrcConfig.getSourceType();
            form.setAlertSourceType(alertSrcConfig.getSourceType());
            request.setAttribute("alertSourceType",sourceType);
            request.setAttribute("sourceMBean", alertSrcConfig.getObjectName());
            // expression
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.