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.dom.api;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.concepts.Registration;
16 * A {@link DOMService} which allows registration of RPC implementations with a conceptual router. The client
17 * counterpart of this service is {@link DOMRpcService}.
19 public interface DOMRpcProviderService extends DOMService {
21 * Register an {@link DOMRpcImplementation} object with this service.
23 * @param implementation RPC implementation, must not be null
24 * @param rpcs Array of supported RPC identifiers. Must not be null, empty, or contain a null element.
25 * Each identifier is added exactly once, no matter how many times it occurs.
26 * @return A {@link DOMRpcImplementationRegistration} object, guaranteed to be non-null.
27 * @throws NullPointerException if implementation or types is null
28 * @throws IllegalArgumentException if types is empty or contains a null element.
30 @NonNull <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T>
31 registerRpcImplementation(@NonNull T implementation, @NonNull DOMRpcIdentifier... rpcs);
34 * Register an {@link DOMRpcImplementation} object with this service.
36 * @param implementation RPC implementation, must not be null
37 * @param rpcs Set of supported RPC identifiers. Must not be null, empty, or contain a null element.
38 * @return A {@link DOMRpcImplementationRegistration} object, guaranteed to be non-null.
39 * @throws NullPointerException if implementation or types is null
40 * @throws IllegalArgumentException if types is empty or contains a null element.
42 @NonNull <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T>
43 registerRpcImplementation(@NonNull T implementation, @NonNull Set<DOMRpcIdentifier> rpcs);
46 * Register a set of {@link DOMRpcImplementation}s with this service. The registration is performed atomically.
48 * @param map Map of RPC identifiers and their corresponding implementations
49 * @return A registration object, guaranteed to be non-null
50 * @throws NullPointerException if map is null or contains a null element
51 * @throws IllegalArgumentException if map is empty.
53 @NonNull Registration registerRpcImplementations(Map<DOMRpcIdentifier, DOMRpcImplementation> map);