Update RPC invocation to take ContainerNode
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / ForwardingDOMRpcImplementation.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.dom.spi;
9
10 import com.google.common.collect.ForwardingObject;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import org.eclipse.jdt.annotation.NonNull;
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.ContainerNode;
17
18 /**
19  * Utility implementation which implements {@link DOMRpcImplementation} by forwarding it to a backing delegate.
20  */
21 public abstract class ForwardingDOMRpcImplementation extends ForwardingObject implements DOMRpcImplementation {
22     @Override
23     protected abstract @NonNull DOMRpcImplementation delegate();
24
25     @Override
26     public ListenableFuture<? extends DOMRpcResult> invokeRpc(final DOMRpcIdentifier type, final ContainerNode input) {
27         return delegate().invokeRpc(type, input);
28     }
29 }