Replace UnsignedInt32Counter by LongAdder
[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 java.util.concurrent.atomic.LongAdder;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.controller.config.yang.bgp.rib.impl.BgpRenderState;
14 import org.opendaylight.protocol.bgp.rib.impl.stats.peer.route.PerTableTypeRouteCounter;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.RibId;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
19
20 /**
21  * @author Kevin Wang
22  */
23 public class RIBImplRuntimeMXBeanImpl implements BGPRenderStats {
24     private final BGPRenderStats renderStats;
25
26     public RIBImplRuntimeMXBeanImpl(@Nonnull final BgpId bgpId, @Nonnull final RibId ribId, @Nonnull final AsNumber localAs, @Nullable final ClusterIdentifier clusterId) {
27         this.renderStats = new BGPRenderStatsImpl(bgpId, ribId, localAs, clusterId);
28     }
29
30     @Override
31     public BgpRenderState getBgpRenderState() {
32         return this.renderStats.getBgpRenderState();
33     }
34
35     @Override
36     public PerTableTypeRouteCounter getLocRibRouteCounter() {
37         return this.renderStats.getLocRibRouteCounter();
38     }
39
40     @Override
41     public LongAdder getConfiguredPeerCounter() {
42         return this.renderStats.getConfiguredPeerCounter();
43     }
44
45     @Override
46     public LongAdder getConnectedPeerCounter() {
47         return this.renderStats.getConnectedPeerCounter();
48     }
49 }