Class DMIMemoryDeviceService
java.lang.Object
io.github.eggy03.dmidecode.service.memory.DMIMemoryDeviceService
- All Implemented Interfaces:
CommonDMIServiceInterface<DMIMemoryDevice>
public class DMIMemoryDeviceService
extends Object
implements CommonDMIServiceInterface<DMIMemoryDevice>
Service class for fetching memory device information from the system.
This class executes the DMIType.MEMORY_DEVICE dmidecode command
and maps the resulting output into DMIMemoryDevice objects.
Usage examples
DMIMemoryDeviceService service = new DMIMemoryDeviceService();
List<DMIMemoryDevice> memoryDevices = service.get(10);
- Since:
- 0.1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DMIMemoryDeviceMapperprivate final TerminalService -
Constructor Summary
ConstructorsConstructorDescriptionCreatesDMIMemoryDeviceServicewith default configuration.DMIMemoryDeviceService(@NonNull TerminalService terminalService, @NonNull DMIMemoryDeviceMapper mapper) Package Private constructor with injectable dependencies -
Method Summary
Modifier and TypeMethodDescription@Unmodifiable @NonNull List<DMIMemoryDevice> get(long timeout) Retrieves memory device entries present in the system using an isolateddmidecodeprocess with a configurable timeout.
-
Field Details
-
terminalService
-
mapper
-
-
Constructor Details
-
DMIMemoryDeviceService
public DMIMemoryDeviceService()CreatesDMIMemoryDeviceServicewith default configuration.- Since:
- 0.3.0
-
DMIMemoryDeviceService
DMIMemoryDeviceService(@NonNull TerminalService terminalService, @NonNull DMIMemoryDeviceMapper 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 memory device entries 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<DMIMemoryDevice>- Parameters:
timeout- the maximum time (in seconds) to wait for thedmidecodecommand to complete before terminating the process- Returns:
- a list of
DMIMemoryDeviceobjects representing the system memory device entries. Returns an empty list if no memory device entries are detected. - Since:
- 0.1.0
-