blob: 7a9b5bfe89493bdd337af2df5d70b55bdd771cba [file] [log] [blame]
Carmelo Cascone1022a4e2017-05-25 00:16:18 -04001/*
2 * Copyright 2017-present Open Networking Laboratory
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
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 /**
31 * Returns the header type associated with the given name, if present.
32 *
33 * @param name string value
34 * @return optional header type model
35 */
36 Optional<PiHeaderTypeModel> headerType(String name);
37
38 /**
39 * Returns the collection of all header types defined by this pipeline model.
40 *
41 * @return collection of header types
42 */
43 Collection<PiHeaderTypeModel> headerTypes();
44
45 /**
46 * Returns the header instance associated with the given name, if present.
47 *
48 * @param name string value
49 * @return optional header instance model
50 */
51 Optional<PiHeaderModel> header(String name);
52
53 /**
54 * Returns the collection of all header instance models defined by this pipeline model.
55 *
56 * @return collection of header types
57 */
58 Collection<PiHeaderModel> headers();
59
60 /**
61 * Returns the action model associated with the given name, if present.
62 *
63 * @param name string value
64 * @return optional action model
65 */
66 Optional<PiActionModel> action(String name);
67
68 /**
69 * Returns the collection of all action models defined by this pipeline model.
70 *
71 * @return collection of actions
72 */
73 Collection<PiActionModel> actions();
74
75 /**
76 * Returns the table model associated with the given name, if present.
77 *
78 * @param name string value
79 * @return optional table model
80 */
81 Optional<PiTableModel> table(String name);
82
83 /**
84 * Returns the collection of all table models defined by this pipeline model.
85 *
86 * @return collection of actions
87 */
88 Collection<PiTableModel> tables();
89}