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);
}
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));
}
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++;
}
Aggregations