blob: 03710460d4e2733c47afc153fb4865a8c7eeb96d [file] [log] [blame]
HIGUCHI Yuta356086e2013-06-12 15:21:19 -07001package net.onrc.onos.ofcontroller.util;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08002
Pavlin Radoslavov27831be2013-10-28 23:40:29 -07003import java.util.ArrayList;
4
HIGUCHI Yuta356086e2013-06-12 15:21:19 -07005import net.floodlightcontroller.util.MACAddress;
HIGUCHI Yuta20514902013-06-12 11:24:16 -07006import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
7import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
Pavlin Radoslavovad008e02013-02-21 18:42:42 -08008
Pavlin Radoslavov892dd182013-12-05 23:33:15 -08009import org.codehaus.jackson.annotate.JsonIgnore;
Pavlin Radoslavovad008e02013-02-21 18:42:42 -080010import org.codehaus.jackson.annotate.JsonProperty;
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080011
12/**
13 * The class representing the Flow Path.
14 */
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -070015public class FlowPath implements Comparable<FlowPath> {
Pavlin Radoslavovafbf1032014-02-04 10:37:52 -080016 public static final int PRIORITY_DEFAULT = 32768; // Default Flow Priority
17
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080018 private FlowId flowId; // The Flow ID
19 private CallerId installerId; // The Caller ID of the path installer
Pavlin Radoslavovd28cf7c2013-10-26 11:27:43 -070020 private FlowPathType flowPathType; // The Flow Path type
Pavlin Radoslavov7d4a40e2013-10-27 23:39:40 -070021 private FlowPathUserState flowPathUserState; // The Flow Path User state
Pavlin Radoslavov204b2862013-07-12 14:15:36 -070022 private FlowPathFlags flowPathFlags; // The Flow Path flags
Pavlin Radoslavov5139c0b2013-12-09 18:04:53 -080023 private int idleTimeout; // The Flow idle timeout
24 private int hardTimeout; // The Flow hard timeout
Pavlin Radoslavovafbf1032014-02-04 10:37:52 -080025 private int priority; // The Flow priority
Pavlin Radoslavov5139c0b2013-12-09 18:04:53 -080026 private DataPath dataPath; // The data path
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070027 private FlowEntryMatch flowEntryMatch; // Common Flow Entry Match for all
28 // Flow Entries
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -070029 private FlowEntryActions flowEntryActions; // The Flow Entry Actions for
30 // the first Flow Entry
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080031
32 /**
33 * Default constructor.
34 */
35 public FlowPath() {
Pavlin Radoslavovd28cf7c2013-10-26 11:27:43 -070036 flowPathType = FlowPathType.FP_TYPE_UNKNOWN;
Pavlin Radoslavov7d4a40e2013-10-27 23:39:40 -070037 flowPathUserState = FlowPathUserState.FP_USER_UNKNOWN;
Pavlin Radoslavov204b2862013-07-12 14:15:36 -070038 flowPathFlags = new FlowPathFlags();
Pavlin Radoslavovafbf1032014-02-04 10:37:52 -080039 priority = FlowPath.PRIORITY_DEFAULT;
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -080040 dataPath = new DataPath();
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -070041 flowEntryActions = new FlowEntryActions();
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -080042 }
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070043
Pankaj Berde6a97eb82013-03-28 12:12:43 -070044 /**
45 * Constructor to instantiate from object in Network Map
46 */
47 public FlowPath(IFlowPath flowObj) {
48 dataPath = new DataPath();
49 this.setFlowId(new FlowId(flowObj.getFlowId()));
50 this.setInstallerId(new CallerId(flowObj.getInstallerId()));
Pavlin Radoslavovd28cf7c2013-10-26 11:27:43 -070051 this.setFlowPathType(FlowPathType.valueOf(flowObj.getFlowPathType()));
Pavlin Radoslavov7d4a40e2013-10-27 23:39:40 -070052 this.setFlowPathUserState(FlowPathUserState.valueOf(flowObj.getFlowPathUserState()));
Pavlin Radoslavov204b2862013-07-12 14:15:36 -070053 this.setFlowPathFlags(new FlowPathFlags(flowObj.getFlowPathFlags()));
Pavlin Radoslavov5139c0b2013-12-09 18:04:53 -080054 this.setIdleTimeout(flowObj.getIdleTimeout());
55 this.setHardTimeout(flowObj.getHardTimeout());
Pavlin Radoslavovafbf1032014-02-04 10:37:52 -080056 this.setPriority(flowObj.getPriority());
Pankaj Berde6a97eb82013-03-28 12:12:43 -070057 this.dataPath().srcPort().setDpid(new Dpid(flowObj.getSrcSwitch()));
58 this.dataPath().srcPort().setPort(new Port(flowObj.getSrcPort()));
59 this.dataPath().dstPort().setDpid(new Dpid(flowObj.getDstSwitch()));
60 this.dataPath().dstPort().setPort(new Port(flowObj.getDstPort()));
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070061 //
62 // Extract the match conditions that are common for all Flow Entries
63 //
64 {
65 FlowEntryMatch match = new FlowEntryMatch();
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -070066 String matchSrcMac = flowObj.getMatchSrcMac();
67 if (matchSrcMac != null)
68 match.enableSrcMac(MACAddress.valueOf(matchSrcMac));
69 String matchDstMac = flowObj.getMatchDstMac();
70 if (matchDstMac != null)
71 match.enableDstMac(MACAddress.valueOf(matchDstMac));
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -070072 Short matchEthernetFrameType = flowObj.getMatchEthernetFrameType();
73 if (matchEthernetFrameType != null)
74 match.enableEthernetFrameType(matchEthernetFrameType);
75 Short matchVlanId = flowObj.getMatchVlanId();
76 if (matchVlanId != null)
77 match.enableVlanId(matchVlanId);
78 Byte matchVlanPriority = flowObj.getMatchVlanPriority();
79 if (matchVlanPriority != null)
80 match.enableVlanPriority(matchVlanPriority);
81 String matchSrcIPv4Net = flowObj.getMatchSrcIPv4Net();
82 if (matchSrcIPv4Net != null)
83 match.enableSrcIPv4Net(new IPv4Net(matchSrcIPv4Net));
84 String matchDstIPv4Net = flowObj.getMatchDstIPv4Net();
85 if (matchDstIPv4Net != null)
86 match.enableDstIPv4Net(new IPv4Net(matchDstIPv4Net));
87 Byte matchIpProto = flowObj.getMatchIpProto();
88 if (matchIpProto != null)
89 match.enableIpProto(matchIpProto);
90 Byte matchIpToS = flowObj.getMatchIpToS();
91 if (matchIpToS != null)
92 match.enableIpToS(matchIpToS);
93 Short matchSrcTcpUdpPort = flowObj.getMatchSrcTcpUdpPort();
94 if (matchSrcTcpUdpPort != null)
95 match.enableSrcTcpUdpPort(matchSrcTcpUdpPort);
96 Short matchDstTcpUdpPort = flowObj.getMatchDstTcpUdpPort();
97 if (matchDstTcpUdpPort != null)
98 match.enableDstTcpUdpPort(matchDstTcpUdpPort);
99
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700100 this.setFlowEntryMatch(match);
101 }
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700102
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700103 //
104 // Extract the actions for the first Flow Entry
105 //
106 {
107 FlowEntryActions actions = new FlowEntryActions();
108
109 String actionsStr = flowObj.getActions();
110 if (actions != null)
111 actions = new FlowEntryActions(actionsStr);
112
113 this.setFlowEntryActions(actions);
114 }
115
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700116 //
117 // Extract all Flow Entries
118 //
119 Iterable<IFlowEntry> flowEntries = flowObj.getFlowEntries();
120 for (IFlowEntry flowEntryObj : flowEntries) {
121 FlowEntry flowEntry = new FlowEntry();
122 flowEntry.setFlowEntryId(new FlowEntryId(flowEntryObj.getFlowEntryId()));
123 flowEntry.setDpid(new Dpid(flowEntryObj.getSwitchDpid()));
124
125 //
126 // Extract the match conditions
127 //
128 FlowEntryMatch match = new FlowEntryMatch();
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700129 //
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700130 Short matchInPort = flowEntryObj.getMatchInPort();
131 if (matchInPort != null)
132 match.enableInPort(new Port(matchInPort));
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700133 //
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700134 String matchSrcMac = flowEntryObj.getMatchSrcMac();
135 if (matchSrcMac != null)
136 match.enableSrcMac(MACAddress.valueOf(matchSrcMac));
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700137 //
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700138 String matchDstMac = flowEntryObj.getMatchDstMac();
139 if (matchDstMac != null)
140 match.enableDstMac(MACAddress.valueOf(matchDstMac));
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700141 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700142 Short matchEthernetFrameType = flowEntryObj.getMatchEthernetFrameType();
143 if (matchEthernetFrameType != null)
144 match.enableEthernetFrameType(matchEthernetFrameType);
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700145 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700146 Short matchVlanId = flowEntryObj.getMatchVlanId();
147 if (matchVlanId != null)
148 match.enableVlanId(matchVlanId);
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700149 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700150 Byte matchVlanPriority = flowEntryObj.getMatchVlanPriority();
151 if (matchVlanPriority != null)
152 match.enableVlanPriority(matchVlanPriority);
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700153 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700154 String matchSrcIPv4Net = flowEntryObj.getMatchSrcIPv4Net();
155 if (matchSrcIPv4Net != null)
156 match.enableSrcIPv4Net(new IPv4Net(matchSrcIPv4Net));
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700157 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700158 String matchDstIPv4Net = flowEntryObj.getMatchDstIPv4Net();
159 if (matchDstIPv4Net != null)
160 match.enableDstIPv4Net(new IPv4Net(matchDstIPv4Net));
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700161 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700162 Byte matchIpProto = flowEntryObj.getMatchIpProto();
163 if (matchIpProto != null)
164 match.enableIpProto(matchIpProto);
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700165 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700166 Byte matchIpToS = flowEntryObj.getMatchIpToS();
167 if (matchIpToS != null)
168 match.enableIpToS(matchIpToS);
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700169 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700170 Short matchSrcTcpUdpPort = flowEntryObj.getMatchSrcTcpUdpPort();
171 if (matchSrcTcpUdpPort != null)
172 match.enableSrcTcpUdpPort(matchSrcTcpUdpPort);
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700173 //
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700174 Short matchDstTcpUdpPort = flowEntryObj.getMatchDstTcpUdpPort();
175 if (matchDstTcpUdpPort != null)
176 match.enableDstTcpUdpPort(matchDstTcpUdpPort);
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700177 //
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700178 flowEntry.setFlowEntryMatch(match);
179
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700180 //
181 // Extract the actions
182 //
183 {
184 FlowEntryActions actions = new FlowEntryActions();
185
HIGUCHI Yuta6fa39512013-08-04 06:00:47 +0900186 String actionsStr = flowEntryObj.getActions();
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700187 if (actions != null)
188 actions = new FlowEntryActions(actionsStr);
189
190 flowEntry.setFlowEntryActions(actions);
191 }
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700192
193 String userState = flowEntryObj.getUserState();
194 flowEntry.setFlowEntryUserState(FlowEntryUserState.valueOf(userState));
195 String switchState = flowEntryObj.getSwitchState();
196 flowEntry.setFlowEntrySwitchState(FlowEntrySwitchState.valueOf(switchState));
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700197 //
198 // TODO: Take care of the FlowEntryErrorState.
199 //
Pankaj Berde6a97eb82013-03-28 12:12:43 -0700200 this.dataPath().flowEntries().add(flowEntry);
201 }
202 }
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800203
204 /**
205 * Get the flow path Flow ID.
206 *
207 * @return the flow path Flow ID.
208 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800209 @JsonProperty("flowId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800210 public FlowId flowId() { return flowId; }
211
212 /**
213 * Set the flow path Flow ID.
214 *
215 * @param flowId the flow path Flow ID to set.
216 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800217 @JsonProperty("flowId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800218 public void setFlowId(FlowId flowId) {
219 this.flowId = flowId;
220 }
221
222 /**
Pavlin Radoslavov892dd182013-12-05 23:33:15 -0800223 * Test whether the Flow ID is valid.
224 *
225 * @return true if the Flow ID is valid, otherwise false.
226 */
227 @JsonIgnore
228 public boolean isValidFlowId() {
229 if (this.flowId == null)
230 return false;
231 return (this.flowId.isValid());
232 }
233
234 /**
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800235 * Get the Caller ID of the flow path installer.
236 *
237 * @return the Caller ID of the flow path installer.
238 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800239 @JsonProperty("installerId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800240 public CallerId installerId() { return installerId; }
241
242 /**
243 * Set the Caller ID of the flow path installer.
244 *
245 * @param installerId the Caller ID of the flow path installer.
246 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800247 @JsonProperty("installerId")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800248 public void setInstallerId(CallerId installerId) {
249 this.installerId = installerId;
250 }
251
252 /**
Pavlin Radoslavovd28cf7c2013-10-26 11:27:43 -0700253 * Get the flow path type.
254 *
255 * @return the flow path type.
256 */
257 @JsonProperty("flowPathType")
258 public FlowPathType flowPathType() { return flowPathType; }
259
260 /**
261 * Set the flow path type.
262 *
263 * @param flowPathType the flow path type to set.
264 */
265 @JsonProperty("flowPathType")
266 public void setFlowPathType(FlowPathType flowPathType) {
267 this.flowPathType = flowPathType;
268 }
269
270 /**
Pavlin Radoslavov7d4a40e2013-10-27 23:39:40 -0700271 * Get the flow path user state.
272 *
273 * @return the flow path user state.
274 */
275 @JsonProperty("flowPathUserState")
276 public FlowPathUserState flowPathUserState() { return flowPathUserState; }
277
278 /**
279 * Set the flow path user state.
280 *
281 * @param flowPathUserState the flow path user state to set.
282 */
283 @JsonProperty("flowPathUserState")
284 public void setFlowPathUserState(FlowPathUserState flowPathUserState) {
285 this.flowPathUserState = flowPathUserState;
286 }
287
288 /**
Pavlin Radoslavov204b2862013-07-12 14:15:36 -0700289 * Get the flow path flags.
290 *
291 * @return the flow path flags.
292 */
293 @JsonProperty("flowPathFlags")
294 public FlowPathFlags flowPathFlags() { return flowPathFlags; }
295
296 /**
297 * Set the flow path flags.
298 *
299 * @param flowPathFlags the flow path flags to set.
300 */
301 @JsonProperty("flowPathFlags")
302 public void setFlowPathFlags(FlowPathFlags flowPathFlags) {
303 this.flowPathFlags = flowPathFlags;
304 }
305
306 /**
Pavlin Radoslavov5139c0b2013-12-09 18:04:53 -0800307 * Get the flow idle timeout in seconds.
308 *
309 * It should be an unsigned integer in the interval [0, 65535].
310 * If zero, the timeout is not set.
311 *
312 * @return the flow idle timeout.
313 */
314 @JsonProperty("idleTimeout")
315 public int idleTimeout() { return idleTimeout; }
316
317 /**
318 * Set the flow idle timeout in seconds.
319 *
320 * It should be an unsigned integer in the interval [0, 65535].
321 * If zero, the timeout is not set.
322 *
323 * @param idleTimeout the flow idle timeout to set.
324 */
325 @JsonProperty("idleTimeout")
326 public void setIdleTimeout(int idleTimeout) {
327 this.idleTimeout = 0xffff & idleTimeout;
328 }
329
330 /**
331 * Get the flow hard timeout in seconds.
332 *
333 * It should be an unsigned integer in the interval [0, 65535].
334 * If zero, the timeout is not set.
335 *
336 * @return the flow hard timeout.
337 */
338 @JsonProperty("hardTimeout")
339 public int hardTimeout() { return hardTimeout; }
340
341 /**
342 * Set the flow hard timeout.
343 *
344 * It should be an unsigned integer in the interval [0, 65535].
345 * If zero, the timeout is not set.
346 *
347 * @param hardTimeout the flow hard timeout to set.
348 */
349 @JsonProperty("hardTimeout")
350 public void setHardTimeout(int hardTimeout) {
351 this.hardTimeout = 0xffff & hardTimeout;
352 }
353
354 /**
Pavlin Radoslavovafbf1032014-02-04 10:37:52 -0800355 * Get the flow priority.
356 *
357 * It should be an unsigned integer in the interval [0, 65535].
358 *
359 * @return the flow priority.
360 */
361 @JsonProperty("priority")
362 public int priority() { return priority; }
363
364 /**
365 * Set the flow priority.
366 *
367 * It should be an unsigned integer in the interval [0, 65535].
368 *
369 * @param priority the flow priority to set.
370 */
371 @JsonProperty("priority")
372 public void setPriority(int priority) {
373 this.priority = 0xffff & priority;
374 }
375
376 /**
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800377 * Get the flow path's data path.
378 *
379 * @return the flow path's data path.
380 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800381 @JsonProperty("dataPath")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800382 public DataPath dataPath() { return dataPath; }
383
384 /**
385 * Set the flow path's data path.
386 *
387 * @param dataPath the flow path's data path to set.
388 */
Pavlin Radoslavov2013cbb2013-02-26 10:15:18 -0800389 @JsonProperty("dataPath")
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800390 public void setDataPath(DataPath dataPath) {
391 this.dataPath = dataPath;
392 }
393
394 /**
Pavlin Radoslavov27831be2013-10-28 23:40:29 -0700395 * Get the data path flow entries.
396 *
397 * @return the data path flow entries.
398 */
399 public ArrayList<FlowEntry> flowEntries() {
400 return this.dataPath.flowEntries();
401 }
402
403 /**
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700404 * Get the flow path's match conditions common for all Flow Entries.
405 *
406 * @return the flow path's match conditions common for all Flow Entries.
407 */
408 @JsonProperty("flowEntryMatch")
409 public FlowEntryMatch flowEntryMatch() { return flowEntryMatch; }
410
411 /**
412 * Set the flow path's match conditions common for all Flow Entries.
413 *
414 * @param flowEntryMatch the flow path's match conditions common for all
415 * Flow Entries.
416 */
417 @JsonProperty("flowEntryMatch")
418 public void setFlowEntryMatch(FlowEntryMatch flowEntryMatch) {
419 this.flowEntryMatch = flowEntryMatch;
420 }
421
422 /**
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700423 * Get the flow path's flow entry actions for the first Flow Entry.
424 *
425 * @return the flow path's flow entry actions for the first Flow Entry.
426 */
427 @JsonProperty("flowEntryActions")
428 public FlowEntryActions flowEntryActions() {
429 return flowEntryActions;
430 }
431
432 /**
433 * Set the flow path's flow entry actions for the first Flow Entry.
434 *
435 * @param flowEntryActions the flow path's flow entry actions for the first
436 * Flow Entry.
437 */
438 @JsonProperty("flowEntryActions")
439 public void setFlowEntryActions(FlowEntryActions flowEntryActions) {
440 this.flowEntryActions = flowEntryActions;
441 }
442
443 /**
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800444 * Convert the flow path to a string.
445 *
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -0800446 * The string has the following form:
Pavlin Radoslavov7d4a40e2013-10-27 23:39:40 -0700447 * [flowId=XXX installerId=XXX flowPathType = XXX flowPathUserState = XXX
Pavlin Radoslavovafbf1032014-02-04 10:37:52 -0800448 * flowPathFlags=XXX idleTimeout=XXX hardTimeout=XXX priority=XXX
449 * dataPath=XXX flowEntryMatch=XXX flowEntryActions=XXX]
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -0800450 *
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800451 * @return the flow path as a string.
452 */
453 @Override
454 public String toString() {
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -0800455 String ret = "[flowId=" + this.flowId.toString();
456 ret += " installerId=" + this.installerId.toString();
Pavlin Radoslavovd28cf7c2013-10-26 11:27:43 -0700457 ret += " flowPathType=" + this.flowPathType;
Pavlin Radoslavov7d4a40e2013-10-27 23:39:40 -0700458 ret += " flowPathUserState=" + this.flowPathUserState;
Pavlin Radoslavov204b2862013-07-12 14:15:36 -0700459 ret += " flowPathFlags=" + this.flowPathFlags.toString();
Pavlin Radoslavov5139c0b2013-12-09 18:04:53 -0800460 ret += " idleTimeout=" + this.idleTimeout;
461 ret += " hardTimeout=" + this.hardTimeout;
Pavlin Radoslavovafbf1032014-02-04 10:37:52 -0800462 ret += " priority=" + this.priority;
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700463 if (dataPath != null)
464 ret += " dataPath=" + this.dataPath.toString();
465 if (flowEntryMatch != null)
466 ret += " flowEntryMatch=" + this.flowEntryMatch.toString();
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700467 if (flowEntryActions != null)
468 ret += " flowEntryActions=" + this.flowEntryActions.toString();
Pavlin Radoslavova10a9a82013-02-22 11:47:54 -0800469 ret += "]";
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800470 return ret;
471 }
Umesh Krishnaswamy57a32a92013-03-21 14:21:15 -0700472
473 /**
474 * CompareTo method to order flowPath by Id
475 */
476 @Override
477 public int compareTo(FlowPath f) {
478 return (int) (this.flowId.value() - f.flowId.value());
479 }
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -0800480}