Cleaned up mdsal-common-api and mdsal-dom-spi
[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 org.opendaylight.mdsal.dom.api.DOMRpcException;
11 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
12 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
13 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
14
15 import com.google.common.collect.ForwardingObject;
16 import com.google.common.util.concurrent.CheckedFuture;
17 import javax.annotation.Nonnull;
18 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19
20 /**
21  * Utility implementation which implements {@link DOMRpcImplementation} by forwarding it to
22  * a backing delegate.
23  */
24 public abstract class ForwardingDOMRpcImplementation extends ForwardingObject implements DOMRpcImplementation {
25     @Override
26     protected abstract @Nonnull DOMRpcImplementation delegate();
27
28     @Override
29     public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final DOMRpcIdentifier type, final NormalizedNode<?, ?> input) {
30         return delegate().invokeRpc(type, input);
31     }
32 }