Interface LeaderElectionDriver
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
ZooKeeperLeaderElectionDriver
public interface LeaderElectionDriver extends AutoCloseable
A leader election driver that allows to writeLeaderInformationfor multiple components.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceLeaderElectionDriver.ListenerListener interface for state changes of theLeaderElectionDriver.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteLeaderInformation(String componentId)Deletes the leader information for the given component.booleanhasLeadership()Returns 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 Detail
-
hasLeadership
boolean hasLeadership()
Returns whether the driver has currently leadership.- Returns:
trueif 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
-
-