use of org.opendaylight.controller.cluster.example.messages.RegisterListener in project controller by opendaylight.
the class ExampleRoleChangeListener method handleReceive.
@Override
protected void handleReceive(Object message) throws Exception {
if (message instanceof RegisterListener) {
// called by the scheduler at intervals to register any unregistered notifiers
sendRegistrationRequests();
} else if (message instanceof RegisterRoleChangeListenerReply) {
// called by the Notifier
handleRegisterRoleChangeListenerReply(getSender().path().toString());
} else if (message instanceof RoleChangeNotification) {
// called by the Notifier
RoleChangeNotification notification = (RoleChangeNotification) message;
LOG.info("Role Change Notification received for member:{}, old role:{}, new role:{}", notification.getMemberId(), notification.getOldRole(), notification.getNewRole());
// the apps dependent on such notifications can be called here
// TODO: add implementation here
}
}
Aggregations