Search in sources :

Example 1 with GeocodingUpdatingRemoteEvent

use of org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingUpdatingRemoteEvent 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 GeocodingUpdatingRemoteEvent

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

the class GeocodingHandler method start.

/** {@inheritDoc} */
@Override
public void start(final int size) {
    m_size = size;
    m_eventService.addEventUserSpecific(new GeocodingUpdatingRemoteEvent(0, size));
}
Also used : GeocodingUpdatingRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingUpdatingRemoteEvent)

Example 3 with GeocodingUpdatingRemoteEvent

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

the class GeocodingHandler method handle.

/**
	 * <p>handle</p>
	 *
	 * @param def a {@link OnmsMonitoringLocation} object.
	 */
@Override
public void handle(final OnmsMonitoringLocation def) {
    final GWTLatLng latLng = m_locationDataService.getLatLng(def, false);
    if (latLng != null) {
        def.setLatitude(latLng.getLatitude().floatValue());
        def.setLongitude(latLng.getLongitude().floatValue());
    }
    final Date now = new Date();
    if (now.getTime() - m_date.getTime() >= 500) {
        m_eventService.addEventUserSpecific(new GeocodingUpdatingRemoteEvent(m_count, m_size));
        LOG.debug("initializing locations ({}/{})", m_count, m_size);
        m_date = now;
    }
    m_count++;
}
Also used : GWTLatLng(org.opennms.features.poller.remote.gwt.client.GWTLatLng) GeocodingUpdatingRemoteEvent(org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingUpdatingRemoteEvent) Date(java.util.Date)

Aggregations

GeocodingUpdatingRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingUpdatingRemoteEvent)3 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Test (org.junit.Test)1 GWTLatLng (org.opennms.features.poller.remote.gwt.client.GWTLatLng)1 LocationInfo (org.opennms.features.poller.remote.gwt.client.location.LocationInfo)1 ApplicationUpdatedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.ApplicationUpdatedRemoteEvent)1 GeocodingFinishedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.GeocodingFinishedRemoteEvent)1 LocationUpdatedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.LocationUpdatedRemoteEvent)1 LocationsUpdatedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.LocationsUpdatedRemoteEvent)1 UpdateCompleteRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.UpdateCompleteRemoteEvent)1