"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "moskito-webui/src/main/java/net/anotheria/moskito/webui/threshold/util/ThresholdStatusBeanUtility.java" between
moskito-moskito-2.8.9.tar.gz and moskito-moskito-2.9.0.tar.gz

About: MoSKito (Monitoring System Kit) is a framework for java application monitoring. Sources.

ThresholdStatusBeanUtility.java  (moskito-moskito-2.8.9):ThresholdStatusBeanUtility.java  (moskito-moskito-2.9.0)
package net.anotheria.moskito.webui.threshold.util; package net.anotheria.moskito.webui.threshold.util;
import net.anotheria.anoplass.api.APIException; import net.anotheria.anoplass.api.APIException;
import net.anotheria.moskito.webui.dashboards.api.DashboardAO;
import net.anotheria.moskito.webui.threshold.api.ThresholdStatusAO; import net.anotheria.moskito.webui.threshold.api.ThresholdStatusAO;
import net.anotheria.moskito.webui.threshold.bean.ThresholdStatusBean; import net.anotheria.moskito.webui.threshold.bean.ThresholdStatusBean;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static net.anotheria.moskito.webui.util.APILookupUtility.getDashboardAPI; import static net.anotheria.moskito.webui.util.APILookupUtility.getDashboardAPI;
/** /**
* TODO comment this class * TODO comment this class
* *
* @author lrosenberg * @author lrosenberg
* @since 24/11/2016 15:40 * @since 24/11/2016 15:40
*/ */
public class ThresholdStatusBeanUtility { public class ThresholdStatusBeanUtility {
public static List<ThresholdStatusBean> getThresholdBeans(List<ThresholdS tatusAO> thresholdStatusAOList) throws APIException { public static List<ThresholdStatusBean> getThresholdBeans(List<ThresholdS tatusAO> thresholdStatusAOList) throws APIException {
List<ThresholdStatusBean> ret = new ArrayList<>(); List<ThresholdStatusBean> ret = new ArrayList<>();
if (thresholdStatusAOList == null || thresholdStatusAOList.size() == 0) if (thresholdStatusAOList == null || thresholdStatusAOList.size() == 0)
return ret; return ret;
List<DashboardAO> dashboardAOList = new ArrayList<>();
for(String name : getDashboardAPI().getDashboardNames()) {
dashboardAOList.add(getDashboardAPI().getDashboard(name))
;
}
for (ThresholdStatusAO thresholdStatusAO : thresholdStatusAOList) { for (ThresholdStatusAO thresholdStatusAO : thresholdStatusAOList) {
String dashboardNames = ""; String dashboardNames = getDashboardAPI().getDashboardNam
for(DashboardAO dashboardAO: dashboardAOList) { esWhichDoNotIncludeThisThreshold(thresholdStatusAO.getName());
if (dashboardAO.getThresholds() == null || !dashb
oardAO.getThresholds().contains(thresholdStatusAO)) {
dashboardNames += dashboardAO.getName()+"
,";
}
}
if (dashboardNames.length() > 0)
dashboardNames = dashboardNames.substring(0, dash
boardNames.length()-1);
ret.add(new ThresholdStatusBean(thresholdStatusAO, dashbo ardNames)); ret.add(new ThresholdStatusBean(thresholdStatusAO, dashbo ardNames));
} }
return ret; return ret;
} }
} }
 End of changes. 3 change blocks. 
17 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)