alshabib | e27055b | 2015-07-09 21:43:10 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.provider.of.meter.impl; |
| 18 | |
| 19 | import org.apache.felix.scr.annotations.Component; |
| 20 | import org.apache.felix.scr.annotations.Reference; |
| 21 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 22 | import org.onosproject.net.meter.MeterProvider; |
| 23 | import org.onosproject.net.provider.AbstractProvider; |
| 24 | import org.onosproject.net.provider.ProviderId; |
| 25 | import org.onosproject.openflow.controller.OpenFlowController; |
| 26 | import org.slf4j.Logger; |
| 27 | |
| 28 | import static org.slf4j.LoggerFactory.getLogger; |
| 29 | |
| 30 | /** |
| 31 | * Provider which uses an OpenFlow controller to handle meters. |
| 32 | */ |
| 33 | @Component(immediate = true) |
| 34 | public class OpenFlowMeterProvider extends AbstractProvider implements MeterProvider { |
| 35 | |
| 36 | private final Logger log = getLogger(getClass()); |
| 37 | |
| 38 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 39 | protected OpenFlowController controller; |
| 40 | |
| 41 | |
| 42 | /** |
| 43 | * Creates a OpenFlow meter provider. |
| 44 | */ |
| 45 | public OpenFlowMeterProvider() { |
| 46 | super(new ProviderId("of", "org.onosproject.provider.meter")); |
| 47 | } |
| 48 | } |