Search in sources :

Example 11 with ApplicationInfo

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

the class DefaultLocationDataService method transformApplication.

private static ApplicationInfo transformApplication(final Collection<OnmsMonitoredService> services, final OnmsApplication application) {
    final ApplicationInfo app = new ApplicationInfo();
    app.setId(application.getId());
    app.setName(application.getName());
    final Set<GWTMonitoredService> s = new TreeSet<GWTMonitoredService>();
    final Set<String> locations = new TreeSet<String>();
    for (final OnmsMonitoredService service : services) {
        for (final OnmsApplication oa : service.getApplications()) {
            locations.add(oa.getName());
        }
        s.add(transformMonitoredService(service));
    }
    app.setServices(s);
    app.setLocations(locations);
    return app;
}
Also used : TreeSet(java.util.TreeSet) ApplicationInfo(org.opennms.features.poller.remote.gwt.client.ApplicationInfo) OnmsApplication(org.opennms.netmgt.model.OnmsApplication) GWTMonitoredService(org.opennms.features.poller.remote.gwt.client.GWTMonitoredService) OnmsMonitoredService(org.opennms.netmgt.model.OnmsMonitoredService)

Aggregations

ApplicationInfo (org.opennms.features.poller.remote.gwt.client.ApplicationInfo)11 Transactional (org.springframework.transaction.annotation.Transactional)6 OnmsApplication (org.opennms.netmgt.model.OnmsApplication)4 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3 ApplicationUpdatedRemoteEvent (org.opennms.features.poller.remote.gwt.client.remoteevents.ApplicationUpdatedRemoteEvent)3 OnmsLocationMonitor (org.opennms.netmgt.model.OnmsLocationMonitor)3 OnmsLocationSpecificStatus (org.opennms.netmgt.model.OnmsLocationSpecificStatus)3 OnmsMonitoredService (org.opennms.netmgt.model.OnmsMonitoredService)3 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 TreeSet (java.util.TreeSet)2 GWTLocationMonitor (org.opennms.features.poller.remote.gwt.client.GWTLocationMonitor)2 GWTMonitoredService (org.opennms.features.poller.remote.gwt.client.GWTMonitoredService)2 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Map (java.util.Map)1 Test (org.junit.Test)1 ApplicationDetails (org.opennms.features.poller.remote.gwt.client.ApplicationDetails)1 ApplicationState (org.opennms.features.poller.remote.gwt.client.ApplicationState)1