gcs
Class GcsMembershipInfo

java.lang.Object
  extended by gcs.GcsMembershipInfo
Direct Known Subclasses:
SpreadGcsMembershipInfo

public abstract class GcsMembershipInfo
extends java.lang.Object

Used for conveying detailed information about changes of groups structures. GcsMembershipInfo object is a part of membership messages.

Author:
tkob

Nested Class Summary
 class GcsMembershipInfo.GcsVirtualSynchronySet
           
 
Constructor Summary
protected GcsMembershipInfo()
          Default constructor
 
Method Summary
abstract  GcsGroup getDisconnected()
          Returns the private group of the disconnected client if the message is caused by disconnection.
abstract  GcsGroup getGroup()
          Returns object representing the group which caused this message to be sent.
abstract  GcsGroupID getGroupID()
          Returns the GcsGroupID object representing the group which caused this message to be sent.
abstract  GcsGroup getJoined()
          Returns the private group of the client who joined the getGroup() group.
abstract  GcsGroup getLeft()
          Returns the private group of the client who left the getGroup() group.
abstract  GcsGroup[] getMembers()
          Returns an array of GcsGroup objects representing all private groups that are currently members of the getGroup() group.
abstract  GcsMembershipInfo.GcsVirtualSynchronySet getMyVirtualSynchronySet()
           
abstract  GcsGroup[] getStayed()
          Deprecated, provided for convenience.
abstract  GcsMembershipInfo.GcsVirtualSynchronySet[] getVirtualSynchronySets()
           
abstract  boolean isCausedByDisconnect()
          Returns true if a member of getGroup() group disconnected.
abstract  boolean isCausedByJoin()
          Returns true if there is a new member of getGroup() group.
abstract  boolean isCausedByLeave()
          Returns true if a member of getGroup() group left the group.
abstract  boolean isCausedByNetwork()
          Returns true if this message is caused by a network partition.
abstract  boolean isRegularMembership()
          Returns true if this message is a regular membership message.
abstract  boolean isSelfLeave()
          Returns true if this message is caused by leaving the getGroup() group.
abstract  boolean isTransition()
          Returns true if this is a transition message.
abstract  org.jdom.Element toXml()
          Returns a XML representation of the GcsMembershipInfo message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GcsMembershipInfo

protected GcsMembershipInfo()
Default constructor

Method Detail

getDisconnected

public abstract GcsGroup getDisconnected()
Returns the private group of the disconnected client if the message is caused by disconnection.

Returns:
the private group of the disconnected client

getGroup

public abstract GcsGroup getGroup()
Returns object representing the group which caused this message to be sent.

Returns:
the object representing the group which caused this message to be sent

getGroupID

public abstract GcsGroupID getGroupID()
Returns the GcsGroupID object representing the group which caused this message to be sent. It applies to a moment in time when the group membership view changed.

Returns:
if the isRegularMembership() is true GcsGroupID associated with group which caused this message to be sent, false otherwise

getJoined

public abstract GcsGroup getJoined()
Returns the private group of the client who joined the getGroup() group.

Returns:
the private group of the client who joined the getGroup() group if both isRegularMembership() and isCausedByJoin() are true, null otherwise

getLeft

public abstract GcsGroup getLeft()
Returns the private group of the client who left the getGroup() group.

Returns:
the private group of the client who left the getGroup() group if both isRegularMembership() and isCausedByJoin() are true, null otherwise

getMembers

public abstract GcsGroup[] getMembers()
Returns an array of GcsGroup objects representing all private groups that are currently members of the getGroup() group.

Returns:
all private groups that are currently part of the getGroup() group if isRegularMembership() is true, null otherwise

getMyVirtualSynchronySet

public abstract GcsMembershipInfo.GcsVirtualSynchronySet getMyVirtualSynchronySet()

getStayed

public abstract GcsGroup[] getStayed()
Deprecated, provided for convenience. Returns an array of GcsGroups objects representing private groups of the members who were now partitioned.

Returns:
private groups of members who are now partitioned if isRegularMembership() and isCausedByNetwork() are true, null otherwise

getVirtualSynchronySets

public abstract GcsMembershipInfo.GcsVirtualSynchronySet[] getVirtualSynchronySets()

isCausedByDisconnect

public abstract boolean isCausedByDisconnect()
Returns true if a member of getGroup() group disconnected. His private group can be retrieved by calling getDisconnected().

Returns:
true if this message is caused by disconnection of a member of getGroup() group, false otherwise

isCausedByJoin

public abstract boolean isCausedByJoin()
Returns true if there is a new member of getGroup() group. His private group can be retrieved by calling getJoined().

Returns:
true if there is a new member of getGroup() group, false otherwise

isCausedByLeave

public abstract boolean isCausedByLeave()
Returns true if a member of getGroup() group left the group. His private group can be retrieved by calling getLeft().

Returns:
true if a member of getGroup() group left the group

isCausedByNetwork

public abstract boolean isCausedByNetwork()
Returns true if this message is caused by a network partition. List of members who are still in the group can be retrieved by calling getStayed().

Returns:
true if this message is caused by a network partition, false otherwise

isRegularMembership

public abstract boolean isRegularMembership()
Returns true if this message is a regular membership message.

Returns:
true if this message is a regular membership message, false otherwise

isSelfLeave

public abstract boolean isSelfLeave()
Returns true if this message is caused by leaving the getGroup() group.

Returns:
true if this message is caused by leaving the getGroup() group, false otherwise

isTransition

public abstract boolean isTransition()
Returns true if this is a transition message.

Returns:
true if this is a transition message, false otherwise

toXml

public abstract org.jdom.Element toXml()
Returns a XML representation of the GcsMembershipInfo message.

Returns:
a XML representation of the GcsMembershipInfo message