Class MsftNetAdapter

java.lang.Object
io.github.eggy03.ferrumx.windows.entity.network.MsftNetAdapter

@ShallowImmutable public class MsftNetAdapter extends Object
Immutable modern representation of a network adapter on a Windows system.

Fields correspond to properties retrieved from the MSFT_NetAdapter class in the root/StandardCimv2 namespace. This class is a modern replacement for the now deprecated Win32_NetworkAdapter WMI class in the root/cimv2 namespace.

However, the Win32NetworkAdapter class which represents Win32_NetworkAdapter, will remain accessible for backwards compatibility will not be marked as deprecated by the library at this time.

Unlike Win32NetworkAdapter which stores it's configuration in Win32NetworkAdapterConfiguration and requires Win32NetworkAdapterSetting to establish an association between them, MsftNetAdapter stores configuration inside MsftNetIpAddress, MsftDnsClientServerAddress and MsftNetConnectionProfile and all of them are directly linked via the interfaceIndex field.

Usage example

MsftNetAdapter adapter = MsftNetAdapter.builder()
    .interfaceName("Ethernet1")
    .linkLayerAddress("00:1A:2B:3C:4D:5E")
    .linkSpeed("1Gbps)
    .build();

// Create a modified copy
MsftNetAdapter updated = adapter.toBuilder()
    .linkSpeed("2.5Gbps")
    .build();

See Win32NetworkAdapter, the now deprecated equivalent WMI class.

See MsftNetIpAddress, for IP address configuration information of a network adapter.

See MsftNetConnectionProfile, for information regarding the current profile of a network adapter.

See MsftDnsClientServerAddress, for configuration information regarding the DNS servers of a network adapter.

Since:
3.0.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) @Nullable String
    Uniquely identifies the network adapter on the system.
    (package private) @Nullable String
    Date of the currently installed driver.
    (package private) @Nullable String
    Name of the network adapter driver.
    (package private) @Nullable String
    Version number of the network adapter driver.
    (package private) @Nullable Boolean
    Indicates whether the adapter supports full-duplex mode.
    (package private) @Nullable Boolean
    Indicates whether the adapter is hidden from the user interface.
    (package private) @Nullable String
    Friendly alias name assigned to the network interface by the operating system or user.
    (package private) @Nullable String
    Interface Description, also known as "ifDesc" or display name is a unique name assigned to the network adapter during installation.
    (package private) @Nullable Long
    The unique interface index number used by the network stack.
    (package private) @Nullable String
    Name of the network adapter interface.
    (package private) @Nullable Long
    Current operational status of the network adapter interface.
    (package private) @Nullable Long
    Type of interface as defined by the IANA Interface Type registry.
    (package private) @Nullable String
    The physical (MAC) address of the network adapter.
    (package private) @Nullable String
    The current link speed as a formatted string, if available.
    (package private) @Nullable Long
    The current media connection state of the adapter.
    (package private) @Nullable String
    Type of network media currently in use (for example, Ethernet or Wi-Fi).
    (package private) @Nullable Long
    Maximum Transmission Unit (MTU) size of the adapter, in bytes.
    (package private) @Nullable Long
    Network adapter media type.
    (package private) @Nullable Long
    The types of physical media that the network adapter supports.
    (package private) @Nullable String
    Physical type of network media String equivalent of ndisPhysicalMedium
    (package private) @Nullable String
    Plug and Play (PnP) device identifier assigned to the adapter by Windows.
    (package private) @Nullable Long
    Raw value of the current receive link speed in bits per second.
    (package private) @Nullable String
    Current operational status of the net adapter device.
    (package private) @Nullable Long
    Raw value of the current transmit link speed in bits per second.
    (package private) @Nullable Boolean
    Indicates whether this adapter represents a virtual interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Boolean
     
    @Nullable Boolean
     
    @Nullable Boolean
     
    @NotNull String
    Retrieves the entity in a JSON pretty-print formatted string

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • deviceId

      @SerializedName("DeviceID") @Nullable @Nullable String deviceId
      Uniquely identifies the network adapter on the system.
    • pnpDeviceId

      @SerializedName("PnPDeviceID") @Nullable @Nullable String pnpDeviceId
      Plug and Play (PnP) device identifier assigned to the adapter by Windows.
    • interfaceIndex

      @SerializedName("InterfaceIndex") @Nullable @Nullable Long interfaceIndex
      The unique interface index number used by the network stack.

      Used to associate related objects such as MsftNetIpAddress, MsftDnsClientServerAddress, MsftNetConnectionProfile.

      Example: 12

    • interfaceName

      @SerializedName("InterfaceName") @Nullable @Nullable String interfaceName
      Name of the network adapter interface.

      Example: "Realtek PCIe GbE Family Controller"

    • interfaceType

      @SerializedName("InterfaceType") @Nullable @Nullable Long interfaceType
      Type of interface as defined by the IANA Interface Type registry.
    • interfaceDescription

      @SerializedName("InterfaceDescription") @Nullable @Nullable String interfaceDescription
      Interface Description, also known as "ifDesc" or display name is a unique name assigned to the network adapter during installation. This name cannot be changed and is persisted as long as the network adapter is not uninstalled.
    • interfaceAlias

      @SerializedName("InterfaceAlias") @Nullable @Nullable String interfaceAlias
      Friendly alias name assigned to the network interface by the operating system or user.

      Example: "Ethernet"

    • interfaceOperationalStatus

      @SerializedName("InterfaceOperationalStatus") @Nullable @Nullable Long interfaceOperationalStatus
      Current operational status of the network adapter interface.

      Possible values:

      • 1-Up
      • 2-Down
      • 3-Testing
      • 4-Unknown
      • 5-Dormant
      • 6-NotPresent
      • 7-LowerLayerDown
    • virtual

      @SerializedName("Virtual") @Nullable @Nullable Boolean virtual
      Indicates whether this adapter represents a virtual interface.

      Example: true for Hyper-V virtual adapters

    • fullDuplex

      @SerializedName("FullDuplex") @Nullable @Nullable Boolean fullDuplex
      Indicates whether the adapter supports full-duplex mode.
    • hidden

      @SerializedName("Hidden") @Nullable @Nullable Boolean hidden
      Indicates whether the adapter is hidden from the user interface.
    • status

      @SerializedName("Status") @Nullable @Nullable String status
      Current operational status of the net adapter device.

      Possible OPERATIONAL values:

      • "OK"
      • "Degraded"
      • "Pred Fail"

      Possible NON-OPERATIONAL values:

      • "Unknown"
      • "Error"
      • "Starting"
      • "Stopping"
      • "Service"

      Possible OTHER values:

      • "Stressed"
      • "NonRecover"
      • "No Contact"
      • "Lost Comm"
    • linkLayerAddress

      @SerializedName("LinkLayerAddress") @Nullable @Nullable String linkLayerAddress
      The physical (MAC) address of the network adapter.

      Example: "00:1A:2B:3C:4D:5E"

    • linkSpeed

      @SerializedName("LinkSpeed") @Nullable @Nullable String linkSpeed
      The current link speed as a formatted string, if available.

      Example: "1 Gbps"

    • receiveLinkSpeedRaw

      @SerializedName("ReceiveLinkSpeed") @Nullable @Nullable Long receiveLinkSpeedRaw
      Raw value of the current receive link speed in bits per second.
    • transmitLinkSpeedRaw

      @SerializedName("TransmitLinkSpeed") @Nullable @Nullable Long transmitLinkSpeedRaw
      Raw value of the current transmit link speed in bits per second.
    • driverName

      @SerializedName("DriverName") @Nullable @Nullable String driverName
      Name of the network adapter driver.

      Example: "rt640x64.sys"

    • driverVersion

      @SerializedName("DriverVersion") @Nullable @Nullable String driverVersion
      Version number of the network adapter driver.

      Example: "12.18.9.10"

    • driverDate

      @SerializedName("DriverDate") @Nullable @Nullable String driverDate
      Date of the currently installed driver.
    • mtuSize

      @SerializedName("MtuSize") @Nullable @Nullable Long mtuSize
      Maximum Transmission Unit (MTU) size of the adapter, in bytes.

      Example: 1500

    • mediaConnectState

      @SerializedName("MediaConnectState") @Nullable @Nullable Long mediaConnectState
      The current media connection state of the adapter.

      Possible values:

      • 0-Unknown
      • 1-Connected
      • 2-Disconnected
    • ndisMedium

      @SerializedName("NdisMedium") @Nullable @Nullable Long ndisMedium
      Network adapter media type. Numeric equivalent of mediaType

      Possible values:

      • 0 – 802.3
      • 1 – 802.5
      • 2 – FDDI
      • 3 – WAN
      • 4 – LocalTalk
      • 5 – DIX
      • 6 – Raw Arcnet
      • 7 – 878.2
      • 8 – ATM
      • 9 – Wireless WAN
      • 10 – IrDA
      • 11 – BPC
      • 12 – Connection Oriented WAN
      • 13 – IP 1394
      • 14 – InfiniBand (IB)
      • 15 – Tunnel
      • 16 – Native 802.11
      • 17 – Loopback
      • 18 – WiMAX
      • 19 – IP
    • ndisPhysicalMedium

      @SerializedName("NdisPhysicalMedium") @Nullable @Nullable Long ndisPhysicalMedium
      The types of physical media that the network adapter supports. Numeric equivalent of physicalMediaType

      Possible values:

      • 0 – Unspecified
      • 1 – Wireless LAN
      • 2 – Cable Modem
      • 3 – Phone Line
      • 4 – Power Line
      • 5 – DSL
      • 6 – Fibre Channel (FC)
      • 7 – IEEE 1394
      • 8 – Wireless WAN
      • 9 – Native 802.11
      • 10 – Bluetooth
      • 11 – InfiniBand
      • 12 – WiMAX
      • 13 – Ultra-Wideband (UWB)
      • 14 – 802.3
      • 15 – 802.5
      • 16 – IrDA
      • 17 – Wired WAN
      • 18 – Wired Connection Oriented WAN
      • 19 – Other
    • mediaType

      @SerializedName("MediaType") @Nullable @Nullable String mediaType
      Type of network media currently in use (for example, Ethernet or Wi-Fi). String equivalent of ndisMedium
    • physicalMediaType

      @SerializedName("PhysicalMediaType") @Nullable @Nullable String physicalMediaType
      Physical type of network media String equivalent of ndisPhysicalMedium

      Example: "802.3"

  • Constructor Details

    • MsftNetAdapter

      public MsftNetAdapter()
  • Method Details

    • isVirtual

      @Nullable public @Nullable Boolean isVirtual()
    • isFullDuplex

      @Nullable public @Nullable Boolean isFullDuplex()
    • isHidden

      @Nullable public @Nullable Boolean isHidden()
    • toString

      @NotNull public @NotNull String toString()
      Retrieves the entity in a JSON pretty-print formatted string
      Overrides:
      toString in class Object
      Returns:
      the String value of the object in JSON pretty-print format