use of org.opennms.features.poller.remote.gwt.client.StatusDetails in project opennms by OpenNMS.
the class LocationDataManagerTest method testGetApplicationInfo.
@Test
public void testGetApplicationInfo() {
String appName = "Domain Controllers";
OnmsApplication app = m_applicationDao.findByName(appName);
System.err.println("TEST testGetApplicationInfo: calling getApplicationInfo");
m_locationDataService.getApplicationInfo(app, new StatusDetails());
}
use of org.opennms.features.poller.remote.gwt.client.StatusDetails in project opennms by OpenNMS.
the class LocationDataManagerTest method testGetStatusDetailsForApplication.
@Test
public void testGetStatusDetailsForApplication() {
String appName = "Domain Controllers";
int count = 100;
long start = System.currentTimeMillis();
for (int i = 0; i < count; i++) {
OnmsApplication app = m_applicationDao.findByName(appName);
//System.err.println("TEST testGetSatusDetailsForApplication: calling getStatusDetailsForApplication");
StatusDetails details = m_locationDataService.getStatusDetailsForApplication(app);
assertEquals(Status.UP, details.getStatus());
}
System.err.println(String.format("Avg getStatusDetailsForApplication: %d\n", (System.currentTimeMillis() - start) / count));
}
use of org.opennms.features.poller.remote.gwt.client.StatusDetails in project opennms by OpenNMS.
the class DefaultLocationDataService method getStatusDetailsForLocation.
/** {@inheritDoc} */
@Transactional
@Override
public StatusDetails getStatusDetailsForLocation(final OnmsMonitoringLocation def) {
waitForGeocoding("getStatusDetails");
final DefaultLocationDataService.MonitorStatusTracker mst = new DefaultLocationDataService.MonitorStatusTracker(def.getLocationName());
final List<GWTLocationMonitor> monitors = new ArrayList<GWTLocationMonitor>();
for (OnmsLocationMonitor mon : m_locationDao.findByLocationDefinition(def)) {
monitors.add(transformLocationMonitor(mon));
}
for (OnmsLocationSpecificStatus status : m_locationDao.getMostRecentStatusChangesForLocation(def.getLocationName())) {
mst.onStatus(status);
}
LocationMonitorState monitorState = new LocationMonitorState(monitors, mst.drain());
StatusDetails statusDetails = monitorState.getStatusDetails();
LOG.debug("getStatusDetails({}) returning {}", def.getLocationName(), statusDetails);
return statusDetails;
}
use of org.opennms.features.poller.remote.gwt.client.StatusDetails in project opennms by OpenNMS.
the class DefaultLocationDataService method getStatusDetailsForAllLocations.
@Override
public Map<String, StatusDetails> getStatusDetailsForAllLocations() {
final Collection<OnmsMonitoringLocation> definitions = m_monitoringLocationDao.findAll();
AllMonitorStatusTracker tracker = new AllMonitorStatusTracker();
MonitorTracker monTracker = new MonitorTracker();
for (OnmsLocationSpecificStatus status : m_locationDao.getAllMostRecentStatusChanges()) {
tracker.onStatus(status);
}
for (OnmsLocationMonitor monitor : m_locationDao.findAll()) {
monTracker.onMonitor(monitor);
}
Map<String, StatusDetails> statusDetails = new LinkedHashMap<String, StatusDetails>();
for (final OnmsMonitoringLocation def : definitions) {
LocationMonitorState monitorState = new LocationMonitorState(monTracker.drain(def.getLocationName()), tracker.drain(def.getLocationName()));
final StatusDetails monitorStatus = monitorState.getStatusDetails();
statusDetails.put(def.getLocationName(), monitorStatus);
}
return statusDetails;
}
use of org.opennms.features.poller.remote.gwt.client.StatusDetails in project opennms by OpenNMS.
the class DefaultLocationDataService method getStatusDetailsForAllApplications.
private Map<OnmsApplication, StatusDetails> getStatusDetailsForAllApplications() {
final Collection<OnmsApplication> apps = m_applicationDao.findAll();
Map<OnmsApplication, StatusDetails> statusDetails = new LinkedHashMap<OnmsApplication, StatusDetails>();
for (final OnmsApplication app : apps) {
StatusDetails appStatusDetails = getStatusDetailsForApplication(app);
statusDetails.put(app, appStatusDetails);
}
return statusDetails;
}
Aggregations