Package com.ferrumx.system.hardware
Class Win32_NetworkAdapter
java.lang.Object
com.ferrumx.system.hardware.Win32_NetworkAdapter
This class contains methods that query the Win32_NetworkAdapter class of WMI
to fetch the Network Adapters that a installed and active.
The following properties are fetched: Name, Description, PNPDeviceID, MACAddress, Installed, NetEnabled, NetConnectionID, PhysicalAdapter, TimeOfLastReset
- Author:
- Egg-03
-
Method Summary
Modifier and TypeMethodDescriptionFetches a list of DeviceIDs of the Network Adapters that are activegetNetworkAdapters
(String deviceID) Fetches the properties mentioned in the class description based on the DeviceID of the adapter passed onto it
-
Method Details
-
getDeviceIDList
public static List<String> getDeviceIDList() throws IOException, IndexOutOfBoundsException, ShellException, InterruptedExceptionFetches a list of DeviceIDs of the Network Adapters that are active- Returns:
- a
List
of all the physical adapter DeviceIDs - Throws:
IOException
- re-throws the exception thrown byCIM_ML.getPropertyValueWhere(String, String, String, String)
when there are I/O Errors during streaming of data from and to Powershell and other generated filesIndexOutOfBoundsException
- re-throws the exception thrown byCIM_ML.getPropertyValueWhere(String, String, String, String)
when there is a parsing error of data fetched from Windows PowershellShellException
- if any internal command used in the powershell throws errorsInterruptedException
- if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();
-
getNetworkAdapters
public static Map<String,String> getNetworkAdapters(String deviceID) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException Fetches the properties mentioned in the class description based on the DeviceID of the adapter passed onto it- Parameters:
deviceID
- the network adapter ID fetched fromgetDeviceIDList()
- Returns:
- a
Map
of the properties and their values mentioned in the class description - Throws:
IOException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValuesWhere(String, String, String, String)
when there are I/O Errors during streaming of data from and to Power-shell and other generated filesIndexOutOfBoundsException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValuesWhere(String, String, String, String)
when there is a parsing error of data fetched from Windows Power-shellShellException
- if any internal command used in the power-shell throws errorsInterruptedException
- if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();
-