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.bgpmanager.oam;
11 import com.google.common.collect.ImmutableBiMap;
12 import com.google.common.collect.ImmutableMap;
14 import javax.management.MBeanNotificationInfo;
15 import javax.management.Notification;
16 import javax.management.NotificationBroadcasterSupport;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
23 * Created by ECHIAPT on 9/25/2015.
25 public class BgpCountersBroadcaster extends NotificationBroadcasterSupport implements BgpCountersBroadcasterMBean {
26 public Map<String, String> bgpCountersMap = new HashMap<String, String>();
27 private static final Logger LOGGER = LoggerFactory.getLogger(BgpCountersBroadcaster.class);
29 public Map<String, String> retrieveCounterMap() {
30 LOGGER.trace("Polled retrieveCounterMap");
31 Map<String, String> countersVal = new HashMap<String, String>(bgpCountersMap);
32 Iterator<Map.Entry<String, String>> entries = countersVal.entrySet().iterator();
33 while (entries.hasNext()) {
34 Map.Entry<String, String> entry = entries.next();
35 LOGGER.trace(entry.getKey() + ", Value from MBean= " + entry.getValue());
40 public void setBgpCountersMap(Map fetchedCountersMap) {
41 LOGGER.trace("putAll");
42 bgpCountersMap.clear();
43 bgpCountersMap.putAll(fetchedCountersMap);