Package oshi.hardware.common
Class AbstractComputerSystem
- java.lang.Object
-
- oshi.hardware.common.AbstractComputerSystem
-
- All Implemented Interfaces:
java.io.Serializable
,ComputerSystem
public abstract class AbstractComputerSystem extends java.lang.Object implements ComputerSystem
Hardware data- Author:
- SchiTho1 [at] Securiton AG, widdis [at] gmail [dot] com
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractComputerSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Baseboard
getBaseboard()
Get the computer system baseboard/motherboardFirmware
getFirmware()
Get the computer system firmware/BIOSjava.lang.String
getManufacturer()
Get the computer system manufacturer.java.lang.String
getModel()
Get the computer system model.java.lang.String
getSerialNumber()
Get the computer system serial number, if available.protected void
setBaseboard(Baseboard baseboard)
protected void
setFirmware(Firmware firmware)
protected void
setManufacturer(java.lang.String manufacturer)
protected void
setModel(java.lang.String model)
protected void
setSerialNumber(java.lang.String serialNumber)
-
-
-
Method Detail
-
getManufacturer
public java.lang.String getManufacturer()
Get the computer system manufacturer.- Specified by:
getManufacturer
in interfaceComputerSystem
- Returns:
- The manufacturer.
-
getModel
public java.lang.String getModel()
Get the computer system model.- Specified by:
getModel
in interfaceComputerSystem
- Returns:
- The model.
-
getSerialNumber
public java.lang.String getSerialNumber()
Get 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, hardware UUID, 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.- Specified by:
getSerialNumber
in interfaceComputerSystem
- Returns:
- the System Serial Number, if available, otherwise returns "unknown"
-
getFirmware
public Firmware getFirmware()
Get the computer system firmware/BIOS- Specified by:
getFirmware
in interfaceComputerSystem
- Returns:
- A
Firmware
object for this system
-
getBaseboard
public Baseboard getBaseboard()
Get the computer system baseboard/motherboard- Specified by:
getBaseboard
in interfaceComputerSystem
- Returns:
- A
Baseboard
object for this system
-
setManufacturer
protected void setManufacturer(java.lang.String manufacturer)
- Parameters:
manufacturer
- The manufacturer to set.
-
setModel
protected void setModel(java.lang.String model)
- Parameters:
model
- The model to set.
-
setSerialNumber
protected void setSerialNumber(java.lang.String serialNumber)
- Parameters:
serialNumber
- The serialNumber to set.
-
setFirmware
protected void setFirmware(Firmware firmware)
- Parameters:
firmware
- The firmware to set.
-
setBaseboard
protected void setBaseboard(Baseboard baseboard)
- Parameters:
baseboard
- The baseboard to set.
-
-