Package io.hekate.cluster.event
Interface ClusterEvent
-
- All Superinterfaces:
HekateSupport
- All Known Implementing Classes:
ClusterChangeEvent
,ClusterEventBase
,ClusterJoinEvent
,ClusterLeaveEvent
public interface ClusterEvent extends HekateSupport
Cluster event. This is the base interface for all events that can be fired by theClusterService
.- See Also:
ClusterEventListener
,ClusterService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClusterChangeEvent
asChange()
Casts this instance to theClusterChangeEvent
type or returnsnull
if this instance can't be cast to that type.ClusterJoinEvent
asJoin()
Casts this instance to theClusterJoinEvent
type or returnsnull
if this instance can't be cast to that type.ClusterLeaveEvent
asLeave()
Casts this instance to theClusterLeaveEvent
type or returnsnull
if this instance can't be cast to that type.void
attach(CompletableFuture<?> future)
Attaches an arbitrary asynchronous task to this event.CompletableFuture<?>
future()
Returns a future object that represents all theattached
futures of this event.ClusterTopology
topology()
Returns the cluster topology snapshot of this event.ClusterEventType
type()
Returns the event type.-
Methods inherited from interface io.hekate.core.HekateSupport
hekate
-
-
-
-
Method Detail
-
type
ClusterEventType type()
Returns the event type.- Returns:
- Event type.
-
asJoin
ClusterJoinEvent asJoin()
Casts this instance to theClusterJoinEvent
type or returnsnull
if this instance can't be cast to that type.- Returns:
- This instance as to
ClusterJoinEvent
ornull
if this instance can't be cast to that type.
-
asLeave
ClusterLeaveEvent asLeave()
Casts this instance to theClusterLeaveEvent
type or returnsnull
if this instance can't be cast to that type.- Returns:
- This instance as to
ClusterLeaveEvent
ornull
if this instance can't be cast to that type.
-
asChange
ClusterChangeEvent asChange()
Casts this instance to theClusterChangeEvent
type or returnsnull
if this instance can't be cast to that type.- Returns:
- This instance as to
ClusterChangeEvent
ornull
if this instance can't be cast to that type.
-
topology
ClusterTopology topology()
Returns the cluster topology snapshot of this event.- Returns:
- Cluster topology.
-
attach
void attach(CompletableFuture<?> future)
Attaches an arbitrary asynchronous task to this event.The specified future object represents an asynchronous task that should be logically attached to this event in such a way that this event should not be considered completed until the task future is completed.
- Parameters:
future
- Synchronization future.- See Also:
future()
-
future
CompletableFuture<?> future()
Returns a future object that represents all theattached
futures of this event.- Returns:
- Future object that represents all the
attached
futures of this event. - See Also:
attach(CompletableFuture)
-
-