2 * Copyright (c) 2013 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.controller.sal.binding.codegen.impl;
10 import java.util.HashMap;
11 import java.util.HashSet;
15 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
17 import com.google.common.collect.Iterables;
19 final class RpcServiceMetadata {
20 private final Set<Class<? extends BaseIdentity>> contexts = new HashSet<>();
21 private final Map<String, RpcMetadata> rpcMethods = new HashMap<>();
22 private final Iterable<Class<? extends BaseIdentity>> roContexts = Iterables.unmodifiableIterable(contexts);
24 public Iterable<Class<? extends BaseIdentity>> getContexts() {
28 public RpcMetadata getRpcMethod(final String name) {
29 return rpcMethods.get(name);
32 public void addContext(final Class<? extends BaseIdentity> context) {
33 contexts.add(context);
36 public void addRpcMethod(final String name, final RpcMetadata routingPair) {
37 rpcMethods.put(name, routingPair);