Class RegisteredServiceEndpoint

java.lang.Object
com.hedera.hashgraph.sdk.RegisteredServiceEndpoint
Direct Known Subclasses:
RegisteredServiceEndpointBase

public abstract class RegisteredServiceEndpoint extends Object
Abstract class representing the service endpoint published by a registered node.
  • Field Details

    • ipAddress

      @Nullable protected byte[] ipAddress
    • domainName

      @Nullable protected String domainName
    • port

      protected int port
    • requiresTls

      protected boolean requiresTls
  • Constructor Details

    • RegisteredServiceEndpoint

      RegisteredServiceEndpoint()
  • Method Details

    • getIpAddress

      @Nullable public byte[] getIpAddress()
      Get the IP address of the endpoint.
      Returns:
      the IP address, or null if using a domain name
    • getDomainName

      @Nullable public String getDomainName()
      Get the domain name of the endpoint.
      Returns:
      the domain name, or null if using an IP address
    • getPort

      public int getPort()
      Get the port used by this endpoint.
      Returns:
      the port number
    • isRequiresTls

      public boolean isRequiresTls()
      Check whether TLS is required for this endpoint.
      Returns:
      true if TLS is required
    • validateNoIpAndDomain

      public static void validateNoIpAndDomain(RegisteredServiceEndpoint serviceEndpoint)
      Validate that the endpoint does not contain both an IP address and a domain name.
      Parameters:
      serviceEndpoint - the endpoint to validate
      Throws:
      IllegalArgumentException - if both ipAddressV4 and domainName are present
    • fromProtobuf

      static RegisteredServiceEndpoint fromProtobuf(RegisteredServiceEndpoint serviceEndpoint)
    • fromJson

      static RegisteredServiceEndpoint fromJson(com.google.gson.JsonObject json)
      Parse RegisteredServiceEndpoint from MirrorNode json response `service_endpoint`
      Parameters:
      json - representing a single service endpoint entry from the Mirror Node REST API.
      Returns:
      this
    • toProtobuf

      abstract RegisteredServiceEndpoint toProtobuf()
      Build the protobuf.
      Returns:
      the protobuf representation
    • toStringHelper

      com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
      Serializes the class to ToStringHelper
      Returns:
      the MoreObjects.ToStringHelper