Fixed discard-changes for mdsal netconf, mapping code cleanup.
[controller.git] / opendaylight / md-sal / forwardingrules-manager / src / test / java / test / mock / util / RpcProviderRegistryMock.java
1 package test.mock.util;
2
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;
13
14 public class RpcProviderRegistryMock implements RpcProviderRegistry {
15     @Override
16     public <T extends RpcService> BindingAwareBroker.RpcRegistration<T> addRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
17         return null;
18     }
19
20     @Override
21     public <T extends RpcService> BindingAwareBroker.RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> serviceInterface, T implementation) throws IllegalStateException {
22         return null;
23     }
24
25     @Override
26     public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(L listener) {
27         return null;
28     }
29
30     @Override
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();
38         } else {
39             return null;
40         }
41     }
42 }