Search in sources :

Example 1 with LocationMonitorModel

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;
}
Also used : LocationMonitorListModel(org.opennms.web.svclayer.model.LocationMonitorListModel) LocationMonitorModel(org.opennms.web.svclayer.model.LocationMonitorListModel.LocationMonitorModel) OnmsLocationMonitor(org.opennms.netmgt.model.OnmsLocationMonitor) OnmsMonitoringLocation(org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation)

Example 2 with LocationMonitorModel

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;
}
Also used : LocationMonitorListModel(org.opennms.web.svclayer.model.LocationMonitorListModel) LocationMonitorModel(org.opennms.web.svclayer.model.LocationMonitorListModel.LocationMonitorModel) OnmsLocationMonitor(org.opennms.netmgt.model.OnmsLocationMonitor) OnmsMonitoringLocation(org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation)

Aggregations

OnmsLocationMonitor (org.opennms.netmgt.model.OnmsLocationMonitor)2 OnmsMonitoringLocation (org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation)2 LocationMonitorListModel (org.opennms.web.svclayer.model.LocationMonitorListModel)2 LocationMonitorModel (org.opennms.web.svclayer.model.LocationMonitorListModel.LocationMonitorModel)2