Class DMICacheService

java.lang.Object
io.github.eggy03.dmidecode.service.processor.DMICacheService
All Implemented Interfaces:
CommonDMIServiceInterface<DMICache>

public class DMICacheService extends Object implements CommonDMIServiceInterface<DMICache>
Service class for fetching cache information from the system.

This class executes the DMIType.CACHE dmidecode command and maps the resulting output into DMICache objects.

Usage examples


 DMICacheService service = new DMICacheService();
 List<DMICache> caches = service.get(10);
 
Since:
0.1.0
  • Constructor Details

    • DMICacheService

      public DMICacheService()
  • Method Details

    • get

      public @Unmodifiable @NonNull List<DMICache> get(long timeout)
      Retrieves cache entries present in the system using an isolated dmidecode process with a configurable timeout.

      The process is pre-maturely terminated if execution exceeds the specified timeout.

      Specified by:
      get in interface CommonDMIServiceInterface<DMICache>
      Parameters:
      timeout - the maximum time (in seconds) to wait for the dmidecode command to complete before terminating the process
      Returns:
      a list of DMICache objects representing the system cache entries. Returns an empty list if no cache entries are detected.
      Since:
      0.1.0