Removing Blind imports across the module
[netvirt.git] / vpnservice / bgpmanager / bgpmanager-impl / src / main / java / org / opendaylight / netvirt / bgpmanager / oam / BgpCountersBroadcaster.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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
9 package org.opendaylight.netvirt.bgpmanager.oam;
10
11 import javax.management.NotificationBroadcasterSupport;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
14
15 import java.util.HashMap;
16 import java.util.Iterator;
17 import java.util.Map;
18
19
20 /**
21  * Created by ECHIAPT on 9/25/2015.
22  */
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);
26
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());
34         }
35         return countersVal;
36     }
37
38     public void setBgpCountersMap(Map fetchedCountersMap) {
39         LOGGER.trace("putAll");
40         bgpCountersMap.clear();
41         bgpCountersMap.putAll(fetchedCountersMap);
42     }
43 }