Merge "Refactor shutdown-impl: add parameter to RPC, remove secret validation and...
[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.yang.binding.InstanceIdentifier;
8 import org.opendaylight.yangtools.yang.binding.RpcService;
9
10 /**
11  * Interface defining provider's access to the Rpc Registry which could be used
12  * to register their implementations of service to the MD-SAL.
13  * 
14  * @author ttkacik
15  * 
16  */
17 public interface RpcProviderRegistry extends //
18         RpcConsumerRegistry, //
19         RouteChangePublisher<RpcContextIdentifier, InstanceIdentifier<?>> {
20     /**
21      * Registers an global RpcService implementation.
22      * 
23      * @param type
24      * @param implementation
25      * @return
26      */
27     <T extends RpcService> RpcRegistration<T> addRpcImplementation(Class<T> type, T implementation)
28             throws IllegalStateException;
29
30     /**
31      * 
32      * Register an Routed RpcService where routing is determined on annotated
33      * (in YANG model) context-reference and value of annotated leaf.
34      * 
35      * @param type
36      *            Type of RpcService, use generated interface class, not your
37      *            implementation clas
38      * @param implementation
39      *            Implementation of RpcService
40      * @return Registration object for routed Rpc which could be used to close
41      *         an
42      * 
43      * @throws IllegalStateException
44      */
45     <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation)
46             throws IllegalStateException;
47 }