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 | /** |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 31 | * Returns the table model associated with the given ID, if present. |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 32 | * |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 33 | * @param tableId table ID |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 34 | * @return optional table model |
| 35 | */ |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 36 | Optional<PiTableModel> table(PiTableId tableId); |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * Returns the collection of all table models defined by this pipeline model. |
| 40 | * |
| 41 | * @return collection of actions |
| 42 | */ |
| 43 | Collection<PiTableModel> tables(); |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 44 | |
| 45 | /** |
FrankWang | 2674e45 | 2018-05-24 17:13:35 +0800 | [diff] [blame] | 46 | * Returns the counter model associated with the given ID, if present. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 47 | * |
| 48 | * @param counterId counter ID |
| 49 | * @return optional counter model |
| 50 | */ |
| 51 | Optional<PiCounterModel> counter(PiCounterId counterId); |
| 52 | |
| 53 | /** |
| 54 | * Returns all counter models defined by this pipeline model. |
| 55 | * |
| 56 | * @return collection of counter models |
| 57 | */ |
| 58 | Collection<PiCounterModel> counters(); |
| 59 | |
| 60 | /** |
FrankWang | 2674e45 | 2018-05-24 17:13:35 +0800 | [diff] [blame] | 61 | * Returns the meter model associated with the given ID, if present. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 62 | * |
| 63 | * @param meterId meter ID |
| 64 | * @return optional meter model |
| 65 | */ |
| 66 | Optional<PiMeterModel> meter(PiMeterId meterId); |
| 67 | |
| 68 | /** |
| 69 | * Returns all meter models defined by this pipeline model. |
| 70 | * |
| 71 | * @return collection of meter models |
| 72 | */ |
| 73 | Collection<PiMeterModel> meters(); |
| 74 | |
| 75 | /** |
FrankWang | 2674e45 | 2018-05-24 17:13:35 +0800 | [diff] [blame] | 76 | * Returns the register model associated with the given ID, if present. |
| 77 | * |
| 78 | * @param registerId register ID |
| 79 | * @return optional register model |
| 80 | */ |
| 81 | Optional<PiRegisterModel> register(PiRegisterId registerId); |
| 82 | |
| 83 | /** |
| 84 | * Returns all register models defined by this pipeline model. |
| 85 | * |
| 86 | * @return collection of register models |
| 87 | */ |
| 88 | Collection<PiRegisterModel> registers(); |
| 89 | |
| 90 | /** |
| 91 | * Returns the action profile model associated with the given ID, if present. |
Carmelo Cascone | 87892e2 | 2017-11-13 16:01:29 -0800 | [diff] [blame] | 92 | * |
| 93 | * @param actionProfileId action profile ID |
| 94 | * @return optional action profile model |
| 95 | */ |
| 96 | Optional<PiActionProfileModel> actionProfiles(PiActionProfileId actionProfileId); |
| 97 | |
| 98 | /** |
| 99 | * Returns all action profile models defined by this pipeline model. |
| 100 | * |
| 101 | * @return collection of action profile models |
| 102 | */ |
| 103 | Collection<PiActionProfileModel> actionProfiles(); |
| 104 | |
| 105 | /** |
| 106 | * Returns the packet operation model of the given type, if present. |
| 107 | * |
| 108 | * @param type packet operation type |
| 109 | * @return packet operation model |
| 110 | */ |
| 111 | Optional<PiPacketOperationModel> packetOperationModel(PiPacketOperationType type); |
Carmelo Cascone | 1022a4e | 2017-05-25 00:16:18 -0400 | [diff] [blame] | 112 | } |