Merge "Added test for MouontPoints and URI"
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / sal / binding / api / RpcProviderRegistry.java
1 package org.opendaylight.controller.sal.binding.api;
2
3 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
4 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
5 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
6 import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
7 import org.opendaylight.yangtools.concepts.ListenerRegistration;
8 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
9 import org.opendaylight.yangtools.yang.binding.RpcService;
10
11 /**
12  * Interface defining provider's access to the Rpc Registry which could be used
13  * to register their implementations of service to the MD-SAL.
14  * 
15  * @author ttkacik
16  * 
17  */
18 public interface RpcProviderRegistry extends //
19         RpcConsumerRegistry, //
20         RouteChangePublisher<RpcContextIdentifier, InstanceIdentifier<?>> {
21     /**
22      * Registers an global RpcService implementation.
23      * 
24      * @param type
25      * @param implementation
26      * @return
27      */
28     <T extends RpcService> RpcRegistration<T> addRpcImplementation(Class<T> type, T implementation)
29             throws IllegalStateException;
30
31     /**
32      * 
33      * Register an Routed RpcService where routing is determined on annotated
34      * (in YANG model) context-reference and value of annotated leaf.
35      * 
36      * @param type
37      *            Type of RpcService, use generated interface class, not your
38      *            implementation clas
39      * @param implementation
40      *            Implementation of RpcService
41      * @return Registration object for routed Rpc which could be used to close
42      *         an
43      * 
44      * @throws IllegalStateException
45      */
46     <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation)
47             throws IllegalStateException;
48 }