Binding v2 runtime - adapters - impl - operations
[mdsal.git] / binding2 / mdsal-binding2-api / src / main / java / org / opendaylight / mdsal / binding / javav2 / api / RpcActionProviderService.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 java.util.Set;
13 import org.opendaylight.mdsal.binding.javav2.spec.base.Action;
14 import org.opendaylight.mdsal.binding.javav2.spec.base.InstanceIdentifier;
15 import org.opendaylight.mdsal.binding.javav2.spec.base.KeyedInstanceIdentifier;
16 import org.opendaylight.mdsal.binding.javav2.spec.base.ListAction;
17 import org.opendaylight.mdsal.binding.javav2.spec.base.Rpc;
18 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
19 import org.opendaylight.yangtools.concepts.ObjectRegistration;
20
21 /**
22  * Provides ability to register Remote Procedure Call (RPC) and Action service implementations.
23  * The RPCs and Actions are defined in YANG models.
24  */
25 @Beta
26 public interface RpcActionProviderService {
27
28     /**
29      * Returns class representing registration of global RPC.
30      * @param type RPC binding generated interface
31      * @param implementation RPC binding implementation
32      * @param <S> service class type
33      * @param <T> service implementation type
34      * @return returns class representing a RPC registration
35      */
36     <S extends Rpc<?, ?>, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
37         T implementation);
38
39     /**
40      * Returns class representing registration of global RPC for supported paths.
41      * @param type RPC binding generated interface
42      * @param implementation RPC binding implementation
43      * @param paths set of supported paths
44      * @param <S> service class type
45      * @param <T> service implementation type
46      * @return returns class representing a RPC registration
47      */
48     <S extends Rpc<?, ?>, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
49         T implementation, Set<InstanceIdentifier<?>> paths);
50
51     /**
52      * Returns class representing registration of Action.
53      * @param type Action binding generated interface
54      * @param parent parent node for Action connected to
55      * @param implementation Action binding implementation
56      * @param <S> service class type
57      * @param <P> parent type
58      * @param <T> service implementation type
59      * @return returns class representing a Action registration
60      */
61     <S extends Action<? extends TreeNode, ?, ?>, T extends S, P extends TreeNode> ObjectRegistration<T>
62             registerActionImplementation(
63         Class<S> type, InstanceIdentifier<P> parent, T implementation);
64
65     /**
66      * Returns class representing registration of ListAction.
67      * @param type ListAction binding generated interface
68      * @param parent parent node for ListAction connected to
69      * @param implementation ListAction binding implementation
70      * @param <S> service class type
71      * @param <P> parent type
72      * @param <K> key type
73      * @param <T> service implementation type
74      * @return returns class representing a ListAction registration
75      */
76     <S extends ListAction<? extends TreeNode, ?, ?>, T extends S, P extends TreeNode, K> ObjectRegistration<T>
77             registerListActionImplementation(
78             Class<S> type, KeyedInstanceIdentifier<P, K> parent, T implementation);
79 }