/* * Copyright (c) 2013 Cisco Systems, Inc. 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.dom.adapter.invoke; import static com.google.common.base.Preconditions.checkArgument; import com.google.common.util.concurrent.ListenableFuture; import java.lang.reflect.Method; import java.util.Map; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.RpcService; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.RpcResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Provides single method invocation of RPCs on supplied instance. * *
* RPC Service invoker provides common invocation interface for any subtype of {@link RpcService} via
* {@link #invokeRpc(RpcService, QName, DataObject)} method.
*/
public abstract class RpcServiceInvoker {
private static final Logger LOG = LoggerFactory.getLogger(RpcServiceInvoker.class);
/**
* Creates an RPCServiceInvoker for specified QName-<Method mapping.
*
* @param qnameToMethod translation mapping, must not be null nor empty.
* @return An {@link RpcServiceInvoker} instance.
*/
public static RpcServiceInvoker from(final Map