2 * Copyright (c) 2014, 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.controller.remote.rpc;
10 import akka.actor.ActorRef;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import org.opendaylight.controller.remote.rpc.messages.ExecuteRpc;
13 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
14 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
15 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 * A {@link DOMRpcImplementation} which routes invocation requests to a remote invoker actor.
21 * @author Robert Varga
23 final class RemoteRpcImplementation extends AbstractRemoteImplementation<ExecuteRpc> implements DOMRpcImplementation {
24 RemoteRpcImplementation(final ActorRef remoteInvoker, final RemoteOpsProviderConfig config) {
25 super(remoteInvoker, config);
29 public ListenableFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc,
30 final NormalizedNode<?, ?> input) {
31 return new RemoteDOMRpcFuture(rpc.getType(), ask(ExecuteRpc.from(rpc, input)));
35 public long invocationCost() {