Class OpenBsdHWDiskStore
java.lang.Object
oshi.hardware.common.AbstractHWDiskStore
oshi.hardware.common.platform.unix.openbsd.OpenBsdHWDiskStore
- All Implemented Interfaces:
HWDiskStore
Shared OpenBSD HWDiskStore logic. Subclasses provide the sysctl backend (JNA or FFM).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceFactory for creating platform-specific OpenBsdHWDiskStore instances. -
Field Summary
Fields inherited from class AbstractHWDiskStore
currentQueueLength, partitionList, readBytes, reads, timeStamp, transferTime, writeBytes, writesModifier and TypeFieldDescriptionprotected longprotected final AtomicReference<List<HWPartition>> protected longprotected longprotected longprotected longprotected longprotected long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOpenBsdHWDiskStore(String name, String model, String serial, long size) -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T extends OpenBsdHWDiskStore>
List<HWDiskStore> getDisks(BinaryOperator<String> sysctlStr, OpenBsdHWDiskStore.DiskStoreFactory<T> factory) Gets the disks on this machine using the provided sysctl accessor.booleanMake a best effort to update all the statistics about the drive without needing to recreate the drive list.Methods inherited from class AbstractHWDiskStore
getCurrentQueueLength, getDiskType, getModel, getName, getPartitions, getReadBytes, getReads, getSerial, getSize, getTimeStamp, getTransferTime, getWriteBytes, getWrites, setDiskStats, setPartitionList, toStringModifier and TypeMethodDescriptionlongThe length of the disk queue (#I/O's in progress).The type of the disk, such as SSD, HDD, Removable, Virtual, or Unknown.getModel()The disk modelgetName()The disk nameThe partitions on this disk.longThe number of bytes read from the disklonggetReads()The number of reads from the diskThe disk serial number, if available.longgetSize()The size of the disklongThe time this disk's statistics were updated.longThe time spent reading or writing, in milliseconds.longThe number of bytes written to the disklongThe number of writes to the diskprotected voidsetDiskStats(long reads, long readBytes, long writes, long writeBytes, long currentQueueLength, long transferTime, long timeStamp) Sets the disk statistics.protected voidsetPartitionList(List<HWPartition> partitionList) Sets the partition list.toString()
-
Constructor Details
-
OpenBsdHWDiskStore
-
-
Method Details
-
getDisks
protected static <T extends OpenBsdHWDiskStore> List<HWDiskStore> getDisks(BinaryOperator<String> sysctlStr, OpenBsdHWDiskStore.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
HWDiskStoreobjects representing the disks
-
updateAttributes
public boolean updateAttributes()Description copied from interface:HWDiskStoreMake 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
-