Package com.sun.enterprise.mgmt
Class ClusterView
- java.lang.Object
-
- com.sun.enterprise.mgmt.ClusterView
-
public class ClusterView extends java.lang.ObjectClusterView 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
Fields Modifier and Type Field Description longmasterViewId
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SystemAdvertisement adv)Adds a system advertisement to the view.voidclear()Removes all of the elements from this set (optional operation).booleancontainsKey(PeerID id)SystemAdvertisementget(PeerID id)Retrieves a system advertisement from a the table.longgetClusterViewId()Returns the cluster view IDSystemAdvertisementgetMasterCandidate()Returns the top node on the listjava.util.List<java.lang.String>getPeerNamesInView()Returns the list of peer names in the peer id sorted order from the cluster viewintgetSize()Gets the viewSize attribute of the ClusterView objectjava.util.List<SystemAdvertisement>getView()Returns a sorted list containing the System Advertisements of peers in PeerId sorted orderbooleanisFirst(SystemAdvertisement advertisement)Determines whether this node is at the top of the list
-
-
-
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 java.util.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 java.util.List<java.lang.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).
-
-