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 DOMExtensibleService<DOMActionProviderService, DOMActionProviderServiceExtension> {
25 * Register an {@link DOMActionImplementation} 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 DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(T implementation,
34 Set<DOMActionInstance> instances);
36 default <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(
37 final T implementation, final DOMActionInstance instance) {
38 return registerActionImplementation(implementation, ImmutableSet.of(instance));
41 default <T extends DOMActionImplementation> ObjectRegistration<T> registerActionImplementation(
42 final T implementation, final DOMActionInstance... instances) {
43 return registerActionImplementation(implementation, ImmutableSet.copyOf(instances));