4 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
6 * This program and the accompanying materials are made available under the
7 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 * and is available at http://www.eclipse.org/legal/epl-v10.html
11 package org.opendaylight.controller.config.yang.test.util;
13 import com.google.common.collect.Lists;
14 import java.math.BigInteger;
15 import java.util.List;
16 import org.opendaylight.controller.config.yang.test.impl.Asdf;
17 import org.opendaylight.controller.config.yang.test.impl.Deep2;
18 import org.opendaylight.controller.config.yang.test.impl.Deep3;
19 import org.opendaylight.controller.config.yang.test.impl.Deep4;
20 import org.opendaylight.controller.config.yang.test.impl.InnerInnerRunningDataRuntimeMXBean;
21 import org.opendaylight.controller.config.yang.test.impl.InnerRunningDataAdditionalRuntimeMXBean;
22 import org.opendaylight.controller.config.yang.test.impl.InnerRunningDataRuntimeMXBean;
23 import org.opendaylight.controller.config.yang.test.impl.InnerRunningDataRuntimeRegistration;
24 import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplModule;
25 import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplRuntimeMXBean;
26 import org.opendaylight.controller.config.yang.test.impl.NetconfTestImplRuntimeRegistration;
27 import org.opendaylight.controller.config.yang.test.impl.NotStateBean;
28 import org.opendaylight.controller.config.yang.test.impl.RetValContainer;
29 import org.opendaylight.controller.config.yang.test.impl.RetValList;
31 public class NetconfTestImplModuleUtil {
32 public static NetconfTestImplRuntimeRegistration registerRuntimeBeans(final NetconfTestImplModule module) {
33 NetconfTestImplRuntimeRegistration reg = module.getRootRuntimeBeanRegistratorWrapper().register(new NetconfTestImplRuntimeMXBean() {
36 public Long getCreatedSessions() {
37 return module.getSimpleLong();
41 public Asdf getAsdf() {
42 final Asdf asdf = new Asdf();
43 asdf.setSimpleString("asdf");
48 public BigInteger getCommonStat() {
49 return new BigInteger("54");
53 public String noArg(final String arg1) {
54 return arg1.toUpperCase();
58 public Long commonRpcTwo() {
63 public String commonRpcThree() {
68 public Boolean commonRpc() {
73 public void netconfImplRpcFromGrouping() {
74 // rpc from grouping within same yang module
79 for (int i = 0; i < module.getSimpleShort(); i++) {
82 reg.register(new InnerRunningDataAdditionalRuntimeMXBean() {
84 public Integer getSimpleInt3() {
85 return module.getSimpleTest();
89 public Deep4 getDeep4() {
90 final Deep4 d = new Deep4();
96 public String getSimpleString() {
97 return Integer.toString(finalI);
101 public void noArgInner() {
105 InnerRunningDataRuntimeRegistration innerReg = reg.register(new InnerRunningDataRuntimeMXBean() {
107 public Integer getSimpleInt3() {
112 public Deep2 getDeep2() {
117 for (int j = 0; j < module.getSimpleShort(); j++) {
118 final int finalJ = j;
119 innerReg.register(new InnerInnerRunningDataRuntimeMXBean() {
121 public List<NotStateBean> getNotStateBean() {
122 NotStateBean b1 = new NotStateBean();
123 b1.setElement("not state");
124 return Lists.newArrayList(b1);
128 public Integer getSimpleInt3() {
133 public Deep3 getDeep3() {
138 public List<String> getListOfStrings() {
139 return Lists.newArrayList("l1", "l2");
143 public List<RetValList> listOutput() {
144 return Lists.newArrayList(new RetValList());
148 public Boolean noArgInnerInner(Integer integer, Boolean aBoolean) {
153 public RetValContainer containerOutput() {
154 return new RetValContainer();
158 public List<String> leafListOutput() {
159 return Lists.newArrayList("1", "2");