"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "moskito-webui/src/main/java/net/anotheria/moskito/webui/gauges/action/ShowGaugesAction.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.

ShowGaugesAction.java  (moskito-moskito-2.8.9):ShowGaugesAction.java  (moskito-moskito-2.9.0)
package net.anotheria.moskito.webui.gauges.action; package net.anotheria.moskito.webui.gauges.action;
import net.anotheria.anoplass.api.APIException; import net.anotheria.anoplass.api.APIException;
import net.anotheria.maf.action.ActionCommand; import net.anotheria.maf.action.ActionCommand;
import net.anotheria.maf.action.ActionMapping; import net.anotheria.maf.action.ActionMapping;
import net.anotheria.maf.bean.FormBean; import net.anotheria.maf.bean.FormBean;
import net.anotheria.moskito.webui.dashboards.api.DashboardAO;
import net.anotheria.moskito.webui.gauges.api.GaugeAO; import net.anotheria.moskito.webui.gauges.api.GaugeAO;
import net.anotheria.moskito.webui.gauges.bean.GaugeBean; import net.anotheria.moskito.webui.gauges.bean.GaugeBean;
import net.anotheria.moskito.webui.shared.bean.NaviItem; import net.anotheria.moskito.webui.shared.bean.NaviItem;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* TODO comment this class * This action is called in the gauge view under navigation point Everything Els e \ Gauges.
* *
* @author lrosenberg * @author lrosenberg
* @since 23.03.15 21:38 * @since 23.03.15 21:38
*/ */
public class ShowGaugesAction extends BaseGaugesAction{ public class ShowGaugesAction extends BaseGaugesAction{
@Override @Override
public ActionCommand execute(ActionMapping actionMapping, FormBean formBe an, HttpServletRequest httpServletRequest, HttpServletResponse httpServletRespon se) throws Exception { public ActionCommand execute(ActionMapping actionMapping, FormBean formBe an, HttpServletRequest httpServletRequest, HttpServletResponse httpServletRespon se) throws Exception {
httpServletRequest.setAttribute("gauges", getGaugeBeans(getGaugeA PI().getGauges())); httpServletRequest.setAttribute("gauges", getGaugeBeans(getGaugeA PI().getGauges()));
return actionMapping.success(); return actionMapping.success();
skipping to change at line 47 skipping to change at line 46
@Override @Override
protected NaviItem getCurrentNaviItem() { protected NaviItem getCurrentNaviItem() {
return NaviItem.MORE; return NaviItem.MORE;
} }
private List<GaugeBean> getGaugeBeans(List<GaugeAO> gaugeAOList) throws A PIException { private List<GaugeBean> getGaugeBeans(List<GaugeAO> gaugeAOList) throws A PIException {
List<GaugeBean> ret = new ArrayList<>(); List<GaugeBean> ret = new ArrayList<>();
if (gaugeAOList == null || gaugeAOList.size() == 0) if (gaugeAOList == null || gaugeAOList.size() == 0)
return ret; return ret;
List<DashboardAO> dashboardAOList = new ArrayList<>();
for(String name : getDashboardAPI().getDashboardNames()) {
dashboardAOList.add(getDashboardAPI().getDashboard(name))
;
}
for (GaugeAO gaugeAO : gaugeAOList) { for (GaugeAO gaugeAO : gaugeAOList) {
String dashboardNames = ""; String dashboardNames = getDashboardAPI().getDashboardNam
for(DashboardAO dashboardAO: dashboardAOList) { esWhichDoNotIncludeThisGauge(gaugeAO.getName());
if (dashboardAO.getGauges() == null || !dashboard
AO.getGauges().contains(gaugeAO)) {
dashboardNames += dashboardAO.getName()+"
,";
}
}
if (dashboardNames.length() > 0)
dashboardNames = dashboardNames.substring(0, dash
boardNames.length()-1);
ret.add(new GaugeBean(gaugeAO, dashboardNames)); ret.add(new GaugeBean(gaugeAO, dashboardNames));
} }
return ret; return ret;
} }
@Override
protected String getLinkToCurrentPage(HttpServletRequest req) {
return "mskGauges?ts="+System.currentTimeMillis();
}
} }
 End of changes. 5 change blocks. 
18 lines changed or deleted 7 lines changed or added

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