2 * Copyright (c) 2017 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.mdsal.binding.javav2.api;
11 import com.google.common.annotations.Beta;
12 import com.google.common.collect.ImmutableSet;
14 import org.opendaylight.mdsal.binding.javav2.spec.base.Action;
15 import org.opendaylight.mdsal.binding.javav2.spec.base.InstanceIdentifier;
16 import org.opendaylight.mdsal.binding.javav2.spec.base.Rpc;
17 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
18 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
19 import org.opendaylight.yangtools.concepts.ObjectRegistration;
22 * Provides ability to register Remote Procedure Call (RPC) and Action service implementations.
23 * The RPCs and Actions are defined in YANG models.
26 public interface RpcActionProviderService {
29 * Returns class representing registration of global RPC.
30 * @param type RPC binding generated interface
31 * @param implementation RPC binding implementation
32 * @param <S> service class type
33 * @param <T> service implementation type
34 * @return returns class representing a RPC registration
36 <S extends Rpc<?, ?>, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
40 * Returns class representing registration of global RPC for supported paths.
41 * @param type RPC binding generated interface
42 * @param implementation RPC binding implementation
43 * @param paths set of supported paths
44 * @param <S> service class type
45 * @param <T> service implementation type
46 * @return returns class representing a RPC registration
48 <S extends Rpc<?, ?>, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
49 T implementation, Set<InstanceIdentifier<?>> paths);
52 * Returns class representing registration of Action/ListAction.
53 * @param type Action/ListAction binding generated interface
54 * @param implementation Action/ListAction binding implementation
55 * @param datastore {@link LogicalDatastoreType} on which the implementation operates
56 * @param validNodes Set of nodes this implementation is constrained to, empty if this implementation can handle
58 * @param <S> service class type
59 * @param <P> parent type
60 * @param <T> service implementation type
61 * @return returns class representing a Action registration
63 <S extends Action<? extends TreeNode, ?, ?, ?>, T extends S, P extends TreeNode> ObjectRegistration<T>
64 registerActionImplementation(
65 Class<S> type, T implementation, LogicalDatastoreType datastore, Set<DataTreeIdentifier<P>> validNodes);
67 default <S extends Action<? extends TreeNode, ?, ?, ?>, T extends S> ObjectRegistration<T>
68 registerActionImplementation(Class<S> type, T implementation, LogicalDatastoreType datastore) {
69 return registerActionImplementation(type, implementation, datastore, ImmutableSet.of());
72 default <S extends Action<? extends TreeNode, ?, ?, ?>, T extends S> ObjectRegistration<T>
73 registerActionImplementation(Class<S> type, T implementation) {
74 return registerActionImplementation(type, implementation, LogicalDatastoreType.OPERATIONAL, ImmutableSet.of());