Search in sources :

Example 1 with ServicePollState

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

the class DefaultPollerFrontEnd method doLoadConfig.

private void doLoadConfig() {
    Date oldTime = getCurrentConfigTimestamp();
    try {
        m_pollService.setServiceMonitorLocators(m_backEnd.getServiceMonitorLocators(DistributionContext.REMOTE_MONITOR));
        m_pollerConfiguration = retrieveLatestConfiguration();
        synchronized (m_pollState) {
            int i = 0;
            m_pollState.clear();
            // Initialize the monitor for the service
            for (final PolledService service : getPolledServices()) {
                m_pollState.put(service.getServiceId(), new ServicePollState(service, i++));
            }
        }
        fireConfigurationChange(oldTime, getCurrentConfigTimestamp());
    } catch (final Throwable e) {
        LOG.warn("Unable to get updated poller configuration.", e);
        if (m_pollerConfiguration == null) {
            m_pollerConfiguration = new EmptyPollerConfiguration();
        }
    }
}
Also used : PolledService(org.opennms.netmgt.poller.remote.PolledService) ServicePollState(org.opennms.netmgt.poller.remote.ServicePollState) Date(java.util.Date)

Example 2 with ServicePollState

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

the class DefaultPollerFrontEnd method updateServicePollState.

private void updateServicePollState(final Integer polledServiceId, final PollStatus result) {
    final ServicePollState pollState = getServicePollState(polledServiceId);
    if (pollState == null) {
        return;
    }
    pollState.setLastPoll(result);
    fireServicePollStateChanged(pollState.getPolledService(), pollState.getIndex());
}
Also used : ServicePollState(org.opennms.netmgt.poller.remote.ServicePollState)

Example 3 with ServicePollState

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

the class DefaultPollerFrontEnd method setInitialPollTime.

/**
 * {@inheritDoc}
 */
@Override
public void setInitialPollTime(final Integer polledServiceId, final Date initialPollTime) {
    final ServicePollState pollState = getServicePollState(polledServiceId);
    if (pollState == null) {
        return;
    }
    pollState.setInitialPollTime(initialPollTime);
    fireServicePollStateChanged(pollState.getPolledService(), pollState.getIndex());
}
Also used : ServicePollState(org.opennms.netmgt.poller.remote.ServicePollState)

Aggregations

ServicePollState (org.opennms.netmgt.poller.remote.ServicePollState)3 Date (java.util.Date)1 PolledService (org.opennms.netmgt.poller.remote.PolledService)1