Class SolarisNetworkIF

java.lang.Object
oshi.hardware.common.AbstractNetworkIF
oshi.hardware.common.platform.unix.solaris.SolarisNetworkIF
All Implemented Interfaces:
NetworkIF

@ThreadSafe public abstract class SolarisNetworkIF extends AbstractNetworkIF
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().
  • Constructor Details

  • Method Details

    • updateAttributes

      public boolean updateAttributes()
      Description copied from interface: NetworkIF
      Updates 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:
      true if the update was successful, false otherwise.
    • 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 result
      factory - creates the platform-specific interface instances
      Returns:
      a list of NetworkIF objects representing the interfaces
    • queryStats

      protected abstract SolarisNetworkIF.IfStats queryStats()
      Looks up this interface's stats from the subclass's kstat data source.
      Returns:
      stats POJO, or null if no entry was found for this interface name