Binding v2 runtime - adapters - impl - operations
[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 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
16
17 /**
18  * Provides access to registered Remote Procedure Call (RPC) and Action service implementations.
19  * RPCs and Actions are defined in YANG models.
20  *
21  * <p>
22  * RPC/Action implementations are registered using the {@link RpcActionProviderService}.
23  */
24 @Beta
25 public interface RpcActionConsumerRegistry extends BindingService {
26
27     /**
28      * Returns an implementation of a requested RPC service.
29      *
30      * <p>
31      * The returned instance is not an actual implementation of the RPC service interface, but a
32      * proxy implementation of the interface that forwards to an actual implementation, if any.
33      *
34      * @param serviceInterface given service interface
35      * @param <T> interface type
36      * @return returns proxy for the requested RPC
37      */
38     <T extends Rpc<?, ?>> T getRpcService(Class<T> serviceInterface);
39
40     /**
41      * Returns an implementation of a requested Action service.
42      *
43      * <p>
44      * The returned instance is not an actual implementation of the Action service interface, but a
45      * proxy implementation of the interface that forwards to an actual implementation, if any.
46      *
47      * @param serviceInterface given service interface
48      * @param <T> interface type
49      * @return returns proxy for the requested Action
50      */
51     <T extends Action<? extends TreeNode, ?, ?>> T getActionService(Class<T> serviceInterface);
52
53     /**
54      * Returns an implementation of a requested ListAction service.
55      *
56      * <p>
57      * The returned instance is not an actual implementation of the ListAction service interface, but a
58      * proxy implementation of the interface that forwards to an actual implementation, if any.
59      *
60      * @param serviceInterface given service interface
61      * @param <T> interface type
62      * @return returns proxy for the requested ListAction
63      */
64     <T extends ListAction<? extends TreeNode, ?, ?>> T getListActionService(Class<T> serviceInterface);
65
66 }