+ if (nic != null)
+ return hardwareAddressToNodeId(nic);
+ Enumeration<NetworkInterface> netInterfaces = null;
+ try {
+ netInterfaces = NetworkInterface.getNetworkInterfaces();
+ } catch (SocketException e) {
+ throw new IllegalStateException(e);
+ }
+ if (netInterfaces == null || !netInterfaces.hasMoreElements())
+ throw new IllegalStateException("No interfaces");
+ return hardwareAddressToNodeId(netInterfaces.nextElement());