Class FreeBsdHWDiskStore

java.lang.Object
oshi.hardware.common.AbstractHWDiskStore
oshi.hardware.common.platform.unix.freebsd.FreeBsdHWDiskStore
All Implemented Interfaces:
HWDiskStore

@ThreadSafe public abstract class FreeBsdHWDiskStore extends AbstractHWDiskStore
Shared FreeBSD HWDiskStore logic. Subclasses provide the sysctl backend (JNA or FFM).
  • Constructor Details

    • FreeBsdHWDiskStore

      protected FreeBsdHWDiskStore(String name, String model, String serial, long size)
  • Method Details

    • updateAttributes

      public boolean updateAttributes()
      Description copied from interface: HWDiskStore
      Make a best effort to update all the statistics about the drive without needing to recreate the drive list. This method provides for more frequent periodic updates of individual drive statistics but may be less efficient to use if updating all drives. It will not detect if a removable drive has been removed and replaced by a different drive in between method calls.
      Returns:
      True if the update was (probably) successful, false if the disk was not found
    • getDisks

      protected static <T extends FreeBsdHWDiskStore> List<HWDiskStore> getDisks(BinaryOperator<String> sysctlStr, FreeBsdHWDiskStore.DiskStoreFactory<T> factory)
      Gets the disks on this machine using the provided sysctl accessor.
      Type Parameters:
      T - the concrete disk store type
      Parameters:
      sysctlStr - reads a string sysctl given (name, default)
      factory - constructs the platform-specific instance
      Returns:
      a list of HWDiskStore objects representing the disks