private static ZooKeeperRegistrationSpec legacySpec(ZooKeeperRegistrationSpec spec, Server server) {
        final Endpoint endpoint = ((LegacyZooKeeperRegistrationSpec) spec).endpoint();
        if (endpoint != null) {
            if (endpoint.hasPort()) {
                warnIfInactivePort(server, endpoint.port(), null);
                return spec;
            }
            final ServerPort serverPort = server.activePort();
            assert serverPort != null;
            return ZooKeeperRegistrationSpec.legacy(endpoint.withPort(serverPort.localAddress().getPort()));
        }

        return ZooKeeperRegistrationSpec.legacy(defaultEndpoint(server));
    }
Returns a {@link ZooKeeperUpdatingListenerBuilder} with a ZooKeeper connection string and a znode path.

@param zkConnectionStr the ZooKeeper connection string
@param znodePath the ZooKeeper node to register
@param spec the {@link ZooKeeperRegistrationSpec} to encode and register the {@link Server}
zookeeper3/src/main/java/com/linecorp/armeria/server/zookeeper/ZooKeeperUpdatingListener.java