use of org.opennms.web.svclayer.model.LocationMonitorListModel.LocationMonitorModel in project opennms by OpenNMS.
the class DefaultDistributedPollerService method getLocationMonitorList.
/**
* <p>getLocationMonitorList</p>
*
* @return a {@link org.opennms.web.svclayer.model.LocationMonitorListModel} object.
*/
@Override
public LocationMonitorListModel getLocationMonitorList() {
List<OnmsLocationMonitor> monitors = m_locationMonitorDao.findAll();
Collections.sort(monitors, m_comparator);
LocationMonitorListModel model = new LocationMonitorListModel();
for (OnmsLocationMonitor monitor : monitors) {
OnmsMonitoringLocation def = m_monitoringLocationDao.get(monitor.getLocation());
model.addLocationMonitor(new LocationMonitorModel(monitor, def));
}
return model;
}
use of org.opennms.web.svclayer.model.LocationMonitorListModel.LocationMonitorModel in project opennms by OpenNMS.
the class DefaultDistributedPollerService method getLocationMonitorDetails.
/** {@inheritDoc} */
@Override
public LocationMonitorListModel getLocationMonitorDetails(LocationMonitorIdCommand cmd, BindingResult errors) {
LocationMonitorListModel model = new LocationMonitorListModel();
model.setErrors(errors);
if (errors.getErrorCount() > 0) {
return model;
}
OnmsLocationMonitor monitor = m_locationMonitorDao.load(cmd.getMonitorId());
OnmsMonitoringLocation def = m_monitoringLocationDao.get(monitor.getLocation());
model.addLocationMonitor(new LocationMonitorModel(monitor, def));
return model;
}
Aggregations