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
9 package org.opendaylight.controller.config.facade.xml.rpc;
11 import com.google.common.base.Preconditions;
15 private final Map<String, Map<String, ModuleRpcs>> mappedRpcs;
17 public Rpcs(Map<String, Map<String, ModuleRpcs>> mappedRpcs) {
18 this.mappedRpcs = mappedRpcs;
21 public ModuleRpcs getRpcMapping(RuntimeRpcElementResolved id) {
22 Map<String, ModuleRpcs> modules = mappedRpcs.get(id.getNamespace());
23 Preconditions.checkState(modules != null, "No modules found for namespace %s", id.getNamespace());
24 String moduleName = id.getModuleName();
25 ModuleRpcs rpcMapping = modules.get(moduleName);
26 Preconditions.checkState(rpcMapping != null, "No module %s found for namespace %s", moduleName,