Class NetStat


  • @ThreadSafe
    public final class NetStat
    extends java.lang.Object
    Utility to query NetStat.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  NetStat.IFdata
      Class to encapsulate IF data for method return
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int CTL_NET  
      private static org.slf4j.Logger LOG  
      private static int NET_RT_IFLIST2  
      private static int PF_ROUTE  
      private static int RTM_IFINFO2  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NetStat()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.Integer,​NetStat.IFdata> queryIFdata​(int index)
      Map data for network interfaces.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NetStat

        private NetStat()
    • Method Detail

      • queryIFdata

        public static java.util.Map<java.lang.Integer,​NetStat.IFdata> queryIFdata​(int index)
        Map data for network interfaces.
        Parameters:
        index - If positive, limit the map to only return data for this interface index. If negative, returns data for all indices.
        Returns:
        a map of NetStat.IFdata object indexed by the interface index, encapsulating the stats