use of org.opennms.features.poller.remote.gwt.client.location.LocationInfo in project opennms by OpenNMS.
the class DefaultLocationManager method showLocationDetails.
private void showLocationDetails(final String locationName) {
// TODO: this needs a callback to get the location details, and fill
// in the content
final LocationInfo loc = m_dataManager.getLocation(locationName);
m_remoteService.getLocationDetails(locationName, new AsyncCallback<LocationDetails>() {
@Override
public void onFailure(final Throwable t) {
String htmlTitle = "Error Getting Location Details";
String htmlContent = "<p>An error occurred getting the location details.</p>" + "<pre>" + URL.encode(t.getMessage()) + "</pre>";
m_view.showLocationDetails(locationName, htmlTitle, htmlContent);
}
@Override
public void onSuccess(final LocationDetails locationDetails) {
m_view.showLocationDetails(locationName, locationName + " (" + loc.getArea() + ")", getLocationInfoDetails(loc, locationDetails));
}
});
}
use of org.opennms.features.poller.remote.gwt.client.location.LocationInfo in project opennms by OpenNMS.
the class SerializationTest method testLocationInfo.
@Test
public void testLocationInfo() throws Exception {
LocationInfo location = getLocationInfo();
writer.writeObject(location);
}
use of org.opennms.features.poller.remote.gwt.client.location.LocationInfo 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.location.LocationInfo in project opennms by OpenNMS.
the class SerializationTest method getLocationInfo.
private LocationInfo getLocationInfo() {
LocationInfo location = new LocationInfo();
location.setName("Bob");
location.setArea("East Coast");
location.setGeolocation("RDU");
location.setCoordinates("0.0,0.0");
location.setStatusDetails(StatusDetails.up());
location.setMarkerState(getMarker(location));
return location;
}
use of org.opennms.features.poller.remote.gwt.client.location.LocationInfo in project opennms by OpenNMS.
the class LocationDataServiceIT method testLocationInfo.
@Test
public void testLocationInfo() throws Exception {
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_localhostHttpService.getId(), getAvailable(new Date(now() - days(20) - hours(3))));
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_localhostHttpService.getId(), getDown(new Date(now() - days(20) - hours(2))));
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_localhostHttpService.getId(), getAvailable(new Date(now() - days(20) - hours(1))));
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_googleHttpService.getId(), getDown(new Date(now() - days(20) - hours(4))));
LocationInfo li = m_locationDataService.getLocationInfo("RDU");
assertNotNull(li);
assertEquals("RDU", li.getName());
// Down because one of the services is down.
assertEquals(Status.DOWN, li.getStatusDetails().getStatus());
}
Aggregations