Class ComputerSystemProductService

java.lang.Object
io.github.eggy03.ferrumx.windows.service.product.ComputerSystemProductService
All Implemented Interfaces:
OptionalCommonServiceInterface<ComputerSystemProduct>

public class ComputerSystemProductService extends Object implements OptionalCommonServiceInterface<ComputerSystemProduct>
Service class for fetching the system product information.

This class executes the CimQuery.COMPUTER_SYSTEM_PRODUCT PowerShell command and maps the resulting JSON into an Optional ComputerSystemProduct object.

Thread safety

Methods of class are not thread safe.

Usage examples


 // Convenience API (creates its own short-lived session)
 ComputerSystemProductService productService = new ComputerSystemProductService();
 Optional<ComputerSystemProduct> product = productService.get();

 // API with re-usable session (caller manages session lifecycle)
 try (PowerShell session = PowerShell.openSession()) {
     ComputerSystemProductService productService = new ComputerSystemProductService();
     Optional<ComputerSystemProduct> product = productService.get(session);
 }
 
Since:
2.0.0
Author:
Egg-03