import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.transport.address.TransportAddressBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.OdlLispSbService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapNotify;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapNotifyInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapRequest;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapRequestInputBuilder;
import org.opendaylight.yangtools.concepts.Registration;
import org.osgi.service.component.annotations.Activate;
private ThreadLocal<Pair<MapRequest, TransportAddress>> tlsMapRequest = new ThreadLocal<>();
private IMapResolverAsync mapResolver;
private MapServer mapServer;
- private OdlLispSbService lispSB;
+ private SendMapRequest sendMapRequest;
+ private SendMapReply sendMapReply;
+ private SendMapNotify sendMapNotify;
private final IMappingService mapService;
private final ClusterSingletonServiceProvider clusterSingletonService;
@Reference final ClusterSingletonServiceProvider clusterSingletonService,
@Reference final RpcConsumerRegistry rpcService, @Reference final NotificationService notificationService) {
this.mapService = mappingService;
- this.lispSB = rpcService.getRpcService(OdlLispSbService.class);
+ sendMapRequest = rpcService.getRpc(SendMapRequest.class);
+ sendMapReply = rpcService.getRpc(SendMapReply.class);
+ sendMapNotify = rpcService.getRpc(SendMapNotify.class);
this.clusterSingletonService = clusterSingletonService;
this.notificationService = notificationService;
new CompositeListener.Component<>(XtrRequestMapping.class, this::onXtrRequestMapping),
new CompositeListener.Component<>(XtrReplyMapping.class, this::onXtrReplyMapping),
new CompositeListener.Component<>(MappingKeepAlive.class, this::onMappingKeepAlive))));
-
mapResolver = new MapResolver(mapService, smr, elpPolicy, this);
mapServer = new MapServer(mapService, smr, this, notificationService);
cssRegistration = clusterSingletonService.registerClusterSingletonService(this);
SendMapRequestInputBuilder smrib = new SendMapRequestInputBuilder();
smrib.setMapRequest(new MapRequestBuilder(tlsMapRequest.get().getLeft()).build());
smrib.setTransportAddress(tlsMapRequest.get().getRight());
- getLispSB().sendMapRequest(smrib.build());
+ sendMapRequest.invoke(smrib.build());
return null;
} else {
return tlsMapReply.get();
SendMapNotifyInputBuilder smnib = new SendMapNotifyInputBuilder();
smnib.setMapNotify(new MapNotifyBuilder(mapNotify).build());
smnib.setTransportAddress(address);
- getLispSB().sendMapNotify(smnib.build());
+ sendMapNotify.invoke(smnib.build());
}
@VisibleForTesting
SendMapReplyInputBuilder smrib = new SendMapReplyInputBuilder();
smrib.setMapReply(new MapReplyBuilder(mapReply).build());
smrib.setTransportAddress(mapRequestNotification.getTransportAddress());
- getLispSB().sendMapReply(smrib.build());
+ sendMapReply.invoke(smrib.build());
} else {
LOG.debug("handleMapRequest: Got null MapReply");
}
}
}
- private OdlLispSbService getLispSB() {
- return lispSB;
- }
-
@Override
public void handleMapReply(MapReply reply) {
tlsMapReply.set(reply);
SendMapRequestInputBuilder smrib = new SendMapRequestInputBuilder();
smrib.setMapRequest(new MapRequestBuilder(smrMapRequest).build());
smrib.setTransportAddress(LispNotificationHelper.getTransportAddressFromRloc(subscriber));
- getLispSB().sendMapRequest(smrib.build());
-
+ sendMapRequest.invoke(smrib.build());
}
@Override