alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.statistic.impl; |
| 2 | |
| 3 | import org.apache.felix.scr.annotations.Activate; |
| 4 | import org.apache.felix.scr.annotations.Component; |
| 5 | import org.apache.felix.scr.annotations.Deactivate; |
| 6 | import org.apache.felix.scr.annotations.Reference; |
| 7 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 8 | import org.apache.felix.scr.annotations.Service; |
| 9 | import org.onlab.onos.net.ConnectPoint; |
| 10 | import org.onlab.onos.net.Link; |
| 11 | import org.onlab.onos.net.Path; |
| 12 | import org.onlab.onos.net.flow.FlowRule; |
| 13 | import org.onlab.onos.net.flow.FlowRuleEvent; |
| 14 | import org.onlab.onos.net.flow.FlowRuleListener; |
| 15 | import org.onlab.onos.net.flow.FlowRuleService; |
| 16 | import org.onlab.onos.net.statistic.Load; |
| 17 | import org.onlab.onos.net.statistic.StatisticService; |
| 18 | import org.onlab.onos.net.statistic.StatisticStore; |
| 19 | import org.slf4j.Logger; |
| 20 | |
| 21 | import static org.slf4j.LoggerFactory.getLogger; |
| 22 | |
| 23 | /** |
| 24 | * Provides an implementation of the Statistic Service. |
| 25 | */ |
| 26 | @Component(immediate = true) |
| 27 | @Service |
| 28 | public class StatisticManager implements StatisticService { |
| 29 | |
| 30 | private final Logger log = getLogger(getClass()); |
| 31 | |
| 32 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 33 | protected FlowRuleService flowRuleService; |
| 34 | |
| 35 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 36 | protected StatisticStore statisticStore; |
| 37 | |
| 38 | private final InternalFlowRuleListener listener = new InternalFlowRuleListener(); |
| 39 | |
| 40 | @Activate |
| 41 | public void activate() { |
| 42 | flowRuleService.addListener(listener); |
| 43 | log.info("Started"); |
| 44 | } |
| 45 | |
| 46 | @Deactivate |
| 47 | public void deactivate() { |
| 48 | flowRuleService.removeListener(listener); |
| 49 | log.info("Stopped"); |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public Load load(Link link) { |
| 54 | return null; |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public Load load(ConnectPoint connectPoint) { |
| 59 | return null; |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public Link max(Path path) { |
| 64 | return null; |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public Link min(Path path) { |
| 69 | return null; |
| 70 | } |
| 71 | |
| 72 | @Override |
| 73 | public FlowRule highestHitter(ConnectPoint connectPoint) { |
| 74 | return null; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Internal flow rule event listener. |
| 79 | */ |
| 80 | private class InternalFlowRuleListener implements FlowRuleListener { |
| 81 | |
| 82 | @Override |
| 83 | public void event(FlowRuleEvent event) { |
| 84 | |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | |
| 89 | } |