Class SolarisHardwareAbstractionLayer

java.lang.Object
oshi.hardware.common.AbstractHardwareAbstractionLayer
oshi.hardware.platform.unix.solaris.SolarisHardwareAbstractionLayer
All Implemented Interfaces:
HardwareAbstractionLayer

@ThreadSafe public final class SolarisHardwareAbstractionLayer extends AbstractHardwareAbstractionLayer
SolarisHardwareAbstractionLayer class.
  • Constructor Details

    • SolarisHardwareAbstractionLayer

      public SolarisHardwareAbstractionLayer()
  • Method Details

    • createComputerSystem

      public ComputerSystem createComputerSystem()
      Description copied from class: AbstractHardwareAbstractionLayer
      Instantiates the platform-specific ComputerSystem object
      Specified by:
      createComputerSystem in class AbstractHardwareAbstractionLayer
      Returns:
      platform-specific ComputerSystem object
    • createMemory

      public GlobalMemory createMemory()
      Description copied from class: AbstractHardwareAbstractionLayer
      Instantiates the platform-specific GlobalMemory object
      Specified by:
      createMemory in class AbstractHardwareAbstractionLayer
      Returns:
      platform-specific GlobalMemory object
    • createProcessor

      public CentralProcessor createProcessor()
      Description copied from class: AbstractHardwareAbstractionLayer
      Instantiates the platform-specific CentralProcessor object
      Specified by:
      createProcessor in class AbstractHardwareAbstractionLayer
      Returns:
      platform-specific CentralProcessor object
    • createSensors

      public Sensors createSensors()
      Description copied from class: AbstractHardwareAbstractionLayer
      Instantiates the platform-specific Sensors object
      Specified by:
      createSensors in class AbstractHardwareAbstractionLayer
      Returns:
      platform-specific Sensors object
    • getPowerSources

      public List<PowerSource> getPowerSources()
      Description copied from interface: HardwareAbstractionLayer
      Instantiates a list of PowerSource objects, representing batteries, etc.
      Returns:
      A list of PowerSource objects or an empty list if none are present.
    • getDiskStores

      public List<HWDiskStore> getDiskStores()
      Description copied from interface: HardwareAbstractionLayer
      Instantiates a list of HWDiskStore objects, representing physical hard disks or other similar storage devices.
      Returns:
      A list of HWDiskStore objects or an empty list if none are present.
    • getDisplays

      public List<Display> getDisplays()
      Description copied from interface: HardwareAbstractionLayer
      Instantiates a list of Display objects, representing monitors or other video output devices.
      Returns:
      A list of Display objects or an empty list if none are present.
    • getNetworkIFs

      public List<NetworkIF> getNetworkIFs(boolean includeLocalInterfaces)
      Description copied from interface: HardwareAbstractionLayer
      Gets a list NetworkIF 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
    • getUsbDevices

      public List<UsbDevice> getUsbDevices(boolean tree)
      Description copied from interface: HardwareAbstractionLayer
      Instantiates a list 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 list.

      Note: in both cases each UsbDevice in the returned list may still report connected child devices via UsbDevice.getConnectedDevices(). When tree is false the list is intended for simple iteration over individual devices; callers should not recurse into UsbDevice.getConnectedDevices() or rely on Object.toString() (which renders the full subtree) to avoid processing devices more than once.

      To print the full device tree rooted at each controller:

      for (UsbDevice controller : hal.getUsbDevices(true)) {
          System.out.println(controller); // toString() renders the full subtree
      }
      
      To iterate individual devices without tree structure:
      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 - If true, returns the USB Controllers as top-level entries, with connected hubs and devices accessible via UsbDevice.getConnectedDevices(). If false, 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

      public List<SoundCard> getSoundCards()
      Description copied from interface: HardwareAbstractionLayer
      Instantiates a list of SoundCard objects, representing the Sound cards.
      Returns:
      A list of SoundCard objects or an empty list if none are present.
    • getGraphicsCards

      public List<GraphicsCard> getGraphicsCards()
      Description copied from interface: HardwareAbstractionLayer
      Instantiates a list of GraphicsCard objects, representing the Graphics cards.
      Returns:
      A list of objects or an empty list if none are present.
    • getPrinters

      public List<Printer> getPrinters()
      Description copied from interface: HardwareAbstractionLayer
      Instantiates a list of Printer objects, representing printers.
      Returns:
      A list of Printer objects or an empty list if none are present.