BUG-5876 Enhance BGP Speaker and Peer Stats II
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / stats / rib / impl / RIBImplRuntimeMXBeanImpl.java
1 /*
2  * Copyright (c) 2016 Brocade Communications 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.protocol.bgp.rib.impl.stats.rib.impl;
9
10 import javax.annotation.Nonnull;
11 import javax.annotation.Nullable;
12 import org.opendaylight.controller.config.yang.bgp.rib.impl.BgpRenderState;
13 import org.opendaylight.controller.config.yang.bgp.rib.impl.RIBImplRuntimeMXBean;
14 import org.opendaylight.protocol.bgp.rib.impl.stats.UnsignedInt32Counter;
15 import org.opendaylight.protocol.bgp.rib.impl.stats.peer.route.PerTableTypeRouteCounter;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.RibId;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
20
21 /**
22  * @author Kevin Wang
23  */
24 public class RIBImplRuntimeMXBeanImpl implements BGPRenderStats, RIBImplRuntimeMXBean {
25     private final BGPRenderStats renderStats;
26
27     public RIBImplRuntimeMXBeanImpl(@Nonnull final BgpId bgpId, @Nonnull final RibId ribId, @Nonnull final AsNumber localAs, @Nullable final ClusterIdentifier clusterId) {
28         renderStats = new BGPRenderStatsImpl(bgpId, ribId, localAs, clusterId);
29     }
30
31     @Override
32     public BgpRenderState getBgpRenderState() {
33         return this.renderStats.getBgpRenderState();
34     }
35
36     @Override
37     public PerTableTypeRouteCounter getLocRibRouteCounter() {
38         return this.renderStats.getLocRibRouteCounter();
39     }
40
41     @Override
42     public UnsignedInt32Counter getConfiguredPeerCounter() {
43         return this.renderStats.getConfiguredPeerCounter();
44     }
45
46     @Override
47     public UnsignedInt32Counter getConnectedPeerCounter() {
48         return this.renderStats.getConnectedPeerCounter();
49     }
50 }