2 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
9 package org.opendaylight.netvirt.bgpmanager.oam;
11 import javax.management.NotificationBroadcasterSupport;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
15 import java.util.HashMap;
16 import java.util.Iterator;
21 * Created by ECHIAPT on 9/25/2015.
23 public class BgpCountersBroadcaster extends NotificationBroadcasterSupport implements BgpCountersBroadcasterMBean {
24 public Map<String, String> bgpCountersMap = new HashMap<String, String>();
25 private static final Logger LOGGER = LoggerFactory.getLogger(BgpCountersBroadcaster.class);
27 public Map<String, String> retrieveCounterMap() {
28 LOGGER.trace("Polled retrieveCounterMap");
29 Map<String, String> countersVal = new HashMap<String, String>(bgpCountersMap);
30 Iterator<Map.Entry<String, String>> entries = countersVal.entrySet().iterator();
31 while (entries.hasNext()) {
32 Map.Entry<String, String> entry = entries.next();
33 LOGGER.trace(entry.getKey() + ", Value from MBean= " + entry.getValue());
38 public void setBgpCountersMap(Map fetchedCountersMap) {
39 LOGGER.trace("putAll");
40 bgpCountersMap.clear();
41 bgpCountersMap.putAll(fetchedCountersMap);