Package org.jmanage.core.config

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


        }
    }

    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

        }
    }

    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

                                 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

                                 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

            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

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

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.