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

io.scalecube.services.transport.api.ClientTransport Maven / Gradle / Ivy

package io.scalecube.services.transport.api;

import io.scalecube.services.ServiceReference;
import reactor.core.publisher.Mono;

public interface ClientTransport extends AutoCloseable {

  /**
   * Creates {@link ClientChannel} for communication with remote service endpoint.
   *
   * @param serviceReference target serviceReference
   * @return {@link ClientChannel} instance
   */
  ClientChannel create(ServiceReference serviceReference);

  /**
   * Supplier of credentials for authentication on the {@link ServerTransport}. Being used in the
   * connection setup phase with remote {@link ServerTransport}.
   */
  @FunctionalInterface
  interface CredentialsSupplier {

    /**
     * Obtains credentials for the given {@code serviceReference}.
     *
     * @param serviceReference target serviceReference
     * @param serviceRole target serviceRole
     * @return result
     */
    Mono credentials(ServiceReference serviceReference, String serviceRole);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy