2 * Copyright (c) 2017 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;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableSet;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.concepts.ObjectRegistration;
17 * A {@link DOMService} which allows registration of operation implementations with a conceptual
18 * router. The client counterpart of this service is {@link DOMOperationService}.
22 public interface DOMOperationProviderService
23 extends DOMExtensibleService<DOMOperationProviderService, DOMOperationProviderServiceExtension> {
25 * Register an {@link DOMOperationImplementation.Action} object with this service.
27 * @param implementation action implementation, must not be null
28 * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
29 * @return A {@link ObjectRegistration} object, guaranteed to be non-null.
30 * @throws NullPointerException if implementation or types is null
31 * @throws IllegalArgumentException if {@code instances} is empty
33 <T extends DOMOperationImplementation.Action> ObjectRegistration<T> registerActionImplementation(T implementation,
34 Set<DOMOperationInstance.Action> instances);
36 default <T extends DOMOperationImplementation.Action> ObjectRegistration<T> registerActionImplementation(
37 final T implementation, final DOMOperationInstance.Action... instances) {
38 return registerActionImplementation(implementation, ImmutableSet.copyOf(instances));
42 * Register an {@link DOMOperationImplementation.Rpc} object with this service.
44 * @param implementation RPC implementation, must not be null
45 * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
46 * @return A {@link ObjectRegistration} object, guaranteed to be non-null.
47 * @throws NullPointerException if implementation or types is null
48 * @throws IllegalArgumentException if {@code instances} is empty
50 <T extends DOMOperationImplementation.Rpc> ObjectRegistration<T> registerRpcImplementation(T implementation,
51 Set<DOMOperationInstance.Rpc> instances);
53 default <T extends DOMOperationImplementation.Rpc> ObjectRegistration<T> registerRpcImplementation(
54 final T implementation, final DOMOperationInstance.Rpc... instances) {
55 return registerRpcImplementation(implementation, ImmutableSet.copyOf(instances));