Package oshi.hardware

Interface HardwareAbstractionLayer

All Known Implementing Classes:
AbstractHardwareAbstractionLayer, FreeBsdHardwareAbstractionLayer, LinuxHardwareAbstractionLayer, MacHardwareAbstractionLayer, SolarisHardwareAbstractionLayer, WindowsHardwareAbstractionLayer

@ThreadSafe
public interface HardwareAbstractionLayer
A hardware abstraction layer. Provides access to hardware items such as processors, memory, battery, and disks.
  • Method Details

    • getComputerSystem

      ComputerSystem getComputerSystem()
      Instantiates a ComputerSystem 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 a CentralProcessor object. This represents one or more Logical CPUs.
      Returns:
      A CentralProcessor object.
    • getMemory

      GlobalMemory getMemory()
      Instantiates a GlobalMemory object.
      Returns:
      A memory object.
    • getPowerSources

      PowerSource[] getPowerSources()
      Instantiates an array of PowerSource objects, representing batteries, etc.
      Returns:
      An array of PowerSource objects or an empty array if none are present.
    • getDiskStores

      HWDiskStore[] getDiskStores()
      Instantiates an array of HWDiskStore objects, representing a physical hard disk or other similar storage device
      Returns:
      An array of HWDiskStore objects or an empty array if none are present.
    • getNetworkIFs

      NetworkIF[] getNetworkIFs()
      Instantiates an array of NetworkIF objects, representing a network interface
      Returns:
      An array of HWNetworkStore objects or an empty array if none are present.
    • getDisplays

      Display[] getDisplays()
      Instantiates an array of Display objects, representing monitors or other video output devices.
      Returns:
      An array of Display objects or an empty array if none are present.
    • getSensors

      Sensors getSensors()
      Instantiates a Sensors object, representing CPU temperature and fan speed
      Returns:
      A Sensors object
    • getUsbDevices

      UsbDevice[] getUsbDevices​(boolean tree)
      Instantiates an array of UsbDevice 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 of tree is false, USB devices (not controllers) are listed in a single flat array.

      Parameters:
      tree - Whether to display devices in a nested tree format from their controllers
      Returns:
      An array of UsbDevice objects representing (optionally) the USB Controllers and devices connected to them, or an empty array if none are present
    • getSoundCards

      SoundCard[] getSoundCards()
      Instantiates an array of SoundCard objects, representing the Sound cards.
      Returns:
      An array of SoundCard objects or an empty array if none are present.
    • getGraphicsCards

      GraphicsCard[] getGraphicsCards()
      Instantiates an array of GraphicsCard objects, representing the Graphics cards.
      Returns:
      An array of GraphicsCard objects or an empty array if none are present.