Record Class MemberAdvertisement

java.lang.Object
java.lang.Record
io.axoniq.framework.springcloud.discovery.MemberAdvertisement
Record Components:
nodeId - the identifier of the answering application, unique to its process
capabilities - the messages the answering application handles, and the command load it asks for

public record MemberAdvertisement(String nodeId, MemberCapabilities capabilities) extends Record
What a member of the cluster reports about itself when asked: who it is, and what it handles.

The nodeId is what identifies a member, rather than anything discovery reports about it. One running application may be reported more than once, for example under two service ids or at two addresses, and is still one member as long as every report leads to the same nodeId. The same goes for this application's own instance: it is recognized among the discovered instances by answering with this application's own nodeId.

Since:
5.4.0
Author:
Allard Buijze
  • Constructor Details

    • MemberAdvertisement

      public MemberAdvertisement(String nodeId, MemberCapabilities capabilities)
      Compact constructor validating that both the nodeId and the capabilities are present.
      Parameters:
      nodeId - the identifier of the answering application, unique to its process
      capabilities - the messages the answering application handles, and the command load it asks for
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • nodeId

      public String nodeId()
      Returns the value of the nodeId record component.
      Returns:
      the value of the nodeId record component
    • capabilities

      public MemberCapabilities capabilities()
      Returns the value of the capabilities record component.
      Returns:
      the value of the capabilities record component