- if (oldMapping != null
- && MappingRecordUtil.isNegativeMapping(oldMapping)
- && !oldMapping.getEid().equals(eid)) {
- if (subscriptionService) {
- // Here we save the subscribers of the OLD mapping before removing. We will add to this set the
- // subscribers of the NEW mapping below (since the EIDs are different, the result of
- // mappingChanged() will be true, and then send an SMR to all subscribers with the EID of the NEW
- // mapping only.
- Set<Subscriber> oldMappingSubscribers = mapService.getSubscribers(oldMapping.getEid());
- if (oldMappingSubscribers != null) {
- subscribers.addAll(oldMappingSubscribers);
- LoggingUtil.logSubscribers(LOG, oldMapping.getEid(), subscribers);
- }
- }
- mapService.removeMapping(MappingOrigin.Southbound, oldMapping.getEid());
- }
-
- if (subscriptionService) {
- MappingRecord newMapping = merge
- ? getMappingRecord(mapService.getMapping(MappingOrigin.Southbound, eid)) : mapping;
-
- if (mappingChanged(oldMapping, newMapping)) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Mapping update occured for {} SMRs will be sent for its subscribers.",
- LispAddressStringifier.getString(eid));
- }
- Set<Subscriber> newMappingSubscribers = mapService.getSubscribers(eid);
- if (oldMapping != null && !oldMapping.getEid().equals(eid)) {
- newMappingSubscribers = addParentSubscribers(eid, newMappingSubscribers);
- }
- if (newMappingSubscribers != null) {
- subscribers.addAll(newMappingSubscribers);
- LoggingUtil.logSubscribers(LOG, eid, subscribers);
- }
- handleSmr(eid, subscribers);
+ if (merge) {
+ MappingRecord newMapping = getMappingRecord(mapService.getMapping(MappingOrigin.Southbound, eid));
+ if (MappingRecordUtil.mappingChanged(oldMapping, newMapping)) {
+ // If there is a SB mapping change with merge on, Map-Notify will be sent to ALL xTRs, not jus the
+ // one registering (merging is done in the MappingSystem code)