Package org.eurekaj.api.datatypes.basic

Examples of org.eurekaj.api.datatypes.basic.BasicTriggeredAlert


  }

  @Override
  public void persistTriggeredAlert(TriggeredAlert triggeredAlert) {
    db.put(bytes(triggeredAlertlertBucketKey + triggeredAlert.getAccountName() + ";" + triggeredAlert.getAlertName() + ";" + triggeredAlert.getTimeperiod()),
        bytes(gson.toJson(new BasicTriggeredAlert(triggeredAlert))));
  }
View Full Code Here


    List<TriggeredAlert> triggeredAlertList = new ArrayList<>();
   
    DBIterator iterator = db.iterator();
    iterator.seek(bytes(triggeredAlertlertBucketKey + accountName));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(triggeredAlertlertBucketKey + accountName)) {
      BasicTriggeredAlert triggeredAlert = gson.fromJson(asString(iterator.next().getValue()), BasicTriggeredAlert.class);
      if (triggeredAlert.getTriggeredTimeperiod() >= fromTimeperiod && triggeredAlert.getTriggeredTimeperiod() <= toTimeperiod) {
        triggeredAlertList.add(triggeredAlert);
      }
    }
   
    return triggeredAlertList;
View Full Code Here

List<TriggeredAlert> triggeredAlertList = new ArrayList<>();
   
    DBIterator iterator = db.iterator();
    iterator.seek(bytes(triggeredAlertlertBucketKey + accountName + ";" + alertname));
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(triggeredAlertlertBucketKey + accountName + ";" + alertname)) {
      BasicTriggeredAlert triggeredAlert = gson.fromJson(asString(iterator.next().getValue()), BasicTriggeredAlert.class);
      if (triggeredAlert.getTriggeredTimeperiod() >= fromTimeperiod && triggeredAlert.getTriggeredTimeperiod() <= toTimeperiod) {
        triggeredAlertList.add(triggeredAlert);
      }
    }
   
    return triggeredAlertList;
View Full Code Here

   
    DBIterator iterator = db.iterator();
    iterator.seek(bytes(triggeredAlertlertBucketKey + accountName));
    int foundAlerts = 0;
    while (iterator.hasNext() && asString(iterator.peekNext().getKey()).startsWith(triggeredAlertlertBucketKey + accountName)) {
      BasicTriggeredAlert triggeredAlert = gson.fromJson(asString(iterator.next().getValue()), BasicTriggeredAlert.class);
      triggeredAlertList.add(triggeredAlert);
      foundAlerts++;
      if (foundAlerts >= numAlerts) { break; }
    }
   
View Full Code Here

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

TOP

Related Classes of org.eurekaj.api.datatypes.basic.BasicTriggeredAlert

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.