All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.stork.api.ServiceRegistrar Maven / Gradle / Ivy

Go to download

Main Stork API classes. You are likely to need `smallrye-stork-core` and not this module.

The newest version!
package io.smallrye.stork.api;

import io.smallrye.mutiny.Uni;

public interface ServiceRegistrar & MetadataKey> {

    default Uni registerServiceInstance(String serviceName, String ipAddress, int defaultPort) {
        checkAddressNotNull(ipAddress);
        return registerServiceInstance(serviceName, Metadata.empty(), ipAddress, defaultPort);
    }

    default void checkAddressNotNull(String ipAddress) {
        if (ipAddress == null || ipAddress.isEmpty() || ipAddress.isBlank()) {
            throw new IllegalArgumentException("Parameter ipAddress should be provided.");
        }
    }

    Uni registerServiceInstance(String serviceName, Metadata metadata, String ipAddress,
            int defaultPort);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy