blob: c1840d92be2faa9e83e2ed18070bfa1ca5ac8e00 [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 /**
46 * Returns the counter model associated with the given ID, id present.
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 /**
61 * Returns the meter model associated with the given ID, id present.
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 /**
76 * Returns the action profile model associated with the given ID, id present.
77 *
78 * @param actionProfileId action profile ID
79 * @return optional action profile model
80 */
81 Optional<PiActionProfileModel> actionProfiles(PiActionProfileId actionProfileId);
82
83 /**
84 * Returns all action profile models defined by this pipeline model.
85 *
86 * @return collection of action profile models
87 */
88 Collection<PiActionProfileModel> actionProfiles();
89
90 /**
91 * Returns the packet operation model of the given type, if present.
92 *
93 * @param type packet operation type
94 * @return packet operation model
95 */
96 Optional<PiPacketOperationModel> packetOperationModel(PiPacketOperationType type);
Carmelo Cascone1022a4e2017-05-25 00:16:18 -040097}