Search in sources :

Example 1 with LocationsUpdatedEvent

use of org.opennms.features.poller.remote.gwt.client.events.LocationsUpdatedEvent in project opennms by OpenNMS.

the class DefaultLocationManager method removeApplication.

/** {@inheritDoc} */
@Override
public void removeApplication(final String applicationName) {
    final ApplicationInfo info = m_dataManager.getApplicationInfo(applicationName);
    m_dataManager.removeApplication(applicationName);
    if (info != null) {
        m_applicationFilter.removeApplication(info);
        m_view.updateApplicationList(m_dataManager.getApplications());
    }
    m_eventBus.fireEvent(new LocationsUpdatedEvent());
}
Also used : LocationsUpdatedEvent(org.opennms.features.poller.remote.gwt.client.events.LocationsUpdatedEvent)

Example 2 with LocationsUpdatedEvent

use of org.opennms.features.poller.remote.gwt.client.events.LocationsUpdatedEvent in project opennms by OpenNMS.

the class DefaultLocationManager method doApplicationUpdate.

private void doApplicationUpdate(final ApplicationInfo applicationInfo) {
    if (applicationInfo == null)
        return;
    // Update the application information in the model
    m_dataManager.updateApplication(applicationInfo);
    m_view.updateApplicationNames(m_dataManager.getAllApplicationNames());
    /*
         * Update the icon/caption in the LHN Use an ArrayList so that it has
         * good random-access efficiency since the pageable lists use get() to
         * fetch based on index. Note, that m_applications is a *HashSet* not
         * a *TreeSet* since TreeSets consider duplicates based on Comparable,
         * not equals, and thus duplicates them.
         */
    m_view.updateApplicationList(m_dataManager.getApplications());
    if (!m_updated) {
        return;
    }
    updateAllMarkerStates();
    m_eventBus.fireEvent(new LocationsUpdatedEvent());
}
Also used : LocationsUpdatedEvent(org.opennms.features.poller.remote.gwt.client.events.LocationsUpdatedEvent)

Example 3 with LocationsUpdatedEvent

use of org.opennms.features.poller.remote.gwt.client.events.LocationsUpdatedEvent in project opennms by OpenNMS.

the class DefaultLocationManager method updateLocation.

/**
     * {@inheritDoc}
     *
     * Invoked by the {@link LocationUpdatedRemoteEvent} and
     * {@link LocationsUpdatedRemoteEvent} events.
     */
@Override
public void updateLocation(final LocationInfo newLocation) {
    if (newLocation != null) {
        LocationInfo oldLocation = m_dataManager.getLocation(newLocation.getName());
        // Update the location information in the model
        m_dataManager.updateLocation(newLocation);
        m_view.updateApplicationNames(m_dataManager.getAllApplicationNames());
        placeMarker(newLocation);
        if (m_updated) {
            // Update the icon/caption in the LHN
            if (oldLocation == null || (m_selectedVisibleFilter.matches(newLocation) != m_selectedVisibleFilter.matches(oldLocation)) || (oldLocation.getStatus() != newLocation.getStatus())) {
                m_view.updateLocationList(getLocationsForLocationPanel());
            }
            m_eventBus.fireEvent(new LocationsUpdatedEvent());
        }
    }
}
Also used : LocationsUpdatedEvent(org.opennms.features.poller.remote.gwt.client.events.LocationsUpdatedEvent) LocationInfo(org.opennms.features.poller.remote.gwt.client.location.LocationInfo)

Aggregations

LocationsUpdatedEvent (org.opennms.features.poller.remote.gwt.client.events.LocationsUpdatedEvent)3 LocationInfo (org.opennms.features.poller.remote.gwt.client.location.LocationInfo)1