0d7fde38972d67fe91cffc72f408b8e94ae89a29
[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.Set;
11 import java.util.concurrent.atomic.LongAdder;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14 import org.opendaylight.controller.config.yang.bgp.rib.impl.BgpRenderState;
15 import org.opendaylight.protocol.bgp.rib.spi.state.BGPRIBState;
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.rib.rev130925.rib.TablesKey;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.ClusterIdentifier;
21
22 /**
23  * @author Kevin Wang
24  */
25 public class RIBImplRuntimeMXBeanImpl implements BGPRenderStats {
26     private final BGPRenderStats renderStats;
27
28     public RIBImplRuntimeMXBeanImpl(@Nonnull final BgpId bgpId, @Nonnull final RibId ribId,
29         @Nonnull final AsNumber localAs, @Nullable final ClusterIdentifier clusterId,
30         @Nonnull final BGPRIBState globalState,
31         @Nonnull final Set<TablesKey> tablesKeys) {
32         this.renderStats = new BGPRenderStatsImpl(bgpId, ribId, localAs, clusterId, globalState, tablesKeys);
33     }
34
35     @Override
36     public BgpRenderState getBgpRenderState() {
37         return this.renderStats.getBgpRenderState();
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 }