Interface LeaderElectionDriver.Listener
-
- All Known Implementing Classes:
DefaultLeaderElectionService
- Enclosing interface:
- LeaderElectionDriver
public 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
onError(Throwable t)
Notifies the listener if an error occurred.void
onGrantLeadership(UUID leaderSessionID)
Callback that is called once the driver obtains the leadership.void
onLeaderInformationChange(String componentId, LeaderInformation leaderInformation)
Notifies the listener about a changed leader information for the given component.void
onLeaderInformationChange(LeaderInformationRegister leaderInformationRegister)
Notifies the listener about all currently known leader information.void
onRevokeLeadership()
Callback that is called once the driver loses the leadership.
-
-
-
Method Detail
-
onGrantLeadership
void onGrantLeadership(UUID leaderSessionID)
Callback that is called once the driver obtains the leadership.
-
onRevokeLeadership
void onRevokeLeadership()
Callback that is called once the driver loses the leadership.
-
onLeaderInformationChange
void onLeaderInformationChange(String componentId, LeaderInformation leaderInformation)
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
void onLeaderInformationChange(LeaderInformationRegister leaderInformationRegister)
Notifies the listener about all currently known leader information.
-
onError
void onError(Throwable t)
Notifies the listener if an error occurred.
-
-