blob: 2efa40fd6b934ea57030b3f1e0d2f11359e2ad9d [file] [log] [blame]
Carmelo Cascone1022a4e2017-05-25 00:16:18 -04001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Carmelo Cascone1022a4e2017-05-25 00:16:18 -04003 *
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
17package org.onosproject.net.pi.model;
18
19import com.google.common.annotations.Beta;
20
21import java.util.Collection;
22import java.util.Optional;
23
24/**
25 * Model of a protocol-independent pipeline.
26 */
27@Beta
28public interface PiPipelineModel {
29
30 /**
Emanuele Gallonece994202021-11-14 22:39:35 +010031 * 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 Cascone87892e22017-11-13 16:01:29 -080038 * Returns the table model associated with the given ID, if present.
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040039 *
Carmelo Cascone87892e22017-11-13 16:01:29 -080040 * @param tableId table ID
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040041 * @return optional table model
42 */
Carmelo Cascone87892e22017-11-13 16:01:29 -080043 Optional<PiTableModel> table(PiTableId tableId);
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040044
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 Cascone87892e22017-11-13 16:01:29 -080051
52 /**
FrankWang2674e452018-05-24 17:13:35 +080053 * Returns the counter model associated with the given ID, if present.
Carmelo Cascone87892e22017-11-13 16:01:29 -080054 *
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 /**
FrankWang2674e452018-05-24 17:13:35 +080068 * Returns the meter model associated with the given ID, if present.
Carmelo Cascone87892e22017-11-13 16:01:29 -080069 *
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 /**
FrankWang2674e452018-05-24 17:13:35 +080083 * 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 Cascone87892e22017-11-13 16:01:29 -080099 *
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 Cascone1022a4e2017-05-25 00:16:18 -0400119}