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

io.scalecube.services.ServiceEndpoint Maven / Gradle / Ivy

package io.scalecube.services;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

public class ServiceEndpoint {

  private String id;
  private String host;
  private int port;
  private Set contentTypes;
  private Map tags;
  private Collection serviceRegistrations;

  /**
   * Constructor for SerDe.
   *
   * @deprecated exposed only for de/serialization purpose.
   */
  public ServiceEndpoint() {}

  /**
   * Create a service endpoint.
   *
   * @param id the endpoint's id.
   * @param host the endpoint's host.
   * @param port the endpoint's port.
   * @param tags the endpoint's tags (if any).
   * @param serviceRegistrations registration for this endpoint.
   */
  public ServiceEndpoint(
      String id,
      String host,
      int port,
      Set contentTypes,
      Map tags,
      Collection serviceRegistrations) {
    this.id = id;
    this.host = host;
    this.port = port;
    this.contentTypes = contentTypes;
    this.tags = tags;
    this.serviceRegistrations = serviceRegistrations;
  }

  public String id() {
    return id;
  }

  public String host() {
    return host;
  }

  public int port() {
    return port;
  }

  public Set contentTypes() {
    return contentTypes;
  }

  public Map tags() {
    return tags;
  }

  public Collection serviceRegistrations() {
    return serviceRegistrations;
  }

  @Override
  public String toString() {
    return "ServiceEndpoint{"
        + "id='"
        + id
        + '\''
        + ", host='"
        + host
        + '\''
        + ", port="
        + port
        + ", tags="
        + tags
        + ", serviceRegistrations="
        + serviceRegistrations
        + '}';
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy