Klasse SystemHandler

java.lang.Object
de.bytestore.hostinger.handler.SystemHandler

public class SystemHandler extends Object
The SystemHandler class provides methods to retrieve various system information such as CPU usage, memory usage, and disk usage.
Seit:
1.0.0
  • Felddetails

    • cachedStats

      protected static List<Stats> cachedStats
    • upload

      protected static LinkedList<String> upload
    • receive

      protected static LinkedList<String> receive
    • cpuTempAvailable

      protected static boolean cpuTempAvailable
  • Konstruktordetails

    • SystemHandler

      public SystemHandler()
  • Methodendetails

    • getCPUUsage

      public static double getCPUUsage()
      Calculates the current CPU usage.
      Gibt zurück:
      The CPU usage as a percentage, represented as a long value.
    • getCPUTemperature

      public static double getCPUTemperature()
      Retrieves the CPU temperature of the system.
      Gibt zurück:
      The CPU temperature in degrees Celsius, represented as a double value.
    • getInterfaces

      public static List<oshi.hardware.NetworkIF> getInterfaces()
      Retrieves a list of network interfaces.
      Gibt zurück:
      A List of NetworkIF objects representing the network interfaces on the system.
    • getDefaultInterface

      public static NetworkInterface getDefaultInterface()
    • getNetworkSend

      public static String getNetworkSend()
      Retrieves the total network send for a specific network interface.
      Gibt zurück:
      The total network send in bytes, represented as a formatted string value.
    • getNetworkReceive

      public static String getNetworkReceive()
      Retrieves the total network receive of the system.
      Gibt zurück:
      The total network receive in bytes, represented as a double value.
    • getMemoryTotal

      public static long getMemoryTotal()
      Retrieves the total amount of memory available in the system.
      Gibt zurück:
      The total memory available in the system, represented as a long value.
    • getMemoryUsage

      public static double getMemoryUsage()
      Calculates the memory usage in the system.
      Gibt zurück:
      The memory usage in the system, represented as a long value.
    • getTotalDiskCapacity

      public static long getTotalDiskCapacity()
      Calculates the total system disk capacity.
      Gibt zurück:
      The total system disk capacity, represented as a long value.
    • getDiskUsage

      public static double getDiskUsage()
      Calculates the disk usage in the system.
      Gibt zurück:
      The disk usage in the system, represented as a long value.
    • getCPUUsagePercentage

      public static double getCPUUsagePercentage()
      Calculates the CPU usage percentage in the system.
      Gibt zurück:
      The CPU usage percentage in the system, represented as a double value.
    • getMemoryUsagePercentage

      public static double getMemoryUsagePercentage()
      Calculates the memory usage percentage of the system.
      Gibt zurück:
      The memory usage percentage as a double value.
    • getHeapUsage

      public static double getHeapUsage()
      Returns the current heap usage as a percentage.
      Gibt zurück:
      the heap usage as a percentage
    • getHeapMax

      public static long getHeapMax()
      Returns the maximum size of the heap in bytes.
      Gibt zurück:
      the maximum size of the heap
    • load

      public static void load()
    • getHeapUsagePercentage

      public static double getHeapUsagePercentage()
      Calculates the current heap usage percentage.
      Gibt zurück:
      The heap usage percentage as a double value.
    • reload

      public static void reload()
    • getCachedValue

      public static double getCachedValue(StatsType typeIO)
    • getCachedValueListNotRenew

      public static LinkedList<Object> getCachedValueListNotRenew(StatsType typeIO)
    • getCachedValueList

      public static LinkedList<Object> getCachedValueList(StatsType typeIO)
    • getCachedValue

      public static Object getCachedValue(String keyIO)
    • getCachedValue

      public static Object getCachedValue(String keyIO, boolean renewIO)
      Retrieves the cached value for the given key. If the value is not found in the cache, it is fetched from the data source and added to the cache.
      Parameter:
      keyIO - The key for the cached value.
      Gibt zurück:
      The cached value associated with the key.
    • humanReadableByteCountBin

      public static String humanReadableByteCountBin(long bytesA)
    • isWindows

      public static boolean isWindows()
    • getOperatingSystem

      public static String getOperatingSystem()
    • getUpdates

      public static LinkedList<com.google.gson.JsonObject> getUpdates(String branchIO)
      Retrieves updates for the specified branch IO.
      Parameter:
      branchIO - The branch IO for which updates are retrieved.
      Gibt zurück:
      An ArrayList of JsonObject containing the updates.
      Löst aus:
      RuntimeException - if there is an IOException while retrieving updates.
    • startUpdate

      public static void startUpdate(String branchIO, String urlIO, DownloadCallback callbackIO, boolean forceIO)
      Starts the update process.
      Parameter:
      branchIO - The branch IO for which updates are retrieved.
      urlIO - The URL for the update.
      forceIO - A flag indicating whether to force the update.
      Löst aus:
      MalformedURLException - if the URL is not valid.
    • getVersion

      public static String getVersion()
      Retrieves the version of the