/* * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.mdsal.binding.api; import com.google.common.annotations.Beta; import com.google.common.collect.ImmutableSet; import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yangtools.yang.binding.Action; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.RpcInput; /** * Provides access to registered {@code action} implementations. Each action is defined in a YANG model, * and implementations are added dynamically at runtime, via {@link ActionProviderService}. * * @author Robert Varga */ @Beta @NonNullByDefault public interface ActionService extends BindingService { /** * Returns an implementation of a requested {@link Action}. Returned instance is not an actual implementation * of the Action service interface, but a proxy implementation of the interface that forwards to an actual * implementation, if any. * *

* The following describes the behavior of the proxy when invoking * {@link Action#invoke(InstanceIdentifier, RpcInput)}: *

* *

* The returned proxy is automatically updated with the most recent registered implementation, hence there is no * guarantee that multiple consecutive invocations will be handled by the same implementation. * * @param spec Action instance specification * @param validNodes Set of nodes this service will be constrained to, empty if no constraints are known * @return A proxy implementation of the generated interface * @throws NullPointerException if {@code actionInterface} is null * @throws IllegalArgumentException when {@code actionInterface} does not conform to the Binding Specification */

, ?, ?>> A getActionHandle(ActionSpec spec, Set> validNodes); default

, ?, ?>> A getActionHandle( final ActionSpec spec) { return getActionHandle(spec, ImmutableSet.of()); } default

, ?, ?>> A getActionHandle( final ActionSpec spec, final LogicalDatastoreType dataStore, final InstanceIdentifier

path) { return getActionHandle(spec, ImmutableSet.of(DataTreeIdentifier.create(dataStore, path))); } default

, ?, ?>> A getActionHandle( final ActionSpec spec, final InstanceIdentifier

path) { return getActionHandle(spec, LogicalDatastoreType.OPERATIONAL, path); } default

, ?, ?>> A getActionHandle( final ActionSpec spec, @SuppressWarnings("unchecked") final DataTreeIdentifier

... nodes) { return getActionHandle(spec, ImmutableSet.copyOf(nodes)); } }