use of org.opennms.netmgt.poller.remote.OnmsPollModel in project opennms by OpenNMS.
the class DefaultPollerBackEnd method createPollerConfiguration.
private SimplePollerConfiguration createPollerConfiguration(String pollingPackageName) {
final Package pkg = getPollingPackage(pollingPackageName);
final ServiceSelector selector = m_pollerConfig.getServiceSelectorForPackage(pkg);
final Collection<OnmsMonitoredService> services = m_monSvcDao.findMatchingServices(selector);
final List<PolledService> configs = new ArrayList<PolledService>(services.size());
LOG.debug("Found {} services in polling package {}", services.size(), pollingPackageName);
for (final OnmsMonitoredService monSvc : services) {
final Service serviceConfig = m_pollerConfig.getServiceInPackage(monSvc.getServiceName(), pkg);
final long interval = serviceConfig.getInterval();
final Map<String, Object> parameters = getParameterMap(serviceConfig);
if (LOG.isTraceEnabled()) {
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
LOG.trace("Service {} has parameter {} with type {} and value: {}", monSvc.getServiceName(), entry.getKey(), entry.getValue() != null ? entry.getValue().getClass().getCanonicalName() : "null", entry.getValue());
}
}
configs.add(new PolledService(monSvc, parameters, new OnmsPollModel(interval)));
}
Collections.sort(configs);
return new SimplePollerConfiguration(getConfigurationTimestamp(), configs.toArray(new PolledService[configs.size()]));
}
Aggregations