import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.lispflowmapping.clustering.ClusterNodeModulSwitcherImpl;
import org.opendaylight.lispflowmapping.implementation.config.ConfigIni;
import org.opendaylight.lispflowmapping.interfaces.dao.SubKeys;
import org.opendaylight.lispflowmapping.interfaces.dao.SubscriberRLOC;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingChanged;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingOrigin;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.OdlMappingserviceListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
protected static final Logger LOG = LoggerFactory.getLogger(MapServer.class);
private static final byte[] ALL_ZEROES_XTR_ID = new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0};
- private final ClusterNodeModulSwitcherImpl clusterNodeModulSwitcher;
private IMappingService mapService;
private boolean subscriptionService;
private IMapNotifyHandler notifyHandler;
private NotificationService notificationService;
- private ListenerRegistration<MapServer> mapServerListenerRegistration;
public MapServer(IMappingService mapService, boolean subscriptionService,
- IMapNotifyHandler notifyHandler, NotificationService notificationService,
- final ClusterNodeModulSwitcherImpl clusterNodeModulSwitcher) {
+ IMapNotifyHandler notifyHandler, NotificationService notificationService) {
Preconditions.checkNotNull(mapService);
this.mapService = mapService;
this.subscriptionService = subscriptionService;
this.notifyHandler = notifyHandler;
this.notificationService = notificationService;
if (notificationService != null) {
- mapServerListenerRegistration = notificationService.registerNotificationListener(this);
+ notificationService.registerNotificationListener(this);
}
- this.clusterNodeModulSwitcher = clusterNodeModulSwitcher;
}
@Override
@Override
public void onMappingChanged(MappingChanged notification) {
if (subscriptionService) {
- if (clusterNodeModulSwitcher.isMaster()) {
- sendSmrs(notification.getMappingRecord(), getSubscribers(notification.getMappingRecord().getEid()));
- }
+ sendSmrs(notification.getMappingRecord(), getSubscribers(notification.getMappingRecord().getEid()));
if (notification.getChangeType().equals(MappingChange.Removed)) {
removeSubscribers(notification.getMappingRecord().getEid());
}