Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +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 | */ |
Jonathan Hart | 317f476 | 2015-11-09 16:05:36 -0800 | [diff] [blame] | 16 | package org.onosproject.vtnrsc.flowclassifier; |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 17 | |
Mahesh Poojary Huawei | ecf971d | 2015-12-05 14:25:53 +0530 | [diff] [blame] | 18 | import org.onosproject.event.ListenerService; |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 19 | import org.onosproject.vtnrsc.FlowClassifier; |
| 20 | import org.onosproject.vtnrsc.FlowClassifierId; |
| 21 | |
| 22 | /** |
| 23 | * Provides Services for Flow Classifier. |
| 24 | */ |
Mahesh Poojary Huawei | ecf971d | 2015-12-05 14:25:53 +0530 | [diff] [blame] | 25 | public interface FlowClassifierService extends ListenerService<FlowClassifierEvent, FlowClassifierListener> { |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 26 | |
| 27 | /** |
Mahesh Poojary S | fac0226 | 2015-11-20 19:13:22 +0530 | [diff] [blame] | 28 | * Check whether Flow Classifier is present based on given Flow Classifier |
| 29 | * Id. |
| 30 | * |
| 31 | * @param id flow classifier identifier |
| 32 | * @return true if flow classifier is present otherwise return false |
| 33 | */ |
| 34 | boolean exists(FlowClassifierId id); |
| 35 | |
| 36 | /** |
| 37 | * Returns the number of flow classifiers known to the system. |
| 38 | * |
| 39 | * @return number of flow classifiers |
| 40 | */ |
| 41 | int getFlowClassifierCount(); |
| 42 | |
| 43 | /** |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 44 | * Store Flow Classifier. |
| 45 | * |
Mahesh Poojary S | fac0226 | 2015-11-20 19:13:22 +0530 | [diff] [blame] | 46 | * @param flowClassifier flow classifier |
| 47 | * @return true if adding flow classifier into store is success otherwise |
| 48 | * return false |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 49 | */ |
| 50 | boolean createFlowClassifier(FlowClassifier flowClassifier); |
| 51 | |
| 52 | /** |
| 53 | * Return the existing collection of Flow Classifier. |
| 54 | * |
Mahesh Poojary S | fac0226 | 2015-11-20 19:13:22 +0530 | [diff] [blame] | 55 | * @return flow classifier collections |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 56 | */ |
| 57 | Iterable<FlowClassifier> getFlowClassifiers(); |
| 58 | |
| 59 | /** |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 60 | * Retrieve the Flow Classifier based on given Flow Classifier id. |
| 61 | * |
Mahesh Poojary S | fac0226 | 2015-11-20 19:13:22 +0530 | [diff] [blame] | 62 | * @param id flow classifier identifier |
| 63 | * @return flow classifier if present otherwise returns null |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 64 | */ |
| 65 | FlowClassifier getFlowClassifier(FlowClassifierId id); |
| 66 | |
| 67 | /** |
| 68 | * Update Flow Classifier based on given Flow Classifier Id. |
| 69 | * |
Mahesh Poojary S | fac0226 | 2015-11-20 19:13:22 +0530 | [diff] [blame] | 70 | * @param flowClassifier flow classifier |
| 71 | * @return true if flow classifier update is success otherwise return false |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 72 | */ |
| 73 | boolean updateFlowClassifier(FlowClassifier flowClassifier); |
| 74 | |
| 75 | /** |
| 76 | * Remove Flow Classifier from store based on given Flow Classifier Id. |
| 77 | * |
Mahesh Poojary S | fac0226 | 2015-11-20 19:13:22 +0530 | [diff] [blame] | 78 | * @param id flow classifier identifier |
| 79 | * @return true if flow classifier removal is success otherwise return |
| 80 | * false |
Bharat saraswal | e37f7f3 | 2015-10-26 15:50:22 +0530 | [diff] [blame] | 81 | */ |
| 82 | boolean removeFlowClassifier(FlowClassifierId id); |
Jonathan Hart | 317f476 | 2015-11-09 16:05:36 -0800 | [diff] [blame] | 83 | } |