java.lang.Object
com.hedera.hashgraph.sdk.RegisteredServiceEndpoint
- Direct Known Subclasses:
RegisteredServiceEndpointBase
Abstract class representing the service endpoint published by a registered node.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected byte[]protected intprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static RegisteredServiceEndpointfromJson(com.google.gson.JsonObject json) Parse RegisteredServiceEndpoint from MirrorNode json response `service_endpoint`(package private) static RegisteredServiceEndpointfromProtobuf(RegisteredServiceEndpoint serviceEndpoint) Get the domain name of the endpoint.byte[]Get the IP address of the endpoint.intgetPort()Get the port used by this endpoint.booleanCheck whether TLS is required for this endpoint.(package private) abstract RegisteredServiceEndpointBuild the protobuf.(package private) com.google.common.base.MoreObjects.ToStringHelperSerializes the class to ToStringHelperstatic voidvalidateNoIpAndDomain(RegisteredServiceEndpoint serviceEndpoint) Validate that the endpoint does not contain both an IP address and a domain name.
-
Field Details
-
ipAddress
@Nullable protected byte[] ipAddress -
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
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
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
-
fromJson
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
Build the protobuf.- Returns:
- the protobuf representation
-
toStringHelper
com.google.common.base.MoreObjects.ToStringHelper toStringHelper()Serializes the class to ToStringHelper- Returns:
- the
MoreObjects.ToStringHelper
-