blob: d147eaaa9a611cb143cfd4aed111678a3c7e71d3 [file] [log] [blame]
Phaneendra Manda1ea49142015-10-26 22:33:06 +05301/*
2 * Copyright 2015 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 */
16package org.onosproject.vtnrsc;
17
18import java.util.List;
19
20/**
21 * Abstraction of an entity providing Port Chain information.
22 * A Port Chain (Service Function Path) consists of
23 * a set of Neutron ports, to define the sequence of service functions
24 * a set of flow classifiers, to specify the classified traffic flows to enter the chain
25 */
26public interface PortChain {
27
28 /**
29 * Returns the ID of this port chain.
30 *
31 * @return the port chain id
32 */
33 PortChainId portChainId();
34
35 /**
36 * Returns the tenant id of this port chain.
37 *
38 * @return the tenant id
39 */
40 TenantId tenantId();
41
42 /**
43 * Returns the name of this port chain.
44 *
45 * @return name of port chain
46 */
47 String name();
48
49 /**
50 * Returns the description of this port chain.
51 *
52 * @return description of port chain
53 */
54 String description();
55
56 /**
57 * Returns the list of port pair groups associated with
58 * this port chain.
59 *
60 * @return list of port pair groups
61 */
62 List<PortPairGroupId> portPairGroups();
63
64 /**
65 * Returns the list of flow classifiers associated with
66 * this port chain.
67 *
68 * @return list of flow classifiers
69 */
70 List<FlowClassifierId> flowClassifiers();
71
72 /**
73 * Returns whether this port chain is an exact match to the port chain given
74 * in the argument.
75 * <p>
76 * Exact match means the port pair groups and flow classifiers match
77 * with the given port chain. It does not consider the port chain id, name
78 * and description.
79 * </p>
80 *
81 * @param portChain other port chain to match against
82 * @return true if the port chains are an exact match, otherwise false
83 */
84 boolean exactMatch(PortChain portChain);
85
86 /**
87 * A port chain builder..
88 */
89 interface Builder {
90
91 /**
92 * Assigns the port chain id to this object.
93 *
94 * @param portChainId the port chain id
95 * @return this the builder object
96 */
97 Builder setId(PortChainId portChainId);
98
99 /**
100 * Assigns tenant id to this object.
101 *
102 * @param tenantId tenant id of the port chain
103 * @return this the builder object
104 */
105 Builder setTenantId(TenantId tenantId);
106
107 /**
108 * Assigns the name to this object.
109 *
110 * @param name name of the port chain
111 * @return this the builder object
112 */
113 Builder setName(String name);
114
115 /**
116 * Assigns the description to this object.
117 *
118 * @param description description of the port chain
119 * @return this the builder object
120 */
121 Builder setDescription(String description);
122
123 /**
124 * Assigns the port pair groups associated with the port chain
125 * to this object.
126 *
127 * @param portPairGroups list of port pair groups
128 * @return this the builder object
129 */
130 Builder setPortPairGroups(List<PortPairGroupId> portPairGroups);
131
132 /**
133 * Assigns the flow classifiers associated with the port chain
134 * to this object.
135 *
136 * @param flowClassifiers list of flow classifiers
137 * @return this the builder object
138 */
139 Builder setFlowClassifiers(List<FlowClassifierId> flowClassifiers);
140
141 /**
142 * Builds a port chain object.
143 *
144 * @return a port chain.
145 */
146 PortChain build();
147 }
148}