use of org.olat.restapi.system.vo.EnvironmentInformationsVO in project openolat by klemens.
the class SystemTest method testEnvironmentSystem.
@Test
public void testEnvironmentSystem() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
URI systemUri = conn.getContextURI().path("system").path("environment").build();
EnvironmentInformationsVO envInfos = conn.get(systemUri, EnvironmentInformationsVO.class);
assertNotNull(envInfos);
assertNotNull(envInfos.getArch());
assertTrue(envInfos.getAvailableProcessors() > 0);
assertNotNull(envInfos.getOsName());
assertNotNull(envInfos.getOsVersion());
assertNotNull(envInfos.getRuntimeName());
assertNotNull(envInfos.getVmName());
assertNotNull(envInfos.getVmVendor());
assertNotNull(envInfos.getVmVersion());
conn.shutdown();
}
use of org.olat.restapi.system.vo.EnvironmentInformationsVO in project OpenOLAT by OpenOLAT.
the class SystemWebService method getEnvironnementXml.
/**
* Return some informations about the environment.
* @response.representation.200.qname {http://www.example.com}environmentVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc A short summary of the number of classes
* @response.representation.200.example {@link org.olat.restapi.system.vo.Examples#SAMPLE_ENVVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param request The HTTP request
* @return The informations about the environment
*/
@GET
@Path("environment")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getEnvironnementXml(@Context HttpServletRequest request) {
if (!isAdminOrSystem(request)) {
return null;
}
OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
EnvironmentInformationsVO vo = new EnvironmentInformationsVO(os, runtime);
return Response.ok(vo).build();
}
use of org.olat.restapi.system.vo.EnvironmentInformationsVO in project OpenOLAT by OpenOLAT.
the class SystemTest method testEnvironmentSystem.
@Test
public void testEnvironmentSystem() throws IOException, URISyntaxException {
RestConnection conn = new RestConnection();
assertTrue(conn.login("administrator", "openolat"));
URI systemUri = conn.getContextURI().path("system").path("environment").build();
EnvironmentInformationsVO envInfos = conn.get(systemUri, EnvironmentInformationsVO.class);
assertNotNull(envInfos);
assertNotNull(envInfos.getArch());
assertTrue(envInfos.getAvailableProcessors() > 0);
assertNotNull(envInfos.getOsName());
assertNotNull(envInfos.getOsVersion());
assertNotNull(envInfos.getRuntimeName());
assertNotNull(envInfos.getVmName());
assertNotNull(envInfos.getVmVendor());
assertNotNull(envInfos.getVmVersion());
conn.shutdown();
}
use of org.olat.restapi.system.vo.EnvironmentInformationsVO in project openolat by klemens.
the class SystemWebService method getEnvironnementXml.
/**
* Return some informations about the environment.
* @response.representation.200.qname {http://www.example.com}environmentVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc A short summary of the number of classes
* @response.representation.200.example {@link org.olat.restapi.system.vo.Examples#SAMPLE_ENVVO}
* @response.representation.401.doc The roles of the authenticated user are not sufficient
* @param request The HTTP request
* @return The informations about the environment
*/
@GET
@Path("environment")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getEnvironnementXml(@Context HttpServletRequest request) {
if (!isAdminOrSystem(request)) {
return null;
}
OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
EnvironmentInformationsVO vo = new EnvironmentInformationsVO(os, runtime);
return Response.ok(vo).build();
}
Aggregations