Binding2 runtime - API #5
[mdsal.git] / binding2 / mdsal-binding2-api / src / main / java / org / opendaylight / mdsal / binding / javav2 / api / RpcActionConsumerRegistry.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.mdsal.binding.javav2.api;
10
11 import com.google.common.annotations.Beta;
12 import org.opendaylight.mdsal.binding.javav2.spec.base.Action;
13 import org.opendaylight.mdsal.binding.javav2.spec.base.ListAction;
14 import org.opendaylight.mdsal.binding.javav2.spec.base.Rpc;
15
16 /**
17  * Provides access to registered Remote Procedure Call (RPC) and Action service implementations.
18  * RPCs and Actions are defined in YANG models.
19  *
20  * <p>
21  * RPC/Action implementations are registered using the {@link RpcActionProviderService}.
22  */
23 @Beta
24 public interface RpcActionConsumerRegistry extends BindingService {
25
26     /**
27      * Returns an implementation of a requested RPC service.
28      *
29      * <p>
30      * The returned instance is not an actual implementation of the RPC service interface, but a
31      * proxy implementation of the interface that forwards to an actual implementation, if any.
32      *
33      * @param serviceInterface given service interface
34      * @param <T> interface type
35      * @return returns proxy for the requested RPC
36      */
37     <T extends Rpc> T getRpcService(Class<T> serviceInterface);
38
39     /**
40      * Returns an implementation of a requested Action service.
41      *
42      * <p>
43      * The returned instance is not an actual implementation of the Action service interface, but a
44      * proxy implementation of the interface that forwards to an actual implementation, if any.
45      *
46      * @param serviceInterface given service interface
47      * @param <T> interface type
48      * @return returns proxy for the requested Action
49      */
50     <T extends Action> T getActionService(Class<T> serviceInterface);
51
52     /**
53      * Returns an implementation of a requested ListAction service.
54      *
55      * <p>
56      * The returned instance is not an actual implementation of the ListAction service interface, but a
57      * proxy implementation of the interface that forwards to an actual implementation, if any.
58      *
59      * @param serviceInterface given service interface
60      * @param <T> interface type
61      * @return returns proxy for the requested ListAction
62      */
63     <T extends ListAction> T getListActionService(Class<T> serviceInterface);
64
65 }