Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 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 | package org.onosproject.provider.bgpcep.flow.impl; |
| 17 | |
Ray Milkey | 17801b4 | 2019-02-22 14:18:00 -0800 | [diff] [blame] | 18 | import org.onosproject.net.flow.FlowRule; |
| 19 | import org.onosproject.net.flow.FlowRuleProvider; |
| 20 | import org.onosproject.net.flow.FlowRuleProviderRegistry; |
| 21 | import org.onosproject.net.flow.FlowRuleProviderService; |
| 22 | import org.onosproject.net.flow.oldbatch.FlowRuleBatchOperation; |
| 23 | import org.onosproject.net.provider.AbstractProvider; |
| 24 | import org.onosproject.net.provider.ProviderId; |
| 25 | import org.osgi.service.component.ComponentContext; |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 26 | import org.osgi.service.component.annotations.Activate; |
| 27 | import org.osgi.service.component.annotations.Component; |
| 28 | import org.osgi.service.component.annotations.Deactivate; |
| 29 | import org.osgi.service.component.annotations.Reference; |
| 30 | import org.osgi.service.component.annotations.ReferenceCardinality; |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 31 | import org.slf4j.Logger; |
| 32 | |
| 33 | import static org.slf4j.LoggerFactory.getLogger; |
| 34 | |
| 35 | /** |
| 36 | * Implementation of BGP-PCEP flow provider. |
| 37 | */ |
| 38 | @Component(immediate = true) |
| 39 | public class BgpcepFlowRuleProvider extends AbstractProvider |
| 40 | implements FlowRuleProvider { |
| 41 | |
| 42 | private final Logger log = getLogger(getClass()); |
| 43 | |
Ray Milkey | d84f89b | 2018-08-17 14:54:17 -0700 | [diff] [blame] | 44 | @Reference(cardinality = ReferenceCardinality.MANDATORY) |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 45 | protected FlowRuleProviderRegistry providerRegistry; |
| 46 | |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 47 | private FlowRuleProviderService providerService; |
Avantika-Huawei | fc10dca | 2016-06-10 16:13:55 +0530 | [diff] [blame] | 48 | |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 49 | /** |
| 50 | * Creates a BgpFlow host provider. |
| 51 | */ |
| 52 | public BgpcepFlowRuleProvider() { |
| 53 | super(new ProviderId("l3", "org.onosproject.provider.bgpcep")); |
| 54 | } |
| 55 | |
| 56 | @Activate |
| 57 | public void activate(ComponentContext context) { |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 58 | providerService = providerRegistry.register(this); |
| 59 | log.info("Started"); |
| 60 | } |
| 61 | |
| 62 | @Deactivate |
| 63 | public void deactivate(ComponentContext context) { |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 64 | providerRegistry.unregister(this); |
| 65 | providerService = null; |
| 66 | log.info("Stopped"); |
| 67 | } |
| 68 | |
| 69 | @Override |
| 70 | public void applyFlowRule(FlowRule... flowRules) { |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 71 | // TODO Auto-generated method stub |
| 72 | |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 73 | } |
| 74 | |
Avantika-Huawei | a4f66f6 | 2016-05-25 16:52:08 +0530 | [diff] [blame] | 75 | @Override |
| 76 | public void removeFlowRule(FlowRule... flowRules) { |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 77 | // TODO Auto-generated method stub |
Priyanka B | bd455ca | 2016-05-05 22:13:25 +0530 | [diff] [blame] | 78 | |
Priyanka B | bd455ca | 2016-05-05 22:13:25 +0530 | [diff] [blame] | 79 | } |
| 80 | |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 81 | @Override |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 82 | public void executeBatch(FlowRuleBatchOperation batch) { |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 83 | // TODO Auto-generated method stub |
Avantika-Huawei | fc10dca | 2016-06-10 16:13:55 +0530 | [diff] [blame] | 84 | |
Priyanka B | 9bee080 | 2016-04-27 22:06:02 +0530 | [diff] [blame] | 85 | } |
| 86 | } |