Clean up (DOM)DataTreeIdentifier methods
[mdsal.git] / binding / mdsal-binding-api / src / main / java / org / opendaylight / mdsal / binding / api / RpcProviderService.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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 package org.opendaylight.mdsal.binding.api;
9
10 import com.google.common.collect.ClassToInstanceMap;
11 import java.util.Set;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.concepts.Registration;
14 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
15 import org.opendaylight.yangtools.yang.binding.Rpc;
16
17 /**
18  * Provides ability to registered Remote Procedure Call (RPC) service implementations. The RPCs are defined in YANG
19  * models.
20  */
21 public interface RpcProviderService extends BindingService {
22     /**
23      * Register an {@link Rpc} implementation.
24      *
25      * @param implementation implementation object
26      * @return A {@link Registration} controlling unregistration
27      * @throws NullPointerException if {@code implementation} is {@code null}
28      */
29     @NonNull Registration registerRpcImplementation(Rpc<?, ?> implementation);
30
31     /**
32      * Register an {@link Rpc} implementation on a set of datastore context paths.
33      *
34      * @param implementation implementation object
35      * @param paths Datastore paths to service
36      * @return A {@link Registration} controlling unregistration
37      * @throws NullPointerException if any argument is {@code null}
38      */
39     @NonNull Registration registerRpcImplementation(Rpc<?, ?> implementation, Set<InstanceIdentifier<?>> paths);
40
41     /**
42      * Register a set of {@link Rpc} implementations. Note that this method does not support registering multiple
43      * implementations of the same {@link Rpc} and hence we require specifying them through a
44      * {@link ClassToInstanceMap}.
45      *
46      * @param implementations implementation objects
47      * @return A {@link Registration} controlling unregistration
48      * @throws NullPointerException if {@code implementations} is {@code null}
49      */
50     @NonNull Registration registerRpcImplementations(ClassToInstanceMap<Rpc<?, ?>> implementations);
51
52     /**
53      * Register a set of {@link Rpc} implementations on a set of datastore context paths. Note that this method does not
54      * support registering multiple implementations of the same {@link Rpc} and hence we require specifying them through
55      * a {@link ClassToInstanceMap}.
56      *
57      * @param implementations implementation objects
58      * @return A {@link Registration} controlling unregistration
59      * @throws NullPointerException if any argument is {@code null}
60      */
61     @NonNull Registration registerRpcImplementations(ClassToInstanceMap<Rpc<?, ?>> implementations,
62         Set<InstanceIdentifier<?>> paths);
63 }