@Test public void computeUUID() { System.out.println(ComputerIdentifierUtil.getComputerIdentifier()); }
public static String getComputerIdentifier() { SystemInfo systemInfo = new SystemInfo(); OperatingSystem operatingSystem = systemInfo.getOperatingSystem(); HardwareAbstractionLayer hardwareAbstractionLayer = systemInfo.getHardware(); CentralProcessor centralProcessor = hardwareAbstractionLayer.getProcessor(); ComputerSystem computerSystem = hardwareAbstractionLayer.getComputerSystem(); String vendor = operatingSystem.getManufacturer(); String processorSerialNumber = computerSystem.getSerialNumber(); String processorIdentifier = centralProcessor.getIdentifier(); int processors = centralProcessor.getLogicalProcessorCount(); String delimiter = "-"; return String.format("%08x", vendor.hashCode()) + delimiter + String.format("%08x", processorSerialNumber.hashCode()) + delimiter + String.format("%08x", processorIdentifier.hashCode()) + delimiter + processors; }
ComputerIdentifierUtil { public static String getComputerIdentifier() { SystemInfo systemInfo = new SystemInfo(); OperatingSystem operatingSystem = systemInfo.getOperatingSystem(); HardwareAbstractionLayer hardwareAbstractionLayer = systemInfo.getHardware(); CentralProcessor centralProcessor = hardwareAbstractionLayer.getProcessor(); ComputerSystem computerSystem = hardwareAbstractionLayer.getComputerSystem(); String vendor = operatingSystem.getManufacturer(); String processorSerialNumber = computerSystem.getSerialNumber(); String processorIdentifier = centralProcessor.getIdentifier(); int processors = centralProcessor.getLogicalProcessorCount(); String delimiter = "-"; return String.format("%08x", vendor.hashCode()) + delimiter + String.format("%08x", processorSerialNumber.hashCode()) + delimiter + String.format("%08x", processorIdentifier.hashCode()) + delimiter + processors; } }
ComputerIdentifierUtil { public static String getComputerIdentifier() { SystemInfo systemInfo = new SystemInfo(); OperatingSystem operatingSystem = systemInfo.getOperatingSystem(); HardwareAbstractionLayer hardwareAbstractionLayer = systemInfo.getHardware(); CentralProcessor centralProcessor = hardwareAbstractionLayer.getProcessor(); ComputerSystem computerSystem = hardwareAbstractionLayer.getComputerSystem(); String vendor = operatingSystem.getManufacturer(); String processorSerialNumber = computerSystem.getSerialNumber(); String processorIdentifier = centralProcessor.getIdentifier(); int processors = centralProcessor.getLogicalProcessorCount(); String delimiter = "-"; return String.format("%08x", vendor.hashCode()) + delimiter + String.format("%08x", processorSerialNumber.hashCode()) + delimiter + String.format("%08x", processorIdentifier.hashCode()) + delimiter + processors; }  }
ComputerIdentifierUtil { public static String getComputerIdentifier() { SystemInfo systemInfo = new SystemInfo(); OperatingSystem operatingSystem = systemInfo.getOperatingSystem(); HardwareAbstractionLayer hardwareAbstractionLayer = systemInfo.getHardware(); CentralProcessor centralProcessor = hardwareAbstractionLayer.getProcessor(); ComputerSystem computerSystem = hardwareAbstractionLayer.getComputerSystem(); String vendor = operatingSystem.getManufacturer(); String processorSerialNumber = computerSystem.getSerialNumber(); String processorIdentifier = centralProcessor.getIdentifier(); int processors = centralProcessor.getLogicalProcessorCount(); String delimiter = "-"; return String.format("%08x", vendor.hashCode()) + delimiter + String.format("%08x", processorSerialNumber.hashCode()) + delimiter + String.format("%08x", processorIdentifier.hashCode()) + delimiter + processors; }  static String getComputerIdentifier(); }
ComputerIdentifierUtil { public static String getComputerIdentifier() { SystemInfo systemInfo = new SystemInfo(); OperatingSystem operatingSystem = systemInfo.getOperatingSystem(); HardwareAbstractionLayer hardwareAbstractionLayer = systemInfo.getHardware(); CentralProcessor centralProcessor = hardwareAbstractionLayer.getProcessor(); ComputerSystem computerSystem = hardwareAbstractionLayer.getComputerSystem(); String vendor = operatingSystem.getManufacturer(); String processorSerialNumber = computerSystem.getSerialNumber(); String processorIdentifier = centralProcessor.getIdentifier(); int processors = centralProcessor.getLogicalProcessorCount(); String delimiter = "-"; return String.format("%08x", vendor.hashCode()) + delimiter + String.format("%08x", processorSerialNumber.hashCode()) + delimiter + String.format("%08x", processorIdentifier.hashCode()) + delimiter + processors; }  static String getComputerIdentifier();  }