Search in sources :

Example 1 with PollerConfiguration

use of org.opennms.netmgt.poller.remote.PollerConfiguration in project opennms by OpenNMS.

the class DefaultPollerFrontEnd method retrieveLatestConfiguration.

private PollerConfiguration retrieveLatestConfiguration() {
    PollerConfiguration config = m_backEnd.getPollerConfiguration(getMonitoringSystemId());
    m_timeAdjustment.setMasterTime(config.getServerTime());
    return config;
}
Also used : PollerConfiguration(org.opennms.netmgt.poller.remote.PollerConfiguration)

Example 2 with PollerConfiguration

use of org.opennms.netmgt.poller.remote.PollerConfiguration in project opennms by OpenNMS.

the class DefaultPollerBackEnd method getApplicationsForLocation.

@Transactional(readOnly = true)
@Override
public Set<String> getApplicationsForLocation(final String location) {
    final Set<String> retval = new HashSet<>();
    PollerConfiguration config = getPollerConfigurationForLocation(location);
    for (PolledService service : config.getPolledServices()) {
        retval.addAll(service.getApplications());
    }
    return Collections.unmodifiableSet(retval);
}
Also used : PollerConfiguration(org.opennms.netmgt.poller.remote.PollerConfiguration) PolledService(org.opennms.netmgt.poller.remote.PolledService) HashSet(java.util.HashSet) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with PollerConfiguration

use of org.opennms.netmgt.poller.remote.PollerConfiguration in project opennms by OpenNMS.

the class ScanReportPollerFrontEnd method retrieveLatestConfiguration.

private PollerConfiguration retrieveLatestConfiguration() {
    PollerConfiguration config = m_backEnd.getPollerConfigurationForLocation(m_location);
    m_timeAdjustment.setMasterTime(config.getServerTime());
    return config;
}
Also used : PollerConfiguration(org.opennms.netmgt.poller.remote.PollerConfiguration)

Example 4 with PollerConfiguration

use of org.opennms.netmgt.poller.remote.PollerConfiguration in project opennms by OpenNMS.

the class ServerUnreachableAdaptor method getPollerConfigurationForLocation.

/** {@inheritDoc} */
@Override
public PollerConfiguration getPollerConfigurationForLocation(final String location) {
    if (m_serverUnresponsive) {
        return new EmptyPollerConfiguration();
    }
    try {
        final PollerConfiguration config = m_remoteBackEnd.getPollerConfigurationForLocation(location);
        m_serverUnresponsive = false;
        return config;
    } catch (final RemoteAccessException e) {
        m_serverUnresponsive = true;
        LOG.warn("Server is unable to respond due to the following exception.", e);
        return new EmptyPollerConfiguration();
    }
}
Also used : PollerConfiguration(org.opennms.netmgt.poller.remote.PollerConfiguration) RemoteAccessException(org.springframework.remoting.RemoteAccessException)

Example 5 with PollerConfiguration

use of org.opennms.netmgt.poller.remote.PollerConfiguration in project opennms by OpenNMS.

the class ServerUnreachableAdaptor method getPollerConfiguration.

/** {@inheritDoc} */
@Override
public PollerConfiguration getPollerConfiguration(final String locationMonitorId) {
    if (m_serverUnresponsive) {
        return new EmptyPollerConfiguration();
    }
    try {
        final PollerConfiguration config = m_remoteBackEnd.getPollerConfiguration(locationMonitorId);
        m_serverUnresponsive = false;
        return config;
    } catch (final RemoteAccessException e) {
        m_serverUnresponsive = true;
        LOG.warn("Server is unable to respond due to the following exception.", e);
        return new EmptyPollerConfiguration();
    }
}
Also used : PollerConfiguration(org.opennms.netmgt.poller.remote.PollerConfiguration) RemoteAccessException(org.springframework.remoting.RemoteAccessException)

Aggregations

PollerConfiguration (org.opennms.netmgt.poller.remote.PollerConfiguration)5 RemoteAccessException (org.springframework.remoting.RemoteAccessException)2 HashSet (java.util.HashSet)1 PolledService (org.opennms.netmgt.poller.remote.PolledService)1 Transactional (org.springframework.transaction.annotation.Transactional)1