use of org.olat.restapi.system.vo.MonitoringInfosVO in project OpenOLAT by OpenOLAT.
the class SystemTest method testMonitoringInfos.
@Test
public void testMonitoringInfos() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
URI systemUri = conn.getContextURI().path("system").path("monitoring").path("configuration").build();
MonitoringInfosVO databaseInfos = conn.get(systemUri, MonitoringInfosVO.class);
assertNotNull(databaseInfos);
assertNotNull(databaseInfos.getDependencies());
assertNotNull(databaseInfos.getProbes());
assertNotNull(databaseInfos.getType());
conn.shutdown();
}
use of org.olat.restapi.system.vo.MonitoringInfosVO in project openolat by klemens.
the class SystemTest method testMonitoringInfos.
@Test
public void testMonitoringInfos() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
URI systemUri = conn.getContextURI().path("system").path("monitoring").path("configuration").build();
MonitoringInfosVO databaseInfos = conn.get(systemUri, MonitoringInfosVO.class);
assertNotNull(databaseInfos);
assertNotNull(databaseInfos.getDependencies());
assertNotNull(databaseInfos.getProbes());
assertNotNull(databaseInfos.getType());
conn.shutdown();
}
use of org.olat.restapi.system.vo.MonitoringInfosVO in project openolat by klemens.
the class MonitoringWebService method getImplementedProbes.
/**
* Return the configuration of the monitoring, which probes are available,
* which dependency...
*
* @response.representation.200.qname {http://www.example.com}releaseVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc The verison of the instance
* @response.representation.200.example {@link org.olat.restapi.system.vo.Examples#SAMPLE_MONITORINGCONFIGVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param request The HTTP request
* @return The informations about the memory
*/
@GET
@Path("configuration")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getImplementedProbes() {
MonitoringInfosVO vo = new MonitoringInfosVO();
MonitoringModule module = CoreSpringFactory.getImpl(MonitoringModule.class);
String probesConfig = module.getMonitoredProbes();
String[] probes;
if (StringHelper.containsNonWhitespace(probesConfig)) {
probes = probesConfig.split(",");
} else {
probes = new String[0];
}
vo.setProbes(probes);
vo.setType(SystemRegistrationManager.PRODUCT);
vo.setDescription(module.getDescription());
List<MonitoringDependencyVO> dependencies = new ArrayList<MonitoringDependencyVO>();
InstantMessagingModule imConfig = CoreSpringFactory.getImpl(InstantMessagingModule.class);
if (imConfig.isEnabled()) {
MonitoringDependencyVO dependency = new MonitoringDependencyVO();
dependency.setType("openfire");
dependency.setUrl("");
dependencies.add(dependency);
}
DB dbInstance = CoreSpringFactory.getImpl(DB.class);
MonitoringDependencyVO dependency = new MonitoringDependencyVO();
dependency.setType(dbInstance.getDbVendor());
dependency.setUrl(module.getDatabaseHost());
dependencies.add(dependency);
MonitoringDependencyVO dependencyServer = new MonitoringDependencyVO();
dependencyServer.setType("server");
dependencyServer.setUrl(module.getServer());
dependencies.add(dependencyServer);
vo.setDependencies(dependencies.toArray(new MonitoringDependencyVO[dependencies.size()]));
return Response.ok(vo).build();
}
use of org.olat.restapi.system.vo.MonitoringInfosVO in project OpenOLAT by OpenOLAT.
the class MonitoringWebService method getImplementedProbes.
/**
* Return the configuration of the monitoring, which probes are available,
* which dependency...
*
* @response.representation.200.qname {http://www.example.com}releaseVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc The verison of the instance
* @response.representation.200.example {@link org.olat.restapi.system.vo.Examples#SAMPLE_MONITORINGCONFIGVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param request The HTTP request
* @return The informations about the memory
*/
@GET
@Path("configuration")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getImplementedProbes() {
MonitoringInfosVO vo = new MonitoringInfosVO();
MonitoringModule module = CoreSpringFactory.getImpl(MonitoringModule.class);
String probesConfig = module.getMonitoredProbes();
String[] probes;
if (StringHelper.containsNonWhitespace(probesConfig)) {
probes = probesConfig.split(",");
} else {
probes = new String[0];
}
vo.setProbes(probes);
vo.setType(SystemRegistrationManager.PRODUCT);
vo.setDescription(module.getDescription());
List<MonitoringDependencyVO> dependencies = new ArrayList<MonitoringDependencyVO>();
InstantMessagingModule imConfig = CoreSpringFactory.getImpl(InstantMessagingModule.class);
if (imConfig.isEnabled()) {
MonitoringDependencyVO dependency = new MonitoringDependencyVO();
dependency.setType("openfire");
dependency.setUrl("");
dependencies.add(dependency);
}
DB dbInstance = CoreSpringFactory.getImpl(DB.class);
MonitoringDependencyVO dependency = new MonitoringDependencyVO();
dependency.setType(dbInstance.getDbVendor());
dependency.setUrl(module.getDatabaseHost());
dependencies.add(dependency);
MonitoringDependencyVO dependencyServer = new MonitoringDependencyVO();
dependencyServer.setType("server");
dependencyServer.setUrl(module.getServer());
dependencies.add(dependencyServer);
vo.setDependencies(dependencies.toArray(new MonitoringDependencyVO[dependencies.size()]));
return Response.ok(vo).build();
}
Aggregations