use of org.opennms.web.outage.OutageIdNotFoundException in project opennms by OpenNMS.
the class OutageDetailController method handleRequestInternal.
/** {@inheritDoc} */
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
int outageId = -1;
String outageIdString = request.getParameter("id");
if (outageIdString == null) {
throw new MissingParameterException("id");
}
try {
outageId = WebSecurityUtils.safeParseInt(WebSecurityUtils.sanitizeString(outageIdString, false));
} catch (NumberFormatException e) {
throw new OutageIdNotFoundException("The outage id must be an integer.", outageIdString);
}
Outage outage = m_webOutageRepository.getOutage(outageId);
ModelAndView modelAndView = new ModelAndView(getSuccessView());
modelAndView.addObject("outage", outage);
return modelAndView;
}
Aggregations