Package org.eurekaj.api.datatypes

Examples of org.eurekaj.api.datatypes.Alert


            log.info("Got: " + jsonObject.toString());
            if (isAdmin(loggedInUser) && jsonObject.has("getAlertPlugins")) {
                jsonResponse = BuildJsonObjectsUtil.generateAlertPluginsJson(ManagerAlertPluginService.getInstance().getLoadedAlertPlugins());
                log.debug("Got Alert Plugins:\n" + jsonResponse);
            } else if (isAdmin(loggedInUser) && (isPut(e) || isPost(e))) {
                Alert parsedAlert = ParseJsonObjects.parseAlertJson(jsonObject, id, loggedInUser.getAccountName());
                if (parsedAlert != null && parsedAlert.getAlertName() != null && parsedAlert.getAlertName().length() > 0) {
                    getBerkeleyTreeMenuService().persistAlert(parsedAlert);
                }
                JSONObject alertTopObject = new JSONObject();
                alertTopObject.put("alert", BuildJsonObjectsUtil.generateAlertJSON(parsedAlert));
View Full Code Here


                Long fromPeriod = getFromPeriod(chartTimespan, keyObject);
                Long toPeriod = getToPeriod(keyObject);

                List<LiveStatistics> liveList = null;
                String seriesLabel = null;
                Alert alert = null;
                GroupedStatistics groupedStatistics = null;
                XYDataSetCollection valueCollection = new XYDataSetCollection();

                //TODO: This if-else code block needs refactoring. Its not DRY
                if (isAlertChart(id)) {
                    id = id.replaceAll("\\%20", " ").replaceAll("\\%25", "%");
                    String alertName = id.substring(8, id.length());
                    log.info("isAlert! " + alertName);
                    alert = getBerkeleyTreeMenuService().getAlert(alertName, loggedInAccountName);
                    if (alert != null) {
                        chartPath = alert.getGuiPath();
                        seriesLabel = "Alert: " + alert.getAlertName();
                    }

                    liveList = getBerkeleyTreeMenuService().getLiveStatistics(chartPath, loggedInAccountName, fromPeriod, toPeriod);
                    Collections.sort(liveList);
                    valueCollection = ChartUtil.generateChart(liveList, seriesLabel, fromPeriod * 15000, toPeriod * 15000, chartResolution);
View Full Code Here

TOP

Related Classes of org.eurekaj.api.datatypes.Alert

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.