private static ZooKeeperRegistrationSpec curatorSpec(
            ServiceInstance<?> serviceInstance, Server server) {
        final CuratorRegistrationSpecBuilder builder =
                ZooKeeperRegistrationSpec.builderForCurator(serviceInstance.getName());
        builder.serviceId(serviceInstance.getId());
        final String address;
        if (serviceInstance.getAddress() != null) {
            address = serviceInstance.getAddress();
        } else {
            address = defaultAddress(server);
        }
        builder.serviceAddress(address);
        final int port = port(server, SessionProtocol.HTTP, serviceInstance.getPort());
        if (port > 0) {
            builder.port(port);
        }
        final int sslPort = port(server, SessionProtocol.HTTPS, serviceInstance.getSslPort());
        if (sslPort > 0) {
            builder.sslPort(sslPort);
        }
        builder.serviceType(serviceInstance.getServiceType());
        final Object payload = serviceInstance.getPayload();
        if (payload != null) {
            builder.payload(payload);
        }
        return builder.build();
    }
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