Merge "Bug 2697: Improvement wrong response handling, missing message"
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / md / sal / dom / api / DOMRpcProviderService.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.controller.md.sal.dom.api;
9
10 import java.util.Set;
11 import javax.annotation.Nonnull;
12
13 /**
14  * A {@link DOMService} which allows registration of RPC implementations with a conceptual
15  * router. The client counterpart of this service is {@link DOMRpcService}.
16  */
17 public interface DOMRpcProviderService extends DOMService {
18     /**
19      * Register an {@link DOMRpcImplementation} object with this service.
20      *
21      * @param implementation RPC implementation, must not be null
22      * @param rpcs Array of supported RPC identifiers. Must not be null, empty, or contain a null element.
23      *             Each identifier is added exactly once, no matter how many times it occurs.
24      * @return A {@link DOMRpcImplementationRegistration} object, guaranteed to be non-null.
25      * @throws NullPointerException if implementation or types is null
26      * @throws IllegalArgumentException if types is empty or contains a null element.
27      */
28     @Nonnull <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull T implementation, @Nonnull DOMRpcIdentifier... rpcs);
29
30     /**
31      * Register an {@link DOMRpcImplementation} object with this service.
32      *
33      * @param implementation RPC implementation, must not be null
34      * @param rpcs Set of supported RPC identifiers. Must not be null, empty, or contain a null element.
35      * @return A {@link DOMRpcImplementationRegistration} object, guaranteed to be non-null.
36      * @throws NullPointerException if implementation or types is null
37      * @throws IllegalArgumentException if types is empty or contains a null element.
38      */
39     @Nonnull <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull T implementation, @Nonnull Set<DOMRpcIdentifier> rpcs);
40 }