Search in sources :

Example 1 with LocationUpdatedRemoteEvent

use of org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent in project opennms by OpenNMS.

the class SerializationTest method testEvents.

@Test
public void testEvents() throws Exception {
    final ApplicationUpdatedRemoteEvent aure = new ApplicationUpdatedRemoteEvent(getApplicationInfo());
    writer.writeObject(aure);
    final GeocodingUpdatingRemoteEvent gure = new GeocodingUpdatingRemoteEvent(0, 15);
    writer.writeObject(gure);
    final GeocodingFinishedRemoteEvent gfre = new GeocodingFinishedRemoteEvent(15);
    writer.writeObject(gfre);
    final LocationUpdatedRemoteEvent lure = new LocationUpdatedRemoteEvent(getLocationInfo());
    writer.writeObject(lure);
    Collection<LocationInfo> locations = new ArrayList<LocationInfo>();
    locations.add(getLocationInfo());
    final LocationsUpdatedRemoteEvent lsure = new LocationsUpdatedRemoteEvent(locations);
    writer.writeObject(lsure);
    final UpdateCompleteRemoteEvent ucre = new UpdateCompleteRemoteEvent();
    writer.writeObject(ucre);
}
Also used : UpdateCompleteRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.UpdateCompleteRemoteEvent) ArrayList(java.util.ArrayList) LocationsUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.LocationsUpdatedRemoteEvent) GeocodingUpdatingRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingUpdatingRemoteEvent) LocationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent) ApplicationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.ApplicationUpdatedRemoteEvent) GeocodingFinishedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingFinishedRemoteEvent) LocationInfo(org.opennms.features.poller.remote.gwt.client.location.LocationInfo) Test(org.junit.Test)

Example 2 with LocationUpdatedRemoteEvent

use of org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent in project opennms by OpenNMS.

the class LocationBroadcastProcessor method handleEventParms.

private void handleEventParms(final List<Parm> parms) {
    for (final Parm p : parms) {
        if (p.getParmName().equals(EventConstants.PARM_LOCATION_MONITOR_ID)) {
            final LocationInfo info = m_locationDataService.getLocationInfoForMonitor(Integer.valueOf(p.getValue().getContent()));
            m_eventHandler.sendEvent(new LocationUpdatedRemoteEvent(info));
            for (final ApplicationInfo applicationInfo : m_locationDataService.getApplicationsForLocation(info)) {
                m_eventHandler.sendEvent(new ApplicationUpdatedRemoteEvent(applicationInfo));
            }
        }
    }
}
Also used : ApplicationInfo(org.opennms.features.poller.remote.gwt.client.ApplicationInfo) Parm(org.opennms.netmgt.xml.event.Parm) LocationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent) ApplicationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.ApplicationUpdatedRemoteEvent) LocationInfo(org.opennms.features.poller.remote.gwt.client.location.LocationInfo)

Example 3 with LocationUpdatedRemoteEvent

use of org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent in project opennms by OpenNMS.

the class DefaultLocationDefHandler method handle.

/**
	 * <p>handle</p>
	 *
	 * @param def a {@link org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation} object.
	 */
@Override
public void handle(final OnmsMonitoringLocation def) {
    final LocationUpdatedRemoteEvent event = new LocationUpdatedRemoteEvent(m_locationDataService.getLocationInfo(def));
    getEventService().addEventUserSpecific(event);
}
Also used : LocationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent)

Example 4 with LocationUpdatedRemoteEvent

use of org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent in project opennms by OpenNMS.

the class LocationAddedToMapTest method testAddLocation.

@Test
public void testAddLocation() {
    int numLocations = 3000;
    int numApps = 12;
    Set<LocationInfo> locations = new HashSet<LocationInfo>();
    GWTBounds bounds = createLocations(numLocations, locations);
    for (LocationInfo locationInfo : locations) {
        m_testServer.sendUserSpecificEvent(new LocationUpdatedRemoteEvent(locationInfo));
    }
    //create apps and update by sending event
    Set<ApplicationInfo> apps = createApps(numApps, locations);
    for (ApplicationInfo app : apps) {
        m_testServer.sendUserSpecificEvent(new ApplicationUpdatedRemoteEvent(app));
    }
    m_testServer.sendUserSpecificEvent(new UpdateCompleteRemoteEvent());
    m_testExecutor.run();
    assertNotNull(m_testApplicationView.getMapBounds());
    assertEquals(bounds, m_testApplicationView.getMapBounds());
    assertEquals(numLocations, m_testApplicationView.getMarkerCount());
    m_testApplicationView.resetMarkerCount();
    m_testServer.sendDomainEvent(new LocationsUpdatedRemoteEvent(locations));
    for (ApplicationInfo app : apps) {
        m_testServer.sendDomainEvent(new ApplicationUpdatedRemoteEvent(app));
    }
    m_testExecutor.run();
    assertEquals(0, m_testApplicationView.getMarkerCount());
}
Also used : UpdateCompleteRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.UpdateCompleteRemoteEvent) LocationsUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.LocationsUpdatedRemoteEvent) LocationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent) ApplicationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.ApplicationUpdatedRemoteEvent) HashSet(java.util.HashSet) LocationInfo(org.opennms.features.poller.remote.gwt.client.location.LocationInfo) Test(org.junit.Test)

Example 5 with LocationUpdatedRemoteEvent

use of org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent in project opennms by OpenNMS.

the class LocationDataManager method pushLocationData.

private void pushLocationData(final EventExecutorService service) {
    LOG.debug("pushing initialized locations");
    List<LocationInfo> locations = getLocationDataService().getInfoForAllLocations();
    for (final LocationInfo locationInfo : locations) {
        final LocationUpdatedRemoteEvent event = new LocationUpdatedRemoteEvent(locationInfo);
        service.addEventUserSpecific(event);
    }
    LOG.debug("finished pushing initialized locations");
}
Also used : LocationUpdatedRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent) LocationInfo(org.opennms.features.poller.remote.gwt.client.location.LocationInfo)

Aggregations

LocationUpdatedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent)5 LocationInfo (org.opennms.features.poller.remote.gwt.client.location.LocationInfo)4 ApplicationUpdatedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.ApplicationUpdatedRemoteEvent)3 Test (org.junit.Test)2 LocationsUpdatedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.LocationsUpdatedRemoteEvent)2 UpdateCompleteRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.UpdateCompleteRemoteEvent)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 ApplicationInfo (org.opennms.features.poller.remote.gwt.client.ApplicationInfo)1 GeocodingFinishedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingFinishedRemoteEvent)1 GeocodingUpdatingRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingUpdatingRemoteEvent)1 Parm (org.opennms.netmgt.xml.event.Parm)1