com.sun.enterprise.mgmt
Class ClusterView

java.lang.Object
  extended by com.sun.enterprise.mgmt.ClusterView

public class ClusterView
extends Object

ClusterView is a snapshot of the current membership of the group. The ClusterView is created anew each time a membership change occurs in the group. ClusterView is managed by ClusterViewManager.


Field Summary
 long masterViewId
           
 
Method Summary
 void add(SystemAdvertisement adv)
          Adds a system advertisement to the view.
 void clear()
          Removes all of the elements from this set (optional operation).
 boolean containsKey(PeerID id)
           
 SystemAdvertisement get(PeerID id)
          Retrieves a system advertisement from a the table.
 long getClusterViewId()
          Returns the cluster view ID
 SystemAdvertisement getMasterCandidate()
          Returns the top node on the list
 List<String> getPeerNamesInView()
          Returns the list of peer names in the peer id sorted order from the cluster view
 int getSize()
          Gets the viewSize attribute of the ClusterView object
 List<SystemAdvertisement> getView()
          Returns a sorted list containing the System Advertisements of peers in PeerId sorted order
 boolean isFirst(SystemAdvertisement advertisement)
          Determines whether this node is at the top of the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

masterViewId

public final long masterViewId
Method Detail

get

public SystemAdvertisement get(PeerID id)
Retrieves a system advertisement from a the table.

Parameters:
id - instance id
Returns:
Returns the SystemAdvertisement associated with id

add

public void add(SystemAdvertisement adv)
Adds a system advertisement to the view.

Parameters:
adv - adds a system advertisement to the view

containsKey

public boolean containsKey(PeerID id)

getView

public List<SystemAdvertisement> getView()
Returns a sorted list containing the System Advertisements of peers in PeerId sorted order

Returns:
List - list of system advertisements

getPeerNamesInView

public List<String> getPeerNamesInView()
Returns the list of peer names in the peer id sorted order from the cluster view

Returns:
List

getSize

public int getSize()
Gets the viewSize attribute of the ClusterView object

Returns:
The viewSize

getMasterCandidate

public SystemAdvertisement getMasterCandidate()
Returns the top node on the list

Returns:
the top node on the list

isFirst

public boolean isFirst(SystemAdvertisement advertisement)
Determines whether this node is at the top of the list

Parameters:
advertisement - the advertisement to test
Returns:
true if this node is a the top of the list, false otherwise

getClusterViewId

public long getClusterViewId()
Returns the cluster view ID

Returns:
the view id

clear

public void clear()
Removes all of the elements from this set (optional operation).



Copyright © 2012. All Rights Reserved.