Package com.qfs.messenger
Interface IClusterView
-
- All Known Implementing Classes:
ClusterView,EmptyClusterView,JGroupsClusterView,LocalClusterView
public interface IClusterViewAn object that stores the state of a cluster (cluster members, associated viewId).- Author:
- ActiveViam
-
-
Field Summary
Fields Modifier and Type Field Description static IClusterViewINITIAL_VIEWAIClusterViewrepresenting the initial state of the cluster i.e has no member andgetViewId()returnsINITIAL_VIEW_ID.static longINITIAL_VIEW_IDThe initialized value of the view id.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IAddressgetAddressFromName(String name)Returns theIAddressof the member or null if not in the view.StringgetClusterId()Returns the id of the cluster the view belongs to.Set<IAddress>getClusterMemberAddresses()Returns The set of cluster's members'IAddress.Set<String>getClusterMembers()Returns set of cluster's members' names.longgetViewId()Returns the view id.
-
-
-
Field Detail
-
INITIAL_VIEW_ID
static final long INITIAL_VIEW_ID
The initialized value of the view id.- See Also:
- Constant Field Values
-
INITIAL_VIEW
static final IClusterView INITIAL_VIEW
AIClusterViewrepresenting the initial state of the cluster i.e has no member andgetViewId()returnsINITIAL_VIEW_ID.
-
-
Method Detail
-
getViewId
long getViewId()
Returns the view id.It uniquely defines a view as it's updated on every change (a member join or leave) in the cluster. If the member on which this method is called is not connected to the cluster,
INITIAL_VIEW_IDis returned, otherwise a positive value is returned.
-
getClusterMembers
Set<String> getClusterMembers()
Returns set of cluster's members' names. Cannot be null but empty..
-
getClusterMemberAddresses
Set<IAddress> getClusterMemberAddresses()
Returns The set of cluster's members'IAddress.Cannot be null but empty.
-
getAddressFromName
IAddress getAddressFromName(String name)
Returns theIAddressof the member or null if not in the view.- Parameters:
name- cluster's member's name
-
getClusterId
String getClusterId()
Returns the id of the cluster the view belongs to.May return
nullif a messenger is not connected yet.
-
-