blob: c1722fd8c56203f72cee435e474bac479491d8d3 [file] [log] [blame]
Jonathan Hartaa380972014-04-03 10:24:46 -07001package net.onrc.onos.core.intent;
Toshio Koidedf2eab92014-02-20 11:24:59 -08002
3/**
Ray Milkeyb41100a2014-04-10 10:42:15 -07004 * This class is instantiated by Run-times to express intent calculation error.
Ray Milkey269ffb92014-04-03 14:43:30 -07005 *
Toshio Koidedf2eab92014-02-20 11:24:59 -08006 * @author Toshio Koide (t-koide@onlab.us)
7 */
8public class ErrorIntent extends Intent {
Ray Milkey269ffb92014-04-03 14:43:30 -07009 public enum ErrorType {
10 UNSUPPORTED_INTENT,
11 SWITCH_NOT_FOUND,
12 PATH_NOT_FOUND,
13 }
Toshio Koidedf2eab92014-02-20 11:24:59 -080014
Ray Milkey269ffb92014-04-03 14:43:30 -070015 public ErrorType errorType;
16 public String message;
17 public Intent parentIntent;
Toshio Koidedf2eab92014-02-20 11:24:59 -080018
Ray Milkey269ffb92014-04-03 14:43:30 -070019 /**
Ray Milkeyb41100a2014-04-10 10:42:15 -070020 * Default constructor for Kryo deserialization.
Ray Milkey269ffb92014-04-03 14:43:30 -070021 */
22 protected ErrorIntent() {
23 }
Toshio Koidedf2eab92014-02-20 11:24:59 -080024
Ray Milkey269ffb92014-04-03 14:43:30 -070025 public ErrorIntent(ErrorType errorType, String message, Intent parentIntent) {
26 super(parentIntent.getId());
27 this.errorType = errorType;
28 this.message = message;
29 this.parentIntent = parentIntent;
30 }
Pavlin Radoslavov7fb16412014-04-11 18:45:19 -070031
32 @Override
33 public int hashCode() {
34 // TODO: Is this the intended behavior?
35 return (super.hashCode());
36 }
37
38 @Override
39 public boolean equals(Object obj) {
40 // TODO: Is this the intended behavior?
41 return (super.equals(obj));
42 }
Toshio Koidedf2eab92014-02-20 11:24:59 -080043}