Class OshiUtils

java.lang.Object
com.luna.common.os.hardware.OshiUtils

public class OshiUtils extends Object
Author:
Luna
  • Constructor Details

    • OshiUtils

      public OshiUtils()
  • Method Details

    • main

      public static void main(String[] args)
    • refresh

      public static void refresh(OshiHardware oshiHardware, oshi.SystemInfo si)
      刷新系统状态
      Parameters:
      oshiHardware -
      si -
    • baseInfo

      public static OshiHardware baseInfo(oshi.SystemInfo si)
    • acquireMACAddressSet

      public static Set<String> acquireMACAddressSet(oshi.hardware.HardwareAbstractionLayer hal)
      获取mac地址

      可能有多个

      Returns:
    • cpuInfo

      public static Processor cpuInfo(oshi.hardware.CentralProcessor processor)
      设置CPU信息
    • memoryInfo

      public static Memory memoryInfo(oshi.hardware.GlobalMemory memory)
      设置内存信息
    • jvmInfo

      public static Jvm jvmInfo()
      设置Java虚拟机
    • getStartTime

      public static Date getStartTime()
      JDK启动时间
    • getRunTime

      public static Long getRunTime(DateUnit unit)
      JDK运行时间
    • sysFiles

      public static List<SysFile> sysFiles(oshi.software.os.OperatingSystem os)
      设置磁盘信息
    • sysInfo

      public static SystemInfoDTO sysInfo()
      设置服务器信息
    • convertSysFile

      public static SysFileDTO convertSysFile(SysFile sysFile)
    • convertMemory

      public static MemoryDTO convertMemory(Memory memory)
    • converProcessor

      public static ProcessorDTO converProcessor(Processor processor)
    • convertJvm

      public static JvmDTO convertJvm(Jvm jvm)
    • oshiHardware2oshiHardwareDTO

      public static OshiHardwareDTO oshiHardware2oshiHardwareDTO(OshiHardware oshiHardware)