restgroupsClient
Class RestGroupsMessageMembershipInfo

java.lang.Object
  extended by restgroupsClient.RestGroupsMessageMembershipInfo
All Implemented Interfaces:
java.lang.Cloneable

public class RestGroupsMessageMembershipInfo
extends java.lang.Object
implements java.lang.Cloneable

Wrapper of the membership info part of membership messages.

Author:
tkob

Constructor Summary
RestGroupsMessageMembershipInfo()
          Default constructor.
RestGroupsMessageMembershipInfo(org.jdom.Element element)
          Creates an instance from given XML 'membershipInfo' element.
 
Method Summary
 java.lang.Object clone()
           
 boolean fromXml(org.jdom.Element element)
          Extracts fields values from given 'membershipInfo' XML element.
 java.lang.String getDisconnected()
          Returns the private group of the disconnected client if the message is caused by disconnection.
 java.lang.String getGroup()
          Returns object representing the group which caused this message to be sent.
 java.lang.String getGroupID()
          Returns the GcsGroupID object representing the group which caused this message to be sent.
 java.lang.String getJoined()
          Returns the private group of the client who joined the getGroup() group.
 java.lang.String getLeft()
          Returns the private group of the client who left the getGroup() group.
 java.util.List<java.lang.String> getMembers()
          Returns an array of GcsGroup objects representing all private groups that are currently members of the getGroup() group.
 java.util.List<java.lang.String> getMyVirtualSynchronySet()
           
 java.util.List<java.lang.String> getStayed()
           
 java.util.List<java.util.List<java.lang.String>> getVirtualSynchronySets()
           
 boolean isCausedByDisconnect()
          Returns true if a member of getGroup() group disconnected.
 boolean isCausedByJoin()
          Returns true if there is a new member of getGroup() group.
 boolean isCausedByLeave()
          Returns true if a member of getGroup() group left the group.
 boolean isCausedByNetwork()
          Returns true if this message is caused by a network partition.
 boolean isRegularMembership()
          Returns true if this message is a regular membership message.
 boolean isSelfLeave()
          Returns true if this message is caused by leaving the getGroup() group.
 boolean isTransition()
          Returns true if this is a transition message.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestGroupsMessageMembershipInfo

public RestGroupsMessageMembershipInfo()
Default constructor.


RestGroupsMessageMembershipInfo

public RestGroupsMessageMembershipInfo(org.jdom.Element element)
Creates an instance from given XML 'membershipInfo' element.

Parameters:
element - 'membershipInfo' XML element
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

fromXml

public boolean fromXml(org.jdom.Element element)
Extracts fields values from given 'membershipInfo' XML element.

Parameters:
element - 'membershipInfo' XML element
Returns:
true on success, false otherwise

isCausedByDisconnect

public boolean isCausedByDisconnect()
Returns true if a member of getGroup() group disconnected.

Returns:
true if a member of getGroup() group disconnected, false otherwise

getDisconnected

public java.lang.String getDisconnected()
Returns the private group of the disconnected client if the message is caused by disconnection.

Returns:
returns the private group of the disconnected client

isCausedByJoin

public boolean isCausedByJoin()
Returns true if there is a new member of getGroup() group.

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

getJoined

public java.lang.String 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.

isCausedByLeave

public boolean isCausedByLeave()
Returns true if a member of getGroup() group left the group.

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

getLeft

public java.lang.String 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

isCausedByNetwork

public boolean isCausedByNetwork()
Returns true if this message is caused by a network partition.

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

isRegularMembership

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

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

isTransition

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

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

isSelfLeave

public 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

getGroup

public java.lang.String getGroup()
Returns object representing the group which caused this message to be sent.

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

getGroupID

public java.lang.String 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

getMembers

public java.util.List<java.lang.String> 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 java.util.List<java.lang.String> getMyVirtualSynchronySet()

getVirtualSynchronySets

public java.util.List<java.util.List<java.lang.String>> getVirtualSynchronySets()

getStayed

public java.util.List<java.lang.String> getStayed()