Class DMIProcessorService
java.lang.Object
io.github.eggy03.dmidecode.service.processor.DMIProcessorService
- All Implemented Interfaces:
CommonDMIServiceInterface<DMIProcessor>
Service class for fetching processor information from the system.
This class executes the DMIType.PROCESSOR dmidecode command
and maps the resulting output into a DMIProcessor object.
Usage examples
DMIProcessorService service = new DMIProcessorService();
Optional<DMIProcessor> processor = service.get(10);
- Since:
- 0.1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreatesDMIProcessorServicewith default configuration.DMIProcessorService(@NonNull TerminalService terminalService, @NonNull DMIProcessorMapper mapper) Package Private constructor with injectable dependencies -
Method Summary
Modifier and TypeMethodDescription@Unmodifiable @NonNull List<DMIProcessor> get(long timeout) Retrieves processor information present in the system using an isolateddmidecodeprocess with a configurable timeout.
-
Field Details
-
terminalService
-
mapper
-
-
Constructor Details
-
DMIProcessorService
public DMIProcessorService()CreatesDMIProcessorServicewith default configuration.- Since:
- 0.3.0
-
DMIProcessorService
DMIProcessorService(@NonNull TerminalService terminalService, @NonNull DMIProcessorMapper mapper) Package Private constructor with injectable dependencies- Parameters:
terminalService- theTerminalServiceinstance to use, must not benullmapper- the mapper instance to use, must not benull- Since:
- 0.3.0
-
-
Method Details
-
get
Retrieves processor information present in the system using an isolateddmidecodeprocess with a configurable timeout.The process is pre-maturely terminated if execution exceeds the specified timeout.
- Specified by:
getin interfaceCommonDMIServiceInterface<DMIProcessor>- Parameters:
timeout- the maximum time (in seconds) to wait for thedmidecodecommand to complete before terminating the process- Returns:
- a list containing
DMIProcessorentries if present, or an empty list if no processor entries are detected - Since:
- 0.1.0
-