2 * Copyright (c) 2013 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.controller.sal.binding.spi;
11 import java.util.concurrent.Future;
13 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.RpcService;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
19 public interface RpcMapper<T extends RpcService> {
21 Set<QName> getRpcQNames();
24 * Returns a class object representing subinterface
25 * to whom, this mapper is assigned.
29 Class<T> getServiceClass();
32 * Returns a Binding Mapper for Rpc Input Data
35 Mapper<?> getInputMapper();
37 * Returns a Binding Mapper for Rpc Output Data
41 Mapper<?> getOutputMapper();
44 * Returns a consumer proxy, which is responsible
45 * for invoking the rpc functionality of {@link BindingAwareBroker} implementation.
47 * @return Proxy of {@link RpcService} assigned to this mapper.
49 T getConsumerProxy(RpcProxyInvocationHandler handler);
52 * Invokes the method of RpcService representing the supplied rpc.
54 * @param rpc QName of Rpc
55 * @param impl Implementation of RpcService on which the method should be invoked
56 * @param baInput Input Data to RPC method
57 * @return Result of RPC invocation.
59 RpcResult<? extends DataObject> invokeRpcImplementation(QName rpc,
60 RpcService impl, DataObject baInput);
62 public interface RpcProxyInvocationHandler {
64 Future<RpcResult<? extends DataObject>> invokeRpc(RpcService proxy, QName rpc, DataObject input);