Deprecate all MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / UnknownDOMRpcRoutingTableEntry.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.controller.md.sal.dom.broker.impl;
9
10 import com.google.common.util.concurrent.CheckedFuture;
11 import com.google.common.util.concurrent.Futures;
12 import java.util.List;
13 import java.util.Map;
14 import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
15 import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementation;
16 import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationNotAvailableException;
17 import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
18 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
19 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
20 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
21
22 @Deprecated
23 final class UnknownDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntry {
24     private final CheckedFuture<DOMRpcResult, DOMRpcException> unknownRpc;
25
26     UnknownDOMRpcRoutingTableEntry(final SchemaPath schemaPath,
27                                    final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
28         super(schemaPath, impls);
29         unknownRpc = Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(
30                 new DOMRpcImplementationNotAvailableException("SchemaPath %s is not resolved to an RPC", schemaPath));
31     }
32
33     @Override
34     protected CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final NormalizedNode<?, ?> input) {
35         return unknownRpc;
36     }
37
38     @Override
39     protected UnknownDOMRpcRoutingTableEntry newInstance(
40             final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
41         return new UnknownDOMRpcRoutingTableEntry(getSchemaPath(), impls);
42     }
43 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.