Search in sources :

Example 1 with GWTMarkerState

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

the class DefaultLocationDataService method getLocationInfo.

private LocationInfo getLocationInfo(final OnmsMonitoringLocation def, final StatusDetails monitorStatus) {
    GWTLatLng latLng = getLatLng(def, false);
    if (latLng == null) {
        LOG.debug("no geolocation or coordinates found, using OpenNMS World HQ");
        latLng = new GWTLatLng(35.715751, -79.16262);
    }
    final GWTMarkerState state = new GWTMarkerState(def.getLocationName(), latLng, Status.UNKNOWN);
    Set<String> tags = new TreeSet<String>();
    if (def.getTags() != null) {
        for (String tag : def.getTags()) {
            tags.add(tag);
        }
    }
    final LocationInfo locationInfo = new LocationInfo(def.getLocationName(), def.getMonitoringArea(), def.getGeolocation(), latLng.getCoordinates(), def.getPriority(), state, null, tags);
    state.setStatus(monitorStatus.getStatus());
    locationInfo.setStatusDetails(monitorStatus);
    //LOG.debug("getLocationInfo({}) returning {}", def.getLocationName(), locationInfo);
    return locationInfo;
}
Also used : GWTLatLng(org.opennms.features.poller.remote.gwt.client.GWTLatLng) TreeSet(java.util.TreeSet) GWTMarkerState(org.opennms.features.poller.remote.gwt.client.GWTMarkerState) LocationInfo(org.opennms.features.poller.remote.gwt.client.location.LocationInfo)

Aggregations

TreeSet (java.util.TreeSet)1 GWTLatLng (org.opennms.features.poller.remote.gwt.client.GWTLatLng)1 GWTMarkerState (org.opennms.features.poller.remote.gwt.client.GWTMarkerState)1 LocationInfo (org.opennms.features.poller.remote.gwt.client.location.LocationInfo)1