Interface LeaderElectionDriver
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ZooKeeperLeaderElectionDriver
A leader election driver that allows to write
LeaderInformation for multiple components.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceListener interface for state changes of theLeaderElectionDriver. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteLeaderInformation(String componentId) Deletes the leader information for the given component.booleanReturns whether the driver has currently leadership.voidpublishLeaderInformation(String componentId, LeaderInformation leaderInformation) Publishes the leader information for the given component.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
hasLeadership
boolean hasLeadership()Returns whether the driver has currently leadership.- Returns:
trueif the driver has leadership, otherwisefalse
-
publishLeaderInformation
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
Deletes the leader information for the given component.- Parameters:
componentId- identifying the component for which to delete the leader information
-