groupmgmt.impl
Class SPGroupChangeMessage

java.lang.Object
  extended bygroupmgmt.impl.SPGroupChangeMessage
All Implemented Interfaces:
java.io.Serializable

class SPGroupChangeMessage
extends java.lang.Object
implements java.io.Serializable

The SPGroupChangeMessage class; Sent to everyone in the old group (for splits) or new group (for adds) by the leader to inform of a new group. Contains the new leader's Member object and a Vector containing all Members of the new group. When sent to a Member that will become the leader of a group, also contains the connections table for the new group.
Also contains the sender's Member object and timestamp to ensure that only the most recent GroupChanges get processed.

Version:
June 2003
Author:
Christine Julien, Tom Elgin
See Also:
SinglePhaseDisseminator, SPGroupInfoMessage

Field Summary
private  java.util.Hashtable connections
          The connections of the new group.
private  Member leader
          The leader of the new group.
private  java.util.Vector members
          The Members of the new group.
private  Member sender
          Used for comparison to other SPGroupChangeMessages The host that sent this message.
private  java.util.Date timestamp
          The date/time that this message was created on.
 
Constructor Summary
SPGroupChangeMessage(Member leader, java.util.Vector members, java.util.Hashtable connections, Member sender)
          Construct a new SPGroupChangeMessage with connection information.
SPGroupChangeMessage(Member leader, java.util.Vector members, Member sender)
          Construct a new SPGroupChangeMessage without connection info.
 
Method Summary
 java.util.Hashtable getConnections()
          Accessor to get the new connections table of the group.
 Member getLeader()
          Accessor to get the new leader of the group.
 java.util.Vector getMembers()
          Accessor to get the new members of the group.
 Member getSender()
          Accessor to get the sender of this message.
private  java.util.Date getTimestamp()
          Private accessor to get the time at which this message was constructed.
 boolean supercedes(SPGroupChangeMessage message)
          Check if this Message supercedes another message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leader

private Member leader
The leader of the new group.


members

private java.util.Vector members
The Members of the new group.


connections

private java.util.Hashtable connections
The connections of the new group.


timestamp

private java.util.Date timestamp
The date/time that this message was created on. Computers may not be synchronized, so this is only important relative to the times of messages created on the same computer.


sender

private Member sender
Used for comparison to other SPGroupChangeMessages The host that sent this message.

Constructor Detail

SPGroupChangeMessage

public SPGroupChangeMessage(Member leader,
                            java.util.Vector members,
                            java.util.Hashtable connections,
                            Member sender)
Construct a new SPGroupChangeMessage with connection information.

Parameters:
leader - The new leader of the group.
members - Vector containing the new Members of the group.
connections - The connections table of the group (only sent to the new leader)
sender - The leader that sent this message.

SPGroupChangeMessage

public SPGroupChangeMessage(Member leader,
                            java.util.Vector members,
                            Member sender)
Construct a new SPGroupChangeMessage without connection info.

Parameters:
leader - The new leader of the group.
members - Vector containing the new Members of the group.
sender - The leader that sent this message.
Method Detail

getLeader

public Member getLeader()
Accessor to get the new leader of the group.

Returns:
The new leader of the group.

getMembers

public java.util.Vector getMembers()
Accessor to get the new members of the group.

Returns:
Vector containing the new members of the group.

getConnections

public java.util.Hashtable getConnections()
Accessor to get the new connections table of the group.

Returns:
The new connections table of the group.

getTimestamp

private java.util.Date getTimestamp()
Private accessor to get the time at which this message was constructed. Used by supercedes().

Returns:
The timestamp of this message.

getSender

public Member getSender()
Accessor to get the sender of this message. Used by supercedes().

Returns:
The sender of this message.

supercedes

public boolean supercedes(SPGroupChangeMessage message)
Check if this Message supercedes another message.

Parameters:
message - The SPGroupChangeMessage to compare to.
Returns:
True if either this message came from a different host than message or this message is more recent. True if the message to compare to is null.