Package com.qfs.messenger
Interface IClusterView
- All Known Implementing Classes:
ClusterView,EmptyClusterView,JGroupsClusterView,LocalClusterView
public interface IClusterView
An object that stores the state of a cluster (cluster members, associated viewId).
- Author:
- ActiveViam
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IClusterViewAIClusterViewrepresenting the initial state of the cluster i.e has no member andgetViewId()returnsINITIAL_VIEW_ID.static final longThe initialized value of the view id. -
Method Summary
Modifier and TypeMethodDescriptiongetAddressFromName(String name) Returns theIAddressof the member or null if not in the view.Returns the id of the cluster the view belongs to.Returns The set of cluster's members'IAddress.Returns set of cluster's members' names.longReturns the view id.
-
Field Details
-
INITIAL_VIEW_ID
static final long INITIAL_VIEW_IDThe initialized value of the view id.- See Also:
-
INITIAL_VIEW
AIClusterViewrepresenting the initial state of the cluster i.e has no member andgetViewId()returnsINITIAL_VIEW_ID.
-
-
Method Details
-
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
Returns set of cluster's members' names. Cannot be null but empty.. -
getClusterMemberAddresses
Returns The set of cluster's members'IAddress.Cannot be null but empty.
-
getAddressFromName
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.
-