Class SolarisNetworkIF
java.lang.Object
oshi.hardware.common.AbstractNetworkIF
oshi.hardware.common.platform.unix.solaris.SolarisNetworkIF
- All Implemented Interfaces:
NetworkIF
Abstract base for Solaris NetworkIF. The interface enumeration (
getNetworks(boolean, SolarisNetworkIF.NetworkIFFactory)) is shared; the kstat
per-interface stats are native and fetched by the JNA and FFM subclasses via queryStats().-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classPer-interface stats the Solaris HAL reads.protected static interfaceCreates a concrete (JNA or FFM) Solaris network interface.Nested classes/interfaces inherited from interface NetworkIF
NetworkIF.IfOperStatusModifier and TypeInterfaceDescriptionstatic enumThe current operational state of a network interface. -
Field Summary
Fields inherited from class AbstractNetworkIF
bytesRecv, bytesSent, collisions, inDrops, inErrors, outErrors, packetsRecv, packetsSent, speed, timeStampModifier and TypeFieldDescriptionprotected longprotected longprotected longprotected longprotected longprotected longprotected longprotected longprotected longprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNetworks(boolean includeLocalInterfaces, SolarisNetworkIF.NetworkIFFactory factory) Gets all network interfaces on this machine, building each with the given concrete factory.protected abstract SolarisNetworkIF.IfStatsLooks up this interface's stats from the subclass's kstat data source.booleanUpdates interface network statistics on this interface.Methods inherited from class AbstractNetworkIF
getBytesRecv, getBytesSent, getCollisions, getDisplayName, getIndex, getInDrops, getInErrors, getIPv4addr, getIPv6addr, getMacaddr, getMTU, getName, getNetworkInterfaces, getOutErrors, getPacketsRecv, getPacketsSent, getPrefixLengths, getSpeed, getSubnetMasks, getTimeStamp, isKnownVmMacAddr, queryNetworkInterface, toStringModifier and TypeMethodDescriptionlongGetter for the fieldbytesRecv.longGetter for the fieldbytesSent.longGetter for the fieldcollisions.Interface description.intgetIndex()Interface index.longGetter for the fieldinDrops.longGetter for the fieldinErrors.String[]The Internet Protocol (IP) v4 address.String[]The Internet Protocol (IP) v6 address.The Media Access Control (MAC) address.longgetMTU()The interface Maximum Transmission Unit (MTU).getName()Interface name.protected static List<NetworkInterface> getNetworkInterfaces(boolean includeLocalInterfaces) Returns network interfaces on this machine.longGetter for the fieldoutErrors.longGetter for the fieldpacketsRecv.longGetter for the fieldpacketsSent.Short[]The Internet Protocol (IP) v6 address.longgetSpeed()Getter for the fieldspeed.Short[]The Internet Protocol (IP) v4 subnet masks.longGetter for the fieldtimeStamp.booleanDetermines if the MAC address on this interface corresponds to a known Virtual Machine.Gets theNetworkInterfaceobject.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface NetworkIF
getIfAlias, getIfOperStatus, getIfType, getNdisPhysicalMediumType, isConnectorPresentModifier and TypeMethodDescriptiondefault StringTheifAliasas described in RFC 2863.default NetworkIF.IfOperStatusTheifOperStatusas described in RFC 2863.default int(Windows, macOS) The NDIS Interface Type.default int(Windows Vista and higher only) The NDIS physical medium type.default boolean(Windows Vista and higher) Set if a connector is present on the network interface.
-
Constructor Details
-
SolarisNetworkIF
- Throws:
InstantiationException
-
-
Method Details
-
updateAttributes
public boolean updateAttributes()Description copied from interface:NetworkIFUpdates interface network statistics on this interface. Statistics include packets and bytes sent and received, and interface speed.This method is intended for updating a single interface that is being individually monitored. If you are updating multiple interfaces, it is more efficient to re-query the entire list from
HardwareAbstractionLayer.getNetworkIFs()and correlate the results, since on many platforms the full list must be queried to provide any individual result.- Returns:
trueif the update was successful,falseotherwise.
-
getNetworks
protected static List<NetworkIF> getNetworks(boolean includeLocalInterfaces, SolarisNetworkIF.NetworkIFFactory factory) Gets all network interfaces on this machine, building each with the given concrete factory.- Parameters:
includeLocalInterfaces- include local interfaces in the resultfactory- creates the platform-specific interface instances- Returns:
- a list of
NetworkIFobjects representing the interfaces
-
queryStats
Looks up this interface's stats from the subclass's kstat data source.- Returns:
- stats POJO, or
nullif no entry was found for this interface name
-