Class LinuxComputerSystem
- java.lang.Object
-
- oshi.hardware.common.AbstractComputerSystem
-
- oshi.hardware.platform.linux.LinuxComputerSystem
-
- All Implemented Interfaces:
ComputerSystem
@Immutable final class LinuxComputerSystem extends AbstractComputerSystem
Hardware data obtained from sysfs.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Supplier<java.lang.String>manufacturerprivate java.util.function.Supplier<java.lang.String>modelprivate java.util.function.Supplier<java.lang.String>serialNumberprivate java.util.function.Supplier<java.lang.String>uuid
-
Constructor Summary
Constructors Constructor Description LinuxComputerSystem()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseboardcreateBaseboard()Instantiates the platform-specificBaseboardobjectFirmwarecreateFirmware()Instantiates the platform-specificFirmwareobjectjava.lang.StringgetHardwareUUID()Get the computer system hardware UUID, if available.java.lang.StringgetManufacturer()Get the computer system manufacturer.java.lang.StringgetModel()Get the computer system model.java.lang.StringgetSerialNumber()Get the computer system serial number, if available.private static java.lang.StringqueryManufacturer()private static java.lang.StringqueryModel()private static java.lang.StringquerySerialNumber()private static java.lang.StringqueryUUID()-
Methods inherited from class oshi.hardware.common.AbstractComputerSystem
getBaseboard, getFirmware, toString
-
-
-
-
Field Detail
-
manufacturer
private final java.util.function.Supplier<java.lang.String> manufacturer
-
model
private final java.util.function.Supplier<java.lang.String> model
-
serialNumber
private final java.util.function.Supplier<java.lang.String> serialNumber
-
uuid
private final java.util.function.Supplier<java.lang.String> uuid
-
-
Method Detail
-
getManufacturer
public java.lang.String getManufacturer()
Description copied from interface:ComputerSystemGet the computer system manufacturer.- Returns:
- The manufacturer.
-
getModel
public java.lang.String getModel()
Description copied from interface:ComputerSystemGet the computer system model.- Returns:
- The model.
-
getSerialNumber
public java.lang.String getSerialNumber()
Description copied from interface:ComputerSystemGet the computer system serial number, if available.Performs a best-effort attempt to retrieve a unique serial number from the computer system. This may originate from the baseboard, BIOS, processor, etc.
This value is provided for information only. Caution should be exercised if using this result to "fingerprint" a system for licensing or other purposes, as the result may change based on program permissions or installation of software packages. Specifically, on Linux and FreeBSD, this requires either root permissions, or installation of the (deprecated) HAL library (lshal command). Linux also attempts to read the dmi/id serial number files in sysfs, which are read-only root by default but may have permissions altered by the user.
- Returns:
- the System Serial Number, if available, otherwise returns "unknown"
-
getHardwareUUID
public java.lang.String getHardwareUUID()
Description copied from interface:ComputerSystemGet the computer system hardware UUID, if available.Performs a best-effort attempt to retrieve the hardware UUID.
- Returns:
- the Hardware UUID, if available, otherwise returns "unknown"
-
createFirmware
public Firmware createFirmware()
Description copied from class:AbstractComputerSystemInstantiates the platform-specificFirmwareobject- Specified by:
createFirmwarein classAbstractComputerSystem- Returns:
- platform-specific
Firmwareobject
-
createBaseboard
public Baseboard createBaseboard()
Description copied from class:AbstractComputerSystemInstantiates the platform-specificBaseboardobject- Specified by:
createBaseboardin classAbstractComputerSystem- Returns:
- platform-specific
Baseboardobject
-
queryManufacturer
private static java.lang.String queryManufacturer()
-
queryModel
private static java.lang.String queryModel()
-
querySerialNumber
private static java.lang.String querySerialNumber()
-
queryUUID
private static java.lang.String queryUUID()
-
-