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.collect.ImmutableSet;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.concepts.Registration;
16 * A {@link DOMService} which allows registration of action implementations with a conceptual router. The client
17 * counterpart of this service is {@link DOMActionService}.
20 public interface DOMActionProviderService
21 extends DOMService<DOMActionProviderService, DOMActionProviderService.Extension> {
23 * Marker interface for extensions of {@link DOMActionProviderService}.
25 interface Extension extends DOMService.Extension<DOMActionProviderService, Extension> {
30 * Register an {@link DOMActionImplementation} object with this service, servicing specified action instances.
32 * @param implementation action implementation, must not be null
33 * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
34 * @return A {@link Registration} object, guaranteed to be non-null.
35 * @throws NullPointerException if {@code implementation} or {@code instances} is null, or if {@code instances}
36 * contains a null element.
37 * @throws IllegalArgumentException if {@code instances} is empty
39 Registration registerActionImplementation(DOMActionImplementation implementation, Set<DOMActionInstance> instances);
42 * Register an {@link DOMActionImplementation} object with this service, servicing specified action instance.
44 * @param implementation action implementation, must not be null
45 * @param instance supported operation identifier. Must not be null.
46 * @return A {@link Registration} object, guaranteed to be non-null.
47 * @throws NullPointerException if any argument is null
49 default Registration registerActionImplementation(final DOMActionImplementation implementation,
50 final DOMActionInstance instance) {
51 return registerActionImplementation(implementation, ImmutableSet.of(instance));
55 * Register an {@link DOMActionImplementation} object with this service, servicing specified action instances.
57 * @param implementation action implementation, must not be null
58 * @param instances Set of supported operation identifiers. Must not be null, empty, or contain a null element.
59 * @return A {@link Registration} object, guaranteed to be non-null.
60 * @throws NullPointerException if {@code implementation} or {@code instances} is null, or if {@code instances}
61 * contains a null element.
62 * @throws IllegalArgumentException if {@code instances} is empty
64 default Registration registerActionImplementation(final DOMActionImplementation implementation,
65 final DOMActionInstance... instances) {
66 return registerActionImplementation(implementation, ImmutableSet.copyOf(instances));