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 action implementations with a conceptual router. The client
18 * counterpart of this service is {@link DOMActionService}.
22 public interface DOMActionProviderService
23 extends DOMService<DOMActionProviderService, DOMActionProviderService.Extension> {
25 * Marker interface for extensions of {@link DOMActionProviderService}.
27 interface Extension extends DOMService.Extension<DOMActionProviderService, Extension> {
32 * Register an {@link DOMActionImplementation} object with this service, servicing specified action instances.
34 * @param implementation action implementation, must not be null
35 * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
36 * @return A {@link ObjectRegistration} object, guaranteed to be non-null.
37 * @throws NullPointerException if {@code implementation} or {@code instances} is null, or if {@code instances}
38 * contains a null element.
39 * @throws IllegalArgumentException if {@code instances} is empty
41 <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(T implementation,
42 Set<DOMActionInstance> instances);
45 * Register an {@link DOMActionImplementation} object with this service, servicing specified action instance.
47 * @param implementation action implementation, must not be null
48 * @param instance supported operation identifier. Must not be null.
49 * @return A {@link ObjectRegistration} object, guaranteed to be non-null.
50 * @throws NullPointerException if any argument is null
52 default <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(
53 final T implementation, final DOMActionInstance instance) {
54 return registerActionImplementation(implementation, ImmutableSet.of(instance));
58 * Register an {@link DOMActionImplementation} object with this service, servicing specified action instances.
60 * @param implementation action implementation, must not be null
61 * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
62 * @return A {@link ObjectRegistration} object, guaranteed to be non-null.
63 * @throws NullPointerException if {@code implementation} or {@code instances} is null, or if {@code instances}
64 * contains a null element.
65 * @throws IllegalArgumentException if {@code instances} is empty
67 default <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(
68 final T implementation, final DOMActionInstance... instances) {
69 return registerActionImplementation(implementation, ImmutableSet.copyOf(instances));