Class BiosService
java.lang.Object
io.github.eggy03.ferrumx.windows.service.mainboard.BiosService
- All Implemented Interfaces:
CommonServiceInterface<Bios>
Service class for fetching BIOS information from the system.
This class executes the CimQuery.BIOS_QUERY
PowerShell command
and maps the resulting JSON into a list of Bios
objects.
Thread safety
Methods of class are not thread safe.Usage examples
// Convenience API (creates its own short-lived session)
BiosService biosService = new BiosService();
List<Bios> biosList = biosService.get();
// API with re-usable session (caller manages session lifecycle)
try (PowerShell session = PowerShell.openSession()) {
BiosService biosService = new BiosService();
List<Bios> biosList = biosService.get(session);
}
- Since:
- 2.0.0
- Author:
- Egg-03
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BiosService
public BiosService()
-
-
Method Details
-
get
Retrieves a list of BIOS entries present in the system.Each invocation creates and uses a short-lived PowerShell session internally.
- Specified by:
get
in interfaceCommonServiceInterface<Bios>
- Returns:
- a list of
Bios
objects representing the system BIOS. Returns an empty list if no BIOS entries are detected. - Throws:
com.google.gson.JsonSyntaxException
- if there is an error executing the PowerShell command or parsing the output.
-
get
Retrieves a list of BIOS entries present in the system using the caller'sPowerShell
session.- Specified by:
get
in interfaceCommonServiceInterface<Bios>
- Parameters:
powerShell
- an existing PowerShell session managed by the caller- Returns:
- a list of
Bios
objects representing the system BIOS. Returns an empty list if no BIOS entries are detected. - Throws:
com.google.gson.JsonSyntaxException
- if there is an error executing the PowerShell command or parsing the output.
-