Package io.hekate.cluster.event
Class ClusterLeaveEvent
- java.lang.Object
-
- io.hekate.cluster.event.ClusterEventBase
-
- io.hekate.cluster.event.ClusterLeaveEvent
-
- All Implemented Interfaces:
ClusterEvent
,HekateSupport
public class ClusterLeaveEvent extends ClusterEventBase
Cluster leave event.This event is fired by the
ClusterService
every time when local node leaves the cluster. Reason of this event can be obtained via thereason()
method.For more details about the cluster events processing please see the documentation of
ClusterEventListener
interface.- See Also:
ClusterEventListener
-
-
Constructor Summary
Constructors Constructor Description ClusterLeaveEvent(ClusterLeaveReason reason, ClusterTopology topology, List<ClusterNode> added, List<ClusterNode> removed, HekateSupport hekate)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ClusterNode>
added()
Returns the list of new nodes that joined the cluster.ClusterLeaveEvent
asLeave()
Returns this instance.ClusterLeaveReason
reason()
Returns the reason of this event.List<ClusterNode>
removed()
Returns the list of nodes that left the cluster.String
toString()
ClusterEventType
type()
ReturnsClusterEventType.LEAVE
.
-
-
-
Constructor Detail
-
ClusterLeaveEvent
public ClusterLeaveEvent(ClusterLeaveReason reason, ClusterTopology topology, List<ClusterNode> added, List<ClusterNode> removed, HekateSupport hekate)
Constructs a new instance.- Parameters:
reason
- Reason of this event.topology
- Topology.added
- List of newly joined nodes (seeadded()
).removed
- List of nodes that left the cluster (seeremoved()
).hekate
- Delegate forClusterEventBase.hekate()
.
-
-
Method Detail
-
reason
public ClusterLeaveReason reason()
Returns the reason of this event.- Returns:
- Reason.
-
added
public List<ClusterNode> added()
Returns the list of new nodes that joined the cluster.- Returns:
- List of new nodes that joined the cluster.
-
removed
public List<ClusterNode> removed()
Returns the list of nodes that left the cluster.- Returns:
- List of nodes that left the cluster.
-
type
public ClusterEventType type()
ReturnsClusterEventType.LEAVE
.- Returns:
ClusterEventType.LEAVE
.
-
asLeave
public ClusterLeaveEvent asLeave()
Returns this instance.- Specified by:
asLeave
in interfaceClusterEvent
- Overrides:
asLeave
in classClusterEventBase
- Returns:
- This instance.
-
-