|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--spread.MembershipInfo
A MembershipInfo object represents information stored in a membership message.
To check if a message is a membership message, use SpreadMessage.isMembership()
:
if(message.isMembership() == true) System.out.println("Membership message.");
To get the MembershipInfo object from a membership message, use SpreadMessage.getMembershipInfo()
:
MembershipInfo membershipInfo = message.getMembershipInfo();
A MembershipInfo object can be used to get information on what caused the membership change (the is*() methods) and extra information about the change (the get*() methods). Which get*() methods are valid for a particular membership message depends on what caused the message.
Method Summary | |
SpreadGroup |
getDisconnected()
Gets the private group of the member who disconnected. |
SpreadGroup |
getGroup()
Gets a SpreadGroup object representing the group that caused this message. |
GroupID |
getGroupID()
Gets the GroupID for this group membership at this point in time. |
SpreadGroup |
getJoined()
Gets the private group of the member who joined. |
SpreadGroup |
getLeft()
Gets the private group of the member who left. |
SpreadGroup[] |
getMembers()
Gets the private groups for all the members in the new group membership. |
SpreadGroup[] |
getStayed()
Gets the private groups of the members who were not partitioned. |
boolean |
isCausedByDisconnect()
Check if this message was caused by a disconnect. |
boolean |
isCausedByJoin()
Check if this message was caused by a join. |
boolean |
isCausedByLeave()
Check if this message was caused by a leave. |
boolean |
isCausedByNetwork()
Check if this message was caused by a network partition. |
boolean |
isRegularMembership()
Check if this is a regular membership message. |
boolean |
isSelfLeave()
Check if this is a self-leave message. |
boolean |
isTransition()
Check if this is a transition message. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public boolean isRegularMembership()
getGroup()
, getGroupID()
,
and getMembers()
are valid.
One of getJoined()
, getLeft()
,
getDisconnected()
, or getStayed()
are valid
depending on the type of message.getGroup()
,
getGroupID()
,
getMembers()
,
getJoined()
,
getLeft()
,
getDisconnected()
,
getStayed()
public boolean isTransition()
getGroup()
is the only valid get*() function.getGroup()
public boolean isCausedByJoin()
getJoined()
can be used to get the group member who joined.getJoined()
public boolean isCausedByLeave()
getLeft()
can be used to get the group member who left.getLeft()
public boolean isCausedByDisconnect()
getDisconnected()
can be used to get the group member who left.getDisconnected()
public boolean isCausedByNetwork()
getStayed()
can be used to get the members who are still in the group.getStayed()
public boolean isSelfLeave()
getGroup()
is the only valid get*() function.getGroup()
public SpreadGroup getGroup()
public GroupID getGroupID()
isRegularMembership()
is true.
If it is not true, null is returned.public SpreadGroup[] getMembers()
isRegularMembership()
is true.
If it is not true, null is returned.public SpreadGroup getJoined()
isRegularMembership()
and
isCausedByJoin()
are true.
If either or both are false, null is returned.isCausedByJoin()
public SpreadGroup getLeft()
isRegularMembership()
and
isCausedByLeave()
are true.
If either or both are false, null is returned.isCausedByLeave()
public SpreadGroup getDisconnected()
isRegularMembership()
and
isCausedByDisconnect()
are true.
If either or both are false, null is returned.isCausedByDisconnect()
public SpreadGroup[] getStayed()
isRegularMembership()
and
isCausedByNetwork()
are true.
If either or both are false, null is returned.isCausedByNetwork()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |