Class EquivalentAddressGroup
SocketAddress
es that are considered equivalent when channel makes connections.
Usually the addresses are addresses resolved from the same host name, and connecting to any of them is equally sufficient. They do have order. An address appears earlier on the list is likely to be tried earlier.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Annotation forEquivalentAddressGroup
's attributes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Attributes.Key
<String> The authority to be used when constructing Subchannels for this EquivalentAddressGroup. -
Constructor Summary
ConstructorsConstructorDescriptionSingleton constructor without Attributes.EquivalentAddressGroup
(SocketAddress addr, Attributes attrs) Singleton constructor with Attributes.EquivalentAddressGroup
(List<SocketAddress> addrs) List constructor withoutAttributes
.EquivalentAddressGroup
(List<SocketAddress> addrs, Attributes attrs) List constructor withAttributes
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the given object is also anEquivalentAddressGroup
with an equal address list and equal attribute values.Returns an immutable list of the addresses.Returns the attributes.int
hashCode()
toString()
-
Field Details
-
ATTR_AUTHORITY_OVERRIDE
@Attr @ExperimentalApi("https://github.com/grpc/grpc-java/issues/6138") public static final Attributes.Key<String> ATTR_AUTHORITY_OVERRIDEThe authority to be used when constructing Subchannels for this EquivalentAddressGroup. However, if the channel has overridden authority viaManagedChannelBuilder.overrideAuthority(String)
, the transport will use the channel's authority override.The authority must be from a trusted source, because if the authority is tampered with, RPCs may be sent to attackers which may leak sensitive user data. If the authority was acquired by doing I/O, the communication must be authenticated (e.g., via TLS). Recognize that the server that provided the authority can trivially impersonate the service.
-
-
Constructor Details
-
EquivalentAddressGroup
List constructor withoutAttributes
. -
EquivalentAddressGroup
List constructor withAttributes
. -
EquivalentAddressGroup
Singleton constructor without Attributes. -
EquivalentAddressGroup
Singleton constructor with Attributes.
-
-
Method Details
-
getAddresses
Returns an immutable list of the addresses. -
getAttributes
Returns the attributes. -
toString
-
hashCode
public int hashCode() -
equals
Returns true if the given object is also anEquivalentAddressGroup
with an equal address list and equal attribute values.Note that if the attributes include mutable values, it is possible for two objects to be considered equal at one point in time and not equal at another (due to concurrent mutation of attribute values).
-