blob: bddbae8fad4c127b78340c2ec31772b6d963e7b0 [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 /**
Carmelo Cascone87892e22017-11-13 16:01:29 -080031 * Returns the table model associated with the given ID, if present.
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040032 *
Carmelo Cascone87892e22017-11-13 16:01:29 -080033 * @param tableId table ID
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040034 * @return optional table model
35 */
Carmelo Cascone87892e22017-11-13 16:01:29 -080036 Optional<PiTableModel> table(PiTableId tableId);
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040037
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 Cascone87892e22017-11-13 16:01:29 -080044
45 /**
FrankWang2674e452018-05-24 17:13:35 +080046 * Returns the counter model associated with the given ID, if present.
Carmelo Cascone87892e22017-11-13 16:01:29 -080047 *
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 /**
FrankWang2674e452018-05-24 17:13:35 +080061 * Returns the meter model associated with the given ID, if present.
Carmelo Cascone87892e22017-11-13 16:01:29 -080062 *
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 /**
FrankWang2674e452018-05-24 17:13:35 +080076 * 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 Cascone87892e22017-11-13 16:01:29 -080092 *
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 Cascone1022a4e2017-05-25 00:16:18 -0400112}