Interface LeaderElectionDriver.Listener
- All Known Implementing Classes:
DefaultLeaderElectionService
- Enclosing interface:
- LeaderElectionDriver
public static interface LeaderElectionDriver.Listener
Listener interface for state changes of the
LeaderElectionDriver.-
Method Summary
Modifier and TypeMethodDescriptionvoidNotifies the listener if an error occurred.voidonGrantLeadership(UUID leaderSessionID) Callback that is called once the driver obtains the leadership.voidonLeaderInformationChange(String componentId, LeaderInformation leaderInformation) Notifies the listener about a changed leader information for the given component.voidonLeaderInformationChange(LeaderInformationRegister leaderInformationRegister) Notifies the listener about all currently known leader information.voidCallback that is called once the driver loses the leadership.
-
Method Details
-
onGrantLeadership
Callback that is called once the driver obtains the leadership. -
onRevokeLeadership
void onRevokeLeadership()Callback that is called once the driver loses the leadership. -
onLeaderInformationChange
Notifies the listener about a changed leader information for the given component.- Parameters:
componentId- identifying the component whose leader information has changedleaderInformation- new leader information
-
onLeaderInformationChange
Notifies the listener about all currently known leader information. -
onError
Notifies the listener if an error occurred.
-