1 package test.mock.util;
3 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
4 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
5 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
6 import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
7 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
10 import org.opendaylight.yangtools.concepts.ListenerRegistration;
11 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12 import org.opendaylight.yangtools.yang.binding.RpcService;
14 public class RpcProviderRegistryMock implements RpcProviderRegistry {
16 public <T extends RpcService> BindingAwareBroker.RpcRegistration<T> addRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
21 public <T extends RpcService> BindingAwareBroker.RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
26 public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(L listener) {
31 public <T extends RpcService> T getRpcService(Class<T> serviceInterface) {
32 if (serviceInterface.equals(SalFlowService.class)) {
33 return (T) new SalFlowServiceMock();
34 } else if (serviceInterface.equals(SalGroupService.class)) {
35 return (T) new SalGroupServiceMock();
36 } else if (serviceInterface.equals(SalMeterService.class)) {
37 return (T) new SalMeterServiceMock();