Interface HardwareAbstractionLayer
- All Known Implementing Classes:
AbstractHardwareAbstractionLayer, AixHardwareAbstractionLayer, FreeBsdHardwareAbstractionLayer, LinuxHardwareAbstractionLayer, LinuxHardwareAbstractionLayerJNA, MacHardwareAbstractionLayer, MacHardwareAbstractionLayerJNA, OpenBsdHardwareAbstractionLayer, SolarisHardwareAbstractionLayer, WindowsHardwareAbstractionLayer
-
Method Summary
Modifier and TypeMethodDescriptionInstantiates aComputerSystemobject.Instantiates a list ofHWDiskStoreobjects, representing physical hard disks or other similar storage devices.Instantiates a list ofDisplayobjects, representing monitors or other video output devices.Instantiates a list ofGraphicsCardobjects, representing the Graphics cards.default List<LogicalVolumeGroup> Instantiates a list ofLogicalVolumeGroupobjects, representing a storage pool or group of devices, partitions, volumes, or other implementation specific means of file storage.Instantiates aGlobalMemoryobject.Gets a list of non-localNetworkIFobjects, representing a network interface.getNetworkIFs(boolean includeLocalInterfaces) Gets a listNetworkIFobjects, representing a network interface.Instantiates a list ofPowerSourceobjects, representing batteries, etc.Instantiates a list ofPrinterobjects, representing printers.Instantiates aCentralProcessorobject.Instantiates aSensorsobject, representing CPU temperature and fan speed.Instantiates a list ofSoundCardobjects, representing the Sound cards.getUsbDevices(boolean tree) Instantiates a list ofUsbDeviceobjects, representing devices connected via a usb port (including internal devices).
-
Method Details
-
getComputerSystem
ComputerSystem getComputerSystem()Instantiates aComputerSystemobject. This represents the physical hardware, including components such as BIOS/Firmware and a motherboard, logic board, etc.- Returns:
- a
ComputerSystemobject.
-
getProcessor
CentralProcessor getProcessor()Instantiates aCentralProcessorobject. This represents one or more Logical CPUs.- Returns:
- A
CentralProcessorobject.
-
getMemory
-
getPowerSources
List<PowerSource> getPowerSources()Instantiates a list ofPowerSourceobjects, representing batteries, etc.- Returns:
- A list of PowerSource objects or an empty list if none are present.
-
getDiskStores
List<HWDiskStore> getDiskStores()Instantiates a list ofHWDiskStoreobjects, 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 ofLogicalVolumeGroupobjects, 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
LogicalVolumeGroupobjects or an empty list if none are present.
-
getNetworkIFs
-
getNetworkIFs
-
getDisplays
-
getSensors
-
getUsbDevices
Instantiates a list ofUsbDeviceobjects, representing devices connected via a usb port (including internal devices).If the value of
treeis 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 oftreeis false, USB devices (not controllers) are listed in a single flat list.Note: in both cases each
UsbDevicein the returned list may still report connected child devices viaUsbDevice.getConnectedDevices(). Whentreeis false the list is intended for simple iteration over individual devices; callers should not recurse intoUsbDevice.getConnectedDevices()or rely onObject.toString()(which renders the full subtree) to avoid processing devices more than once.To print the full device tree rooted at each controller:
To iterate individual devices without tree structure:for (UsbDevice controller : hal.getUsbDevices(true)) { System.out.println(controller); // toString() renders the full subtree }for (UsbDevice device : hal.getUsbDevices(false)) { // Use individual fields; avoid toString() as it includes the subtree System.out.println(device.getName() + " [" + device.getVendorId() + ":" + device.getProductId() + "]"); }- Parameters:
tree- Iftrue, returns the USB Controllers as top-level entries, with connected hubs and devices accessible viaUsbDevice.getConnectedDevices(). Iffalse, returns a flat list of non-controller devices;UsbDevice.getConnectedDevices()may still be non-empty but should not be iterated to avoid duplicates.- 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
-
getGraphicsCards
List<GraphicsCard> getGraphicsCards()Instantiates a list ofGraphicsCardobjects, representing the Graphics cards.- Returns:
- A list of objects or an empty list if none are present.
-
getPrinters
-