Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [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 | |
| 17 | package org.onosproject.net.pi.model; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | |
| 21 | import java.util.Collection; |
| 22 | import java.util.Optional; |
| 23 | |
| 24 | /** |
| 25 | * Model of a protocol-independent pipeline. |
| 26 | */ |
| 27 | @Beta |
| 28 | public interface PiPipelineModel { |
| 29 | |
| 30 | /** |
Emanuele Gallone | b692a82 | 2021-11-14 22:39:35 +0100 | [diff] [blame] | 31 | * Returns the data plane target architecture supported by this pipeline model. |
| 32 | * |
| 33 | * @return optional architecture string. |
| 34 | */ |
| 35 | Optional<String> architecture(); |
| 36 | |
| 37 | /** |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 38 | * Returns the table model associated with the given ID, if present. |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 39 | * |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 40 | * @param tableId table ID |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 41 | * @return optional table model |
| 42 | */ |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 43 | Optional<PiTableModel> table(PiTableId tableId); |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * Returns the collection of all table models defined by this pipeline model. |
| 47 | * |
| 48 | * @return collection of actions |
| 49 | */ |
| 50 | Collection<PiTableModel> tables(); |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 51 | |
| 52 | /** |
FrankWang | 2674e45 | 2018-05-24 17:13:35 +0800 | [diff] [blame] | 53 | * Returns the counter model associated with the given ID, if present. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 54 | * |
| 55 | * @param counterId counter ID |
| 56 | * @return optional counter model |
| 57 | */ |
| 58 | Optional<PiCounterModel> counter(PiCounterId counterId); |
| 59 | |
| 60 | /** |
| 61 | * Returns all counter models defined by this pipeline model. |
| 62 | * |
| 63 | * @return collection of counter models |
| 64 | */ |
| 65 | Collection<PiCounterModel> counters(); |
| 66 | |
| 67 | /** |
FrankWang | 2674e45 | 2018-05-24 17:13:35 +0800 | [diff] [blame] | 68 | * Returns the meter model associated with the given ID, if present. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 69 | * |
| 70 | * @param meterId meter ID |
| 71 | * @return optional meter model |
| 72 | */ |
| 73 | Optional<PiMeterModel> meter(PiMeterId meterId); |
| 74 | |
| 75 | /** |
| 76 | * Returns all meter models defined by this pipeline model. |
| 77 | * |
| 78 | * @return collection of meter models |
| 79 | */ |
| 80 | Collection<PiMeterModel> meters(); |
| 81 | |
| 82 | /** |
FrankWang | 2674e45 | 2018-05-24 17:13:35 +0800 | [diff] [blame] | 83 | * Returns the register model associated with the given ID, if present. |
| 84 | * |
| 85 | * @param registerId register ID |
| 86 | * @return optional register model |
| 87 | */ |
| 88 | Optional<PiRegisterModel> register(PiRegisterId registerId); |
| 89 | |
| 90 | /** |
| 91 | * Returns all register models defined by this pipeline model. |
| 92 | * |
| 93 | * @return collection of register models |
| 94 | */ |
| 95 | Collection<PiRegisterModel> registers(); |
| 96 | |
| 97 | /** |
| 98 | * Returns the action profile model associated with the given ID, if present. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 99 | * |
| 100 | * @param actionProfileId action profile ID |
| 101 | * @return optional action profile model |
| 102 | */ |
| 103 | Optional<PiActionProfileModel> actionProfiles(PiActionProfileId actionProfileId); |
| 104 | |
| 105 | /** |
| 106 | * Returns all action profile models defined by this pipeline model. |
| 107 | * |
| 108 | * @return collection of action profile models |
| 109 | */ |
| 110 | Collection<PiActionProfileModel> actionProfiles(); |
| 111 | |
| 112 | /** |
| 113 | * Returns the packet operation model of the given type, if present. |
| 114 | * |
| 115 | * @param type packet operation type |
| 116 | * @return packet operation model |
| 117 | */ |
| 118 | Optional<PiPacketOperationModel> packetOperationModel(PiPacketOperationType type); |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 119 | } |