Package oshi.hardware
Interface HardwareAbstractionLayer
- All Known Implementing Classes:
AbstractHardwareAbstractionLayer
,AixHardwareAbstractionLayer
,FreeBsdHardwareAbstractionLayer
,LinuxHardwareAbstractionLayer
,MacHardwareAbstractionLayer
,OpenBsdHardwareAbstractionLayer
,SolarisHardwareAbstractionLayer
,WindowsHardwareAbstractionLayer
A hardware abstraction layer. Provides access to hardware items such as processors, memory, battery, and disks.
-
Method Summary
Modifier and TypeMethodDescriptionInstantiates aComputerSystem
object.Instantiates a list ofHWDiskStore
objects, representing physical hard disks or other similar storage devices.Instantiates a list ofDisplay
objects, representing monitors or other video output devices.Instantiates a list ofGraphicsCard
objects, representing the Graphics cards.default List<LogicalVolumeGroup>
Instantiates a list ofLogicalVolumeGroup
objects, representing a storage pool or group of devices, partitions, volumes, or other implementation specific means of file storage.Instantiates aGlobalMemory
object.Gets a list of non-localNetworkIF
objects, representing a network interface.getNetworkIFs
(boolean includeLocalInterfaces) Gets a listNetworkIF
objects, representing a network interface.Instantiates a list ofPowerSource
objects, representing batteries, etc.Instantiates aCentralProcessor
object.Instantiates aSensors
object, representing CPU temperature and fan speed.Instantiates a list ofSoundCard
objects, representing the Sound cards.getUsbDevices
(boolean tree) Instantiates a list ofUsbDevice
objects, representing devices connected via a usb port (including internal devices).
-
Method Details
-
getComputerSystem
ComputerSystem getComputerSystem()Instantiates aComputerSystem
object. This represents the physical hardware, including components such as BIOS/Firmware and a motherboard, logic board, etc.- Returns:
- a
ComputerSystem
object.
-
getProcessor
CentralProcessor getProcessor()Instantiates aCentralProcessor
object. This represents one or more Logical CPUs.- Returns:
- A
CentralProcessor
object.
-
getMemory
GlobalMemory getMemory()Instantiates aGlobalMemory
object.- Returns:
- A memory object.
-
getPowerSources
List<PowerSource> getPowerSources()Instantiates a list ofPowerSource
objects, representing batteries, etc.- Returns:
- A list of PowerSource objects or an empty list if none are present.
-
getDiskStores
List<HWDiskStore> getDiskStores()Instantiates a list ofHWDiskStore
objects, representing physical hard disks or other similar storage devices.- Returns:
- A list of HWDiskStore objects or an empty list if none are present.
-
getLogicalVolumeGroups
Instantiates a list ofLogicalVolumeGroup
objects, representing a storage pool or group of devices, partitions, volumes, or other implementation specific means of file storage.If not yet implemented or if logical volume groups do not exist, returns an empty list.
Currently implemented for Linux (LVM2), macOS (Core Storage), and Windows (Storage Spaces).
- Returns:
- A list of
LogicalVolumeGroup
objects or an empty list if none are present.
-
getNetworkIFs
Gets a list of non-localNetworkIF
objects, representing a network interface. The list excludes local interfaces.- Returns:
- A list of
NetworkIF
objects representing the interfaces
-
getNetworkIFs
Gets a listNetworkIF
objects, representing a network interface.- Parameters:
includeLocalInterfaces
- whether to include local interfaces (loopback or no hardware address) in the result- Returns:
- A list of
NetworkIF
objects representing the interfaces
-
getDisplays
Instantiates a list ofDisplay
objects, representing monitors or other video output devices.- Returns:
- A list of Display objects or an empty list if none are present.
-
getSensors
Sensors getSensors()Instantiates aSensors
object, representing CPU temperature and fan speed.- Returns:
- A Sensors object
-
getUsbDevices
Instantiates a list ofUsbDevice
objects, representing devices connected via a usb port (including internal devices).If the value of
tree
is true, the top level devices returned from this method are the USB Controllers; connected hubs and devices in its device tree share that controller's bandwidth. If the value oftree
is false, USB devices (not controllers) are listed in a single flat list.- Parameters:
tree
- Iftrue
, returns devices connected to the existing device, accessible viaUsbDevice.getConnectedDevices()
. Iffalse
returns devices as a flat list with no connected device information.- Returns:
- A list of UsbDevice objects representing (optionally) the USB Controllers and devices connected to them, or an empty list if none are present
-
getSoundCards
Instantiates a list ofSoundCard
objects, representing the Sound cards.- Returns:
- A list of SoundCard objects or an empty list if none are present.
-
getGraphicsCards
List<GraphicsCard> getGraphicsCards()Instantiates a list ofGraphicsCard
objects, representing the Graphics cards.- Returns:
- A list of objects or an empty list if none are present.
-