blob: 4886b97b4e7cd787066331dab452f40ffae8b716 [file] [log] [blame]
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +05301/*
Brian O'Connor0a4e6742016-09-15 23:03:10 -07002 * Copyright 2016-present Open Networking Laboratory
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +05303 *
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.pce.pceservice;
18
19import org.onosproject.incubator.net.tunnel.Tunnel;
20import org.onosproject.incubator.net.tunnel.TunnelId;
21import org.onosproject.net.intent.Constraint;
Priyanka Bbae0eeb12016-11-30 11:59:48 +053022
23import java.util.Collection;
24import java.util.List;
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +053025
26/**
27 * Abstraction of an entity which provides functionalities of pce path.
28 */
29public interface PcePath {
30
31 /**
32 * Returns the attribute path id.
33 *
34 * @return path id
35 */
36 TunnelId id();
37
38 /**
39 * Sets the attribute path id.
40 *
41 * @param id path id
42 */
43 void id(TunnelId id);
44
45 /**
46 * Returns the attribute ingress.
47 *
48 * @return source
49 */
50 String source();
51
52 /**
53 * Sets the attribute ingress.
54 *
55 * @param src pce source
56 */
57 void source(String src);
58
59 /**
60 * Returns the attribute egress.
61 *
62 * @return destination
63 */
64 String destination();
65
66 /**
67 * Sets the attribute egress.
68 *
69 * @param dst pce destination.
70 */
71 void destination(String dst);
72
73 /**
74 * Returns the attribute lspType.
75 *
76 * @return lspType
77 */
78 LspType lspType();
79
80 /**
81 * Returns the attribute symbolic-path-name.
82 *
83 * @return symbolic-path-name
84 */
85 String name();
86
87 /**
88 * Returns the attribute cost constraint.
89 *
90 * @return cost constraint
91 */
92 Constraint costConstraint();
93
94 /**
95 * Returns the attribute bandwidth constraint.
96 *
97 * @return bandwidth constraint
98 */
99 Constraint bandwidthConstraint();
100
101 /**
Priyanka Bbae0eeb12016-11-30 11:59:48 +0530102 * Returns the list of explicit path objects.
103 *
104 * @return list of explicit path objects
105 */
106 Collection<ExplicitPathInfo> explicitPathInfo();
107
108 /**
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +0530109 * Copies only non-null or non-zero member variables.
110 *
111 * @param id path-id
112 * @return pce-path
113 */
114 PcePath copy(PcePath id);
115
116 /**
117 * Builder for pce path.
118 */
119 interface Builder {
120
121 /**
122 * Returns the builder object of path id.
123 *
124 * @param id path id
125 * @return builder object of path id
126 */
127 Builder id(String id);
128
129 /**
130 * Returns the builder object of ingress.
131 *
132 * @param source ingress
133 * @return builder object of ingress
134 */
135 Builder source(String source);
136
137 /**
138 * Returns the builder object of egress.
139 *
140 * @param destination egress
141 * @return builder object of egress
142 */
143 Builder destination(String destination);
144
145 /**
146 * Returns the builder object of lspType.
147 *
148 * @param lspType lsp type
149 * @return builder object of lsp type
150 */
151 Builder lspType(String lspType);
152
153 /**
154 * Returns the builder object of symbolic-path-name.
155 *
156 * @param n symbolic-path-name
157 * @return builder object of symbolic-path-name
158 */
159 Builder name(String n);
160
161 /**
162 * Returns the builder object of cost constraint.
163 *
164 * @param cost constraint
165 * @return builder object of cost constraint
166 */
167 Builder costConstraint(String cost);
168
169 /**
170 * Returns the builder object of bandwidth constraint.
171 *
172 * @param bandwidth constraint
173 * @return builder object of bandwidth constraint
174 */
175 Builder bandwidthConstraint(String bandwidth);
176
177 /**
178 * Copies tunnel information to local.
179 *
180 * @param tunnel pcc tunnel
Priyanka Bbae0eeb12016-11-30 11:59:48 +0530181 * @param explicitPathInfoList list of explicit path objects info
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +0530182 * @return object of pce-path
183 */
Priyanka Bbae0eeb12016-11-30 11:59:48 +0530184 Builder of(Tunnel tunnel, List<ExplicitPathInfo> explicitPathInfoList);
185
186 /**
187 * Returns the builder object of ExplicitPathInfo.
188 *
189 * @param explicitPathInfo list of explicit path obj
190 * @return builder object of ExplicitPathInfo
191 */
192 Builder explicitPathInfo(Collection<ExplicitPathInfo> explicitPathInfo);
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +0530193
194 /**
Mahesh Poojary Sd7a36922016-04-01 16:11:14 +0530195 * Builds object of pce path.
196 *
197 * @return object of pce path.
198 */
199 PcePath build();
200 }
201}