Package psiprobe.controllers.oshi
Class OshiController
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.springframework.web.servlet.support.WebContentGenerator
-
- org.springframework.web.servlet.mvc.AbstractController
-
- psiprobe.controllers.AbstractTomcatContainerController
-
- psiprobe.controllers.oshi.OshiController
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.web.context.ServletContextAware
,org.springframework.web.servlet.mvc.Controller
@Controller public class OshiController extends AbstractTomcatContainerController
Creates an instance of Operating System and Hardware Information based on Oshi SystemInfoTest.A demonstration of access to many of OSHI's capabilities
-
-
Constructor Summary
Constructors Constructor Description OshiController()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.web.servlet.ModelAndView
handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected org.springframework.web.servlet.ModelAndView
handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
private void
initialize()
Process initialization using Oshi System Info Test (code copied from Oshi SystemInfoTest.main).private static void
printComputerSystem(oshi.hardware.ComputerSystem computerSystem)
Prints the computer system.private static void
printCpu(oshi.hardware.CentralProcessor processor)
Prints the cpu.private static void
printDisks(List<oshi.hardware.HWDiskStore> list)
Prints the disks.private static void
printDisplays(List<oshi.hardware.Display> list)
Prints the displays.private static void
printFileSystem(oshi.software.os.FileSystem fileSystem)
Prints the file system.private static void
printGraphicsCards(List<oshi.hardware.GraphicsCard> list)
Prints the graphic cards.private static void
printInternetProtocolStats(oshi.software.os.InternetProtocolStats internetProtocolStats)
Prints the internet protocol stats.private static void
printMemory(oshi.hardware.GlobalMemory memory)
Prints the memory.private static void
printNetworkInterfaces(List<oshi.hardware.NetworkIF> list)
Prints the network interfaces.private static void
printNetworkParameters(oshi.software.os.NetworkParams networkParams)
Prints the network parameters.private static void
printOperatingSystem(oshi.software.os.OperatingSystem operatingSystem)
Prints the operating system.private static void
printPowerSources(List<oshi.hardware.PowerSource> list)
Prints the power sources.private static void
printProcesses(oshi.software.os.OperatingSystem os, oshi.hardware.GlobalMemory memory)
Prints the processes.private static void
printProcessor(oshi.hardware.CentralProcessor processor)
Prints the processor.private static void
printSensors(oshi.hardware.Sensors sensors)
Prints the sensors.private static void
printServices(oshi.software.os.OperatingSystem os)
Prints the services.private static void
printSoundCards(List<oshi.hardware.SoundCard> list)
Prints the sound cards.private static void
printUsbDevices(List<oshi.hardware.UsbDevice> list)
Prints the usb devices.void
setViewName(String viewName)
Sets the view name.-
Methods inherited from class psiprobe.controllers.AbstractTomcatContainerController
getContainerWrapper, getViewName, setContainerWrapper
-
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
isSynchronizeOnSession, setSynchronizeOnSession
-
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
-
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
-
-
-
-
Method Detail
-
handleRequest
@RequestMapping(path="/adm/oshi.htm") public org.springframework.web.servlet.ModelAndView handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Specified by:
handleRequest
in interfaceorg.springframework.web.servlet.mvc.Controller
- Overrides:
handleRequest
in classorg.springframework.web.servlet.mvc.AbstractController
- Throws:
Exception
-
handleRequestInternal
protected org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
- Specified by:
handleRequestInternal
in classorg.springframework.web.servlet.mvc.AbstractController
- Throws:
Exception
-
setViewName
@Value("oshi") public void setViewName(String viewName)
Description copied from class:AbstractTomcatContainerController
Sets the view name.- Overrides:
setViewName
in classAbstractTomcatContainerController
- Parameters:
viewName
- the new view name
-
initialize
private void initialize()
Process initialization using Oshi System Info Test (code copied from Oshi SystemInfoTest.main).Logging switched from 'info' to 'debug' for psi probe usage.
-
printOperatingSystem
private static void printOperatingSystem(oshi.software.os.OperatingSystem operatingSystem)
Prints the operating system.- Parameters:
operatingSystem
- the operating system
-
printComputerSystem
private static void printComputerSystem(oshi.hardware.ComputerSystem computerSystem)
Prints the computer system.- Parameters:
computerSystem
- the computer system
-
printProcessor
private static void printProcessor(oshi.hardware.CentralProcessor processor)
Prints the processor.- Parameters:
processor
- the processor
-
printMemory
private static void printMemory(oshi.hardware.GlobalMemory memory)
Prints the memory.- Parameters:
memory
- the memory
-
printCpu
private static void printCpu(oshi.hardware.CentralProcessor processor)
Prints the cpu.- Parameters:
processor
- the processor
-
printProcesses
private static void printProcesses(oshi.software.os.OperatingSystem os, oshi.hardware.GlobalMemory memory)
Prints the processes.- Parameters:
os
- the osmemory
- the memory
-
printServices
private static void printServices(oshi.software.os.OperatingSystem os)
Prints the services.- Parameters:
os
- the operating system
-
printSensors
private static void printSensors(oshi.hardware.Sensors sensors)
Prints the sensors.- Parameters:
sensors
- the sensors
-
printPowerSources
private static void printPowerSources(List<oshi.hardware.PowerSource> list)
Prints the power sources.- Parameters:
list
- the power sources
-
printDisks
private static void printDisks(List<oshi.hardware.HWDiskStore> list)
Prints the disks.- Parameters:
list
- the disk stores
-
printFileSystem
private static void printFileSystem(oshi.software.os.FileSystem fileSystem)
Prints the file system.- Parameters:
fileSystem
- the file system
-
printNetworkInterfaces
private static void printNetworkInterfaces(List<oshi.hardware.NetworkIF> list)
Prints the network interfaces.- Parameters:
list
- the network interfaces
-
printNetworkParameters
private static void printNetworkParameters(oshi.software.os.NetworkParams networkParams)
Prints the network parameters.- Parameters:
networkParams
- the network params
-
printInternetProtocolStats
private static void printInternetProtocolStats(oshi.software.os.InternetProtocolStats internetProtocolStats)
Prints the internet protocol stats.- Parameters:
internetProtocolStats
- the internet protocal stats
-
printDisplays
private static void printDisplays(List<oshi.hardware.Display> list)
Prints the displays.- Parameters:
list
- the displays
-
printUsbDevices
private static void printUsbDevices(List<oshi.hardware.UsbDevice> list)
Prints the usb devices.- Parameters:
list
- the usb devices
-
printSoundCards
private static void printSoundCards(List<oshi.hardware.SoundCard> list)
Prints the sound cards.- Parameters:
list
- the sound cards
-
printGraphicsCards
private static void printGraphicsCards(List<oshi.hardware.GraphicsCard> list)
Prints the graphic cards.- Parameters:
list
- the graphics cards
-
-