Examples of AlertStatus


Examples of org.apache.helix.model.AlertStatus

    logger.debug("persistAlerts retVal: " + retVal);
  }

  public void persistAlertStatus() {
    // XXX: Am I using _accessor too directly here?
    AlertStatus alertStatus = _accessor.getProperty(_keyBuilder.alertStatus());
    if (alertStatus == null) {
      alertStatus = new AlertStatus(AlertStatus.nodeName); // TODO: fix naming of this record, if it
                                                           // matters
    }
    alertStatus.getRecord().setMapFields(_alertStatusMap);
    boolean retVal = _accessor.setProperty(_keyBuilder.alertStatus(), alertStatus);
    logger.debug("persistAlerts retVal: " + retVal);
  }
View Full Code Here

Examples of org.apache.helix.model.AlertStatus

      if (currStatus != null) {
        addAlertStatus(alert, currStatus);
      }
    }

    AlertStatus alertStatus = _accessor.getProperty(_keyBuilder.alertStatus());
    int alertStatusSize = 0;
    if (alertStatus != null) {
      alertStatusSize = alertStatus.getMapFields().size();
    }
    // no need to persist alerts if there are none to persist and none are currently persisted
    if (_alertStatusMap.size() > 0 || alertStatusSize > 0) {
      persistAlertStatus(); // save statuses in zk
    }
View Full Code Here

Examples of org.apache.helix.model.AlertStatus

     * }\
     */
  }

  public void refreshAlertStatus() {
    AlertStatus alertStatusRecord = _cache.getAlertStatus();
    if (alertStatusRecord != null) {
      _alertStatusMap = alertStatusRecord.getMapFields();
    } else {
      _alertStatusMap = new HashMap<String, Map<String, String>>();
    }
  }
View Full Code Here

Examples of org.apache.helix.model.AlertStatus

    logger.debug("persistAlerts retVal: " + retVal);
  }

  public void persistAlertStatus() {
    // XXX: Am I using _accessor too directly here?
    AlertStatus alertStatus = _accessor.getProperty(_keyBuilder.alertStatus());
    if (alertStatus == null) {
      alertStatus = new AlertStatus(AlertStatus.nodeName); // TODO: fix naming of this record, if it
                                                           // matters
    }
    alertStatus.getRecord().setMapFields(_alertStatusMap);
    boolean retVal = _accessor.setProperty(_keyBuilder.alertStatus(), alertStatus);
    logger.debug("persistAlerts retVal: " + retVal);
  }
View Full Code Here

Examples of org.apache.helix.model.AlertStatus

      if (currStatus != null) {
        addAlertStatus(alert, currStatus);
      }
    }

    AlertStatus alertStatus = _accessor.getProperty(_keyBuilder.alertStatus());
    int alertStatusSize = 0;
    if (alertStatus != null) {
      alertStatusSize = alertStatus.getMapFields().size();
    }
    // no need to persist alerts if there are none to persist and none are currently persisted
    if (_alertStatusMap.size() > 0 || alertStatusSize > 0) {
      persistAlertStatus(); // save statuses in zk
    }
View Full Code Here

Examples of org.eurekaj.api.enumtypes.AlertStatus

       
        //Get alerts for account
        for (Alert alert : dbPlugin.getAlertDao().getAlerts(accountName)) {
          logger.info("Evaluating alert: " + alert.getAlertName() + " for account: " + alert.getAccountName());
          if (alert.isActivated()) {
            AlertStatus oldStatus = alert.getStatus();
            List<LiveStatistics> statList = getStatistic(alert.getGuiPath(), alert.getAlertDelay(), account.getId());
            //Get statistics and evaluate alert condition
            AlertStatus newStatus = evaluateStatistics(alert, statList);
            if (oldStatus != newStatus && statList.size() >= 1) {
                        //Status have changed, store new triggeredAlert and send email
              logger.info("Alert status changed: " + newStatus.getStatusName() + " num plugins: " + alert.getSelectedEmailSenderList().size());
 
              for (String alertPluginId : alert.getSelectedEmailSenderList()) {
                AlertRecipient alertRecipient = dbPlugin.getAlertRecipientDao().getAlertRecipient(alert.getAccountName(), alertPluginId);
                List<String> recipients = new ArrayList<>();
                for (String idObject : alertRecipient.getRecipients()) {
                  recipients.add(idObject);
                }
               
                logger.info("Sending alert through plugin: " + alertPluginId);
               
                ManagerAlertPluginService.getInstance().sendAlert(alertRecipient, recipients, alert, oldStatus, getCurrentValue(statList), "" + System.currentTimeMillis());
               
              }
             
             
              BasicTriggeredAlert triggeredAlert = new BasicTriggeredAlert();
              triggeredAlert.setAccountName(accountName);
              triggeredAlert.setAlertName(alert.getAlertName());
              triggeredAlert.setAlertValue(getCurrentValue(statList));
              triggeredAlert.setErrorValue(alert.getErrorValue());
              triggeredAlert.setTimeperiod(System.currentTimeMillis() / 15000);
              triggeredAlert.setWarningValue(alert.getWarningValue());
              logger.info("Persisitng triggered alert for alert: " + alert.getAlertName() + " for account: " + alert.getAccountName());
             
              dbPlugin.getAlertDao().persistTriggeredAlert(triggeredAlert);
             
              BasicAlert basicAlert = new BasicAlert(alert);
              basicAlert.setStatus(newStatus);
              logger.info("Persisitng new status for alert: " + basicAlert.getAlertName() + " for account: " + basicAlert.getAccountName() + " new status: " + basicAlert.getStatus().getStatusName());
              dbPlugin.getAlertDao().persistAlert(basicAlert);
            } else {
              logger.info("Alert status remains: " + newStatus.getStatusName());
            }
          } else {
            logger.info("Alert not active: " + alert.getAlertName());
          }
        }
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.