Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 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.net.pi.model; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | |
| 21 | import java.util.Collection; |
| 22 | |
| 23 | /** |
| 24 | * Model of an action profile in a protocol-independent pipeline. |
| 25 | */ |
| 26 | @Beta |
| 27 | public interface PiActionProfileModel { |
| 28 | |
| 29 | /** |
| 30 | * Returns the ID of this action profile. |
| 31 | * |
| 32 | * @return action profile ID |
| 33 | */ |
| 34 | PiActionProfileId id(); |
| 35 | |
| 36 | /** |
| 37 | * Returns the collection of table IDs that use this action profile. |
| 38 | * |
| 39 | * @return collection of table models |
| 40 | */ |
| 41 | Collection<PiTableId> tables(); |
| 42 | |
| 43 | /** |
Carmelo Cascone | 99c59db | 2019-01-17 15:39:35 -0800 | [diff] [blame] | 44 | * Returns true if this action profile implements dynamic selection, false |
| 45 | * otherwise. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 46 | * |
Carmelo Cascone | 99c59db | 2019-01-17 15:39:35 -0800 | [diff] [blame] | 47 | * @return true if action profile implements dynamic selection, false |
| 48 | * otherwise |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 49 | */ |
| 50 | boolean hasSelector(); |
| 51 | |
| 52 | /** |
Carmelo Cascone | 99c59db | 2019-01-17 15:39:35 -0800 | [diff] [blame] | 53 | * Returns the maximum number of member entries that this action profile can |
| 54 | * hold. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 55 | * |
| 56 | * @return maximum number of member entries |
| 57 | */ |
Carmelo Cascone | 99c59db | 2019-01-17 15:39:35 -0800 | [diff] [blame] | 58 | long size(); |
| 59 | |
| 60 | /** |
| 61 | * Returns the maximum number of members a group of this action profile can |
| 62 | * hold. This method is meaningful only if the action profile implements |
| 63 | * dynamic selection. 0 signifies that an explicit limit is not set. |
| 64 | * |
| 65 | * @return maximum number of members a group can hold |
| 66 | */ |
| 67 | int maxGroupSize(); |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 68 | } |