Class SimpleMember<E>

java.lang.Object
org.axonframework.commandhandling.distributed.SimpleMember<E>
Type Parameters:
E - The type of the identifier of this entry in the set of nodes
All Implemented Interfaces:
Member

public class SimpleMember<E> extends Object implements Member
An endpoint in the network for a command handling service.
  • Field Details

    • LOCAL_MEMBER

      public static final Boolean LOCAL_MEMBER
      Denotes that a SimpleMember is a representation of a Local Member, thus a representation of the instance itself.
    • REMOTE_MEMBER

      public static final Boolean REMOTE_MEMBER
      Denotes that a SimpleMember is a representation of a Remote Member.
  • Constructor Details

    • SimpleMember

      public SimpleMember(String name, E endpoint, boolean local, Consumer<SimpleMember<E>> suspectHandler)
      Create the service member
      Parameters:
      name - the member name
      endpoint - The object describing the endpoint
      local - True if the member is local. False if the member is remote or if this information is unknown.
      suspectHandler - The operation to execute when this member is marked as a suspect
  • Method Details

    • name

      public String name()
      Description copied from interface: Member
      Returns the name of this Member.
      Specified by:
      name in interface Member
      Returns:
      the member name
    • getConnectionEndpoint

      public <T> Optional<T> getConnectionEndpoint(Class<T> protocol)
      Description copied from interface: Member
      Get the endpoint of this Member given a protocol. Returns an empty optional if the protocol is not a supported endpoint of this member.
      Specified by:
      getConnectionEndpoint in interface Member
      Type Parameters:
      T - the protocol type
      Parameters:
      protocol - the expected
      Returns:
      the endpoint if this member supports the protocol. An empty optional otherwise.
    • suspect

      public void suspect()
      Description copied from interface: Member
      Mark this member as suspect, i.e. suspected of being (temporarily) unavailable.
      Specified by:
      suspect in interface Member
    • endpoint

      public E endpoint()
      Returns this Member's endpoint.
      Returns:
      the endpoint of this member
    • local

      public boolean local()
      Specified by:
      local in interface Member
      Returns:
      True if the member is local. False if the member is remote or if this information is unknown.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object