Updated SAL Binding APIs
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / sal / binding / spi / RpcRouter.java
1 package org.opendaylight.controller.sal.binding.spi;
2
3 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
4 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
5 import org.opendaylight.yangtools.yang.binding.RpcService;
6
7 /**
8  * RpcRouter is responsible for selecting RpcService based on provided routing
9  * context identifier {@link RpcRoutingTable#getContextIdentifier()} and path in
10  * overal data tree (@link {@link InstanceIdentifier}.
11  * 
12  * 
13  * @author Tony Tkacik <ttkacik@cisco.com>
14  * 
15  * @param <T>
16  *            Type of RpcService for which router provides routing information
17  *            and route selection.
18  */
19 public interface RpcRouter<T extends RpcService> {
20
21     /**
22      * Returns a type of RpcService which is served by this instance of router.
23      * 
24      * @return type of RpcService which is served by this instance of router.
25      */
26     Class<T> getRpcServiceType();
27
28     /**
29      * Returns a routing table for particular route context
30      * 
31      * @param routeContext
32      * @return Routing Table for particular route context.
33      */
34     <C extends BaseIdentity> RpcRoutingTable<C, T> getRoutingTable(Class<C> routeContext);
35
36     /**
37      * Returns an instance of RpcService which is responsible for processing
38      * particular path.
39      * 
40      * @param context
41      *            Rpc Routing Context
42      * @param path
43      *            Instance Identifier which is used as a selector of instance.
44      * @return instance of RpcService which is responsible for processing
45      *         particular path.
46      */
47     T getService(Class<? extends BaseIdentity> context, InstanceIdentifier path);
48
49     /**
50      * Returns a default fallback instance of RpcService which is responsible
51      * for handling all unknown imports.
52      * 
53      * @return default instance responsible for processing RPCs.
54      */
55     T getDefaultService();
56     
57     /**
58      * 
59      */
60     void setDefaultService();
61
62 }