More defensive RPC handling in DOM Broker
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / sal / core / api / RpcProvisionRegistry.java
1 package org.opendaylight.controller.sal.core.api;
2
3 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
4 import org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration;
5 import org.opendaylight.controller.sal.core.api.Broker.RpcRegistration;
6 import org.opendaylight.yangtools.concepts.ListenerRegistration;
7 import org.opendaylight.yangtools.yang.common.QName;
8 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
9
10 public interface RpcProvisionRegistry extends BrokerService, RouteChangePublisher<RpcRoutingContext, InstanceIdentifier> {
11
12     /**
13      * Registers an implementation of the rpc.
14      * 
15      * <p>
16      * The registered rpc functionality will be available to all other
17      * consumers and providers registered to the broker, which are aware of
18      * the {@link QName} assigned to the rpc.
19      * 
20      * <p>
21      * There is no assumption that rpc type is in the set returned by
22      * invoking {@link RpcImplementation#getSupportedRpcs()}. This allows
23      * for dynamic rpc implementations.
24      * 
25      * @param rpcType
26      *            Name of Rpc
27      * @param implementation
28      *            Provider's Implementation of the RPC functionality
29      * @throws IllegalArgumentException
30      *             If the name of RPC is invalid
31      */
32     RpcRegistration addRpcImplementation(QName rpcType, RpcImplementation implementation)
33             throws IllegalArgumentException;
34     
35     ListenerRegistration<RpcRegistrationListener> addRpcRegistrationListener(RpcRegistrationListener listener);
36
37     RoutedRpcRegistration addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation);
38 }