Class NetworkAdapterConfigurationService

java.lang.Object
io.github.eggy03.ferrumx.windows.service.network.NetworkAdapterConfigurationService
All Implemented Interfaces:
CommonServiceInterface<NetworkAdapterConfiguration>

public class NetworkAdapterConfigurationService extends Object implements CommonServiceInterface<NetworkAdapterConfiguration>
Service class for fetching network adapter configuration information from the system.

This class executes the CimQuery.NETWORK_ADAPTER_CONFIGURATION_QUERY PowerShell command and maps the resulting JSON into a list of NetworkAdapterConfiguration objects.

Thread safety

Methods of class are not thread safe.

Usage examples


 // Convenience API (creates its own short-lived session)
 NetworkAdapterConfigurationService configService = new NetworkAdapterConfigurationService();
 List<NetworkAdapterConfiguration> configs = configService.get();

 // API with re-usable session (caller manages session lifecycle)
 try (PowerShell session = PowerShell.openSession()) {
     NetworkAdapterConfigurationService configService = new NetworkAdapterConfigurationService();
     List<NetworkAdapterConfiguration> configs = configService.get(session);
 }
 
Since:
2.0.0
Author:
Egg-03
  • Constructor Details

    • NetworkAdapterConfigurationService

      public NetworkAdapterConfigurationService()
  • Method Details