2 * Copyright (c) 2015 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.mdsal.dom.broker;
10 import com.google.common.util.concurrent.CheckedFuture;
11 import com.google.common.util.concurrent.Futures;
12 import java.util.List;
14 import org.opendaylight.mdsal.dom.api.DOMRpcException;
15 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
16 import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
17 import org.opendaylight.mdsal.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;
22 final class UnknownDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntry {
23 private final CheckedFuture<DOMRpcResult, DOMRpcException> unknownRpc;
25 UnknownDOMRpcRoutingTableEntry(final SchemaPath schemaPath, final Map<YangInstanceIdentifier,
26 List<DOMRpcImplementation>> impls) {
27 super(schemaPath, impls);
28 unknownRpc = Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(
29 new DOMRpcImplementationNotAvailableException("SchemaPath %s is not resolved to an RPC", schemaPath));
33 protected CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final NormalizedNode<?, ?> input) {
38 protected UnknownDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier,
39 List<DOMRpcImplementation>> impls) {
40 return new UnknownDOMRpcRoutingTableEntry(getSchemaPath(), impls);