import org.argeo.api.uuid.UuidBinaryUtils;
public class CmsUuidFactory extends ConcurrentUuidFactory {
import org.argeo.api.uuid.UuidBinaryUtils;
public class CmsUuidFactory extends ConcurrentUuidFactory {
- if (selectedIp == null)
- throw new IllegalStateException("No IP address found");
+ if (selectedIp == null) {
+ log.warn("No IP address found, using a random node id for UUID generation");
+ return NodeIdSupplier.randomNodeId();
+ }
byte[] digest = sha1(selectedIp.getAddress());
log.info("Use IP " + selectedIp + " hashed as " + UuidBinaryUtils.toHexString(digest) + " as node id");
byte[] nodeId = toNodeIdBytes(digest, 0);
byte[] digest = sha1(selectedIp.getAddress());
log.info("Use IP " + selectedIp + " hashed as " + UuidBinaryUtils.toHexString(digest) + " as node id");
byte[] nodeId = toNodeIdBytes(digest, 0);