akka.cluster
Class Member

java.lang.Object
  extended by akka.cluster.Member
All Implemented Interfaces:
java.io.Serializable

public class Member
extends java.lang.Object
implements scala.Serializable

Represents the address, current status, and roles of a cluster member node.

Note: hashCode and equals are solely based on the underlying Address, not its MemberStatus and roles.

See Also:
Serialized Form

Constructor Summary
Member(UniqueAddress uniqueAddress, int upNumber, MemberStatus status, scala.collection.immutable.Set<java.lang.String> roles)
           
 
Method Summary
 Address address()
          INTERNAL API
static scala.math.Ordering<Address> addressOrdering()
          Address ordering type class, sorts addresses by host and port.
static Member apply(UniqueAddress uniqueAddress, scala.collection.immutable.Set<java.lang.String> roles)
          INTERNAL API Create a new member with status Joining.
 Member copy(MemberStatus status)
           
 Member copyUp(int upNumber)
           
 boolean equals(java.lang.Object other)
           
 java.util.Set<java.lang.String> getRoles()
          Java API
 int hashCode()
           
 boolean hasRole(java.lang.String role)
           
static Member highestPriorityOf(Member m1, Member m2)
          Picks the Member with the highest "priority" MemberStatus.
 boolean isOlderThan(Member other)
          Is this member older, has been part of cluster longer, than another member.
static scala.math.Ordering<Member> leaderStatusOrdering()
          INTERNAL API Orders the members by their address except that members with status Joining, Exiting and Down are ordered last (in that order).
static scala.collection.immutable.Set<Member> none()
           
static scala.math.Ordering<Member> ordering()
          Member ordering type class, sorts members by host and port.
static scala.collection.immutable.Set<Member> pickHighestPriority(scala.collection.immutable.Set<Member> a, scala.collection.immutable.Set<Member> b)
           
static Member removed(UniqueAddress node)
          INTERNAL API
 scala.collection.immutable.Set<java.lang.String> roles()
           
 MemberStatus status()
           
 java.lang.String toString()
           
 UniqueAddress uniqueAddress()
           
 int upNumber()
          INTERNAL API
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Member

public Member(UniqueAddress uniqueAddress,
              int upNumber,
              MemberStatus status,
              scala.collection.immutable.Set<java.lang.String> roles)
Method Detail

none

public static scala.collection.immutable.Set<Member> none()

apply

public static Member apply(UniqueAddress uniqueAddress,
                           scala.collection.immutable.Set<java.lang.String> roles)
INTERNAL API Create a new member with status Joining.

Parameters:
uniqueAddress - (undocumented)
roles - (undocumented)
Returns:
(undocumented)

removed

public static Member removed(UniqueAddress node)
INTERNAL API

Parameters:
node - (undocumented)
Returns:
(undocumented)

addressOrdering

public static scala.math.Ordering<Address> addressOrdering()
Address ordering type class, sorts addresses by host and port.

Returns:
(undocumented)

leaderStatusOrdering

public static scala.math.Ordering<Member> leaderStatusOrdering()
INTERNAL API Orders the members by their address except that members with status Joining, Exiting and Down are ordered last (in that order).

Returns:
(undocumented)

ordering

public static scala.math.Ordering<Member> ordering()
Member ordering type class, sorts members by host and port.

Returns:
(undocumented)

pickHighestPriority

public static scala.collection.immutable.Set<Member> pickHighestPriority(scala.collection.immutable.Set<Member> a,
                                                                         scala.collection.immutable.Set<Member> b)

highestPriorityOf

public static Member highestPriorityOf(Member m1,
                                       Member m2)
Picks the Member with the highest "priority" MemberStatus.

Parameters:
m1 - (undocumented)
m2 - (undocumented)
Returns:
(undocumented)

uniqueAddress

public UniqueAddress uniqueAddress()

upNumber

public int upNumber()
INTERNAL API


status

public MemberStatus status()

roles

public scala.collection.immutable.Set<java.lang.String> roles()

address

public Address address()
INTERNAL API


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasRole

public boolean hasRole(java.lang.String role)

getRoles

public java.util.Set<java.lang.String> getRoles()
Java API

Returns:
(undocumented)

isOlderThan

public boolean isOlderThan(Member other)
Is this member older, has been part of cluster longer, than another member. It is only correct when comparing two existing members in a cluster. A member that joined after removal of another member may be considered older than the removed member.

Parameters:
other - (undocumented)
Returns:
(undocumented)

copy

public Member copy(MemberStatus status)

copyUp

public Member copyUp(int upNumber)