Class DMIPhysicalMemoryArrayService
java.lang.Object
io.github.eggy03.dmidecode.service.memory.DMIPhysicalMemoryArrayService
- All Implemented Interfaces:
OptionalCommonDMIServiceInterface<DMIPhysicalMemoryArray>
public class DMIPhysicalMemoryArrayService
extends Object
implements OptionalCommonDMIServiceInterface<DMIPhysicalMemoryArray>
Service class for fetching physical memory array information from the system.
This class executes the DMIType.PHYSICAL_MEMORY_ARRAY dmidecode command
and maps the resulting output into a DMIPhysicalMemoryArray object.
Usage examples
DMIPhysicalMemoryArrayService service = new DMIPhysicalMemoryArrayService();
Optional<DMIPhysicalMemoryArray> memoryArray = service.get(10);
- Since:
- 0.1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DMIPhysicalMemoryArrayMapperprivate final TerminalService -
Constructor Summary
ConstructorsConstructorDescriptionCreatesDMIPhysicalMemoryArrayServicewith default configuration.DMIPhysicalMemoryArrayService(@NonNull TerminalService terminalService, @NonNull DMIPhysicalMemoryArrayMapper mapper) Package Private constructor with injectable dependencies -
Method Summary
Modifier and TypeMethodDescription@NonNull Optional<DMIPhysicalMemoryArray> get(long timeout) Retrieves physical memory array information present in the system using an isolateddmidecodeprocess with a configurable timeout.
-
Field Details
-
terminalService
-
mapper
-
-
Constructor Details
-
DMIPhysicalMemoryArrayService
public DMIPhysicalMemoryArrayService()CreatesDMIPhysicalMemoryArrayServicewith default configuration.- Since:
- 0.3.0
-
DMIPhysicalMemoryArrayService
DMIPhysicalMemoryArrayService(@NonNull TerminalService terminalService, @NonNull DMIPhysicalMemoryArrayMapper 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 physical memory array 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 interfaceOptionalCommonDMIServiceInterface<DMIPhysicalMemoryArray>- Parameters:
timeout- the maximum time (in seconds) to wait for thedmidecodecommand to complete before terminating the process- Returns:
- an
OptionalcontainingDMIPhysicalMemoryArrayinformation if present, orOptional.empty()if no physical memory array entry is detected - Since:
- 0.1.0
-