2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.binding.api;
10 import com.google.common.collect.ClassToInstanceMap;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.concepts.ObjectRegistration;
14 import org.opendaylight.yangtools.concepts.Registration;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16 import org.opendaylight.yangtools.yang.binding.Rpc;
17 import org.opendaylight.yangtools.yang.binding.RpcService;
20 * Provides ability to registered Remote Procedure Call (RPC) service implementations. The RPCs are defined in YANG
23 public interface RpcProviderService extends BindingService {
25 * Register RPCs combined in a {@link RpcService} interface.
27 * @param <R> {@link RpcService} type
28 * @param <I> {@link RpcService} implementation type
29 * @param type {@link RpcService} class
30 * @param implementation implementation object
31 * @return An {@link ObjectRegistration} controlling unregistration
32 * @throws NullPointerException if any argument is {@code null}
33 * @deprecated Use {@link #registerRpcImplementation(Rpc)} or
34 * {@link #registerRpcImplementations(ClassToInstanceMap)} instead.
36 @Deprecated(since = "11.0.0", forRemoval = true)
37 <R extends RpcService, I extends R> @NonNull ObjectRegistration<I> registerRpcImplementation(Class<R> type,
41 * Register RPCs combined in a {@link RpcService} interface on a set of datastore context paths.
43 * @param <R> {@link RpcService} type
44 * @param <I> {@link RpcService} implementation type
45 * @param type {@link RpcService} class
46 * @param implementation implementation object
47 * @param paths Datastore paths to service
48 * @return An {@link ObjectRegistration} controlling unregistration
49 * @throws NullPointerException if any argument is {@code null}
50 * @deprecated Use {@link #registerRpcImplementation(Rpc, Set)} or
51 * {@link #registerRpcImplementations(ClassToInstanceMap, Set)} instead.
53 @Deprecated(since = "11.0.0", forRemoval = true)
54 <R extends RpcService, I extends R> @NonNull ObjectRegistration<I> registerRpcImplementation(Class<R> type,
55 I implementation, Set<InstanceIdentifier<?>> paths);
58 * Register an {@link Rpc} implementation.
60 * @param implementation implementation object
61 * @return A {@link Registration} controlling unregistration
62 * @throws NullPointerException if {@code implementation} is {@code null}
64 @NonNull Registration registerRpcImplementation(Rpc<?, ?> implementation);
67 * Register an {@link Rpc} implementation on a set of datastore context paths.
69 * @param implementation implementation object
70 * @param paths Datastore paths to service
71 * @return A {@link Registration} controlling unregistration
72 * @throws NullPointerException if any argument is {@code null}
74 @NonNull Registration registerRpcImplementation(Rpc<?, ?> implementation, Set<InstanceIdentifier<?>> paths);
77 * Register a set of {@link Rpc} implementations. Note that this method does not support registering multiple
78 * implementations of the same {@link Rpc} and hence we require specifying them through a
79 * {@link ClassToInstanceMap}.
81 * @param implementations implementation objects
82 * @return A {@link Registration} controlling unregistration
83 * @throws NullPointerException if {@code implementations} is {@code null}
85 @NonNull Registration registerRpcImplementations(ClassToInstanceMap<Rpc<?, ?>> implementations);
88 * Register a set of {@link Rpc} implementations on a set of datastore context paths. Note that this method does not
89 * support registering multiple implementations of the same {@link Rpc} and hence we require specifying them through
90 * a {@link ClassToInstanceMap}.
92 * @param implementations implementation objects
93 * @return A {@link Registration} controlling unregistration
94 * @throws NullPointerException if any argument is {@code null}
96 @NonNull Registration registerRpcImplementations(ClassToInstanceMap<Rpc<?, ?>> implementations,
97 Set<InstanceIdentifier<?>> paths);