Interface LeaderElectionDriver
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ZooKeeperLeaderElectionDriver
public interface LeaderElectionDriver extends AutoCloseable
A leader election driver that allows to writeLeaderInformation
for multiple components.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
LeaderElectionDriver.Listener
Listener interface for state changes of theLeaderElectionDriver
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteLeaderInformation(String componentId)
Deletes the leader information for the given component.boolean
hasLeadership()
Returns whether the driver has currently leadership.void
publishLeaderInformation(String componentId, LeaderInformation leaderInformation)
Publishes the leader information for the given component.-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Method Detail
-
hasLeadership
boolean hasLeadership()
Returns whether the driver has currently leadership.- Returns:
true
if the driver has leadership, otherwisefalse
-
publishLeaderInformation
void publishLeaderInformation(String componentId, LeaderInformation leaderInformation)
Publishes the leader information for the given component.- Parameters:
componentId
- identifying the component for which to publish the leader informationleaderInformation
- leader information of the respective component
-
deleteLeaderInformation
void deleteLeaderInformation(String componentId)
Deletes the leader information for the given component.- Parameters:
componentId
- identifying the component for which to delete the leader information
-
-