接口 ServiceInstance

  • 所有超级接口:
    Serializable
    所有已知实现类:
    DefaultServiceInstance

    public interface ServiceInstance
    extends Serializable
    The model class of an instance of a service, which is used for service registration and discovery.

    从以下版本开始:
    2.7.5
    • 方法详细资料

      • getId

        String getId()
        The id of the registered service instance.
        返回:
        nullable
      • getServiceName

        String getServiceName()
        The name of service that current instance belongs to.
        返回:
        non-null
      • getHost

        String getHost()
        The hostname of the registered service instance.
        返回:
        non-null
      • getPort

        Integer getPort()
        The port of the registered service instance.
        返回:
        the positive integer if present
      • getAddress

        String getAddress()
      • isEnabled

        default boolean isEnabled()
        The enable status of the registered service instance.
        返回:
        if true, indicates current instance is enabled, or disable, the client should remove this one. The default value is true
      • isHealthy

        default boolean isHealthy()
        The registered service instance is health or not.
        返回:
        if true, indicates current instance is enabled, or disable, the client may ignore this one. The default value is true
      • getMetadata

        Map<String,​String> getMetadata()
        The key / value pair metadata associated with the service instance.
        返回:
        non-null, mutable and unsorted Map
      • getMetadata

        default String getMetadata​(String name)
        Get the value of metadata by the specified name
        参数:
        name - the specified name
        返回:
        the value of metadata if found, or null
        从以下版本开始:
        2.7.8
      • getMetadata

        default String getMetadata​(String name,
                                   String defaultValue)
        Get the value of metadata by the specified name
        参数:
        name - the specified name
        返回:
        the value of metadata if found, or defaultValue
        从以下版本开始:
        2.7.8
      • hashCode

        int hashCode()
        覆盖:
        hashCode 在类中 Object
        返回:
        the hash code of current instance.