Merge "Resolve Bug:707 - ConfigPusher should wait for netconf-impl to register JMX...
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / sal / binding / impl / RootDataBrokerImpl.java
1 /*
2  * Copyright (c) 2014 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.sal.binding.impl;\r
9 \r
10 import org.opendaylight.controller.config.yang.md.sal.binding.impl.Data;\r
11 import org.opendaylight.controller.config.yang.md.sal.binding.impl.DataBrokerImplRuntimeMXBean;\r
12 import org.opendaylight.controller.config.yang.md.sal.binding.impl.DataBrokerImplRuntimeRegistration;\r
13 import org.opendaylight.controller.config.yang.md.sal.binding.impl.DataBrokerImplRuntimeRegistrator;\r
14 import org.opendaylight.controller.config.yang.md.sal.binding.impl.Transactions;\r
15 import org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentConnector;\r
16 \r
17 public class RootDataBrokerImpl extends DataBrokerImpl implements DataBrokerImplRuntimeMXBean {\r
18 \r
19     private final Transactions transactions = new Transactions();\r
20     private final Data data = new Data();\r
21     private BindingIndependentConnector bindingIndependentConnector;\r
22     private DataBrokerImplRuntimeRegistration runtimeBeanRegistration;\r
23 \r
24     public BindingIndependentConnector getBindingIndependentConnector() {\r
25         return bindingIndependentConnector;\r
26     }\r
27 \r
28     public Transactions getTransactions() {\r
29         transactions.setCreated(getCreatedTransactionsCount().get());\r
30         transactions.setSubmitted(getSubmittedTransactionsCount().get());\r
31         transactions.setSuccessful(getFinishedTransactionsCount().get());\r
32         transactions.setFailed(getFailedTransactionsCount().get());\r
33         return transactions;\r
34     }\r
35 \r
36     @Override\r
37     public Data getData() {\r
38         data.setTransactions(getTransactions());\r
39         return data;\r
40     }\r
41 \r
42     public void setBindingIndependentConnector(BindingIndependentConnector runtimeMapping) {\r
43         this.bindingIndependentConnector = runtimeMapping;\r
44     }\r
45 \r
46     public void registerRuntimeBean(DataBrokerImplRuntimeRegistrator rootRegistrator) {\r
47         runtimeBeanRegistration = rootRegistrator.register(this);\r
48     }\r
49 \r
50 }\r

©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.