Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.intent; |
| 2 | |
| 3 | /** |
| 4 | * An object used by the application to specify an intent. |
| 5 | */ |
| 6 | public class ApplicationIntent { |
| 7 | private String intentId; // The Intent ID |
| 8 | private String intentType; // The Intent type |
| 9 | |
| 10 | // If true, don't update the path when topology changes |
| 11 | private boolean isStaticPath; |
| 12 | |
| 13 | private String srcSwitchDpid; // Flow Path Source Switch DPID |
| 14 | private int srcSwitchPort; // Flow Path Source Switch Port |
| 15 | private String dstSwitchDpid; // Flow Path Destination Switch DPID |
| 16 | private int dstSwitchPort; // Flow Path Destination Switch Port |
| 17 | private double bandwidth; // Bandwidth for Constrained Shortest Path |
| 18 | |
| 19 | // Matching Fields |
| 20 | private String matchSrcMac; // Matching source MAC address |
| 21 | private String matchDstMac; // Matching destination MAC address |
| 22 | |
| 23 | /** |
| 24 | * Gets the Intent ID. |
| 25 | * |
| 26 | * @return the Intent ID. |
| 27 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 28 | public String getIntentId() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 29 | return this.intentId; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Sets the Intent ID. |
| 34 | * |
| 35 | * @param intentId the Intent ID to set. |
| 36 | */ |
| 37 | public void setIntentId(String intentId) { |
| 38 | this.intentId = intentId; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Gets the Intent type. |
| 43 | * |
| 44 | * Currently, the following strings are recognized: |
| 45 | * - "SHORTEST_PATH" |
| 46 | * - "CONSTRAINED_SHORTEST_PATH" |
| 47 | * |
| 48 | * @return the Intent type. |
| 49 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 50 | public String getIntentType() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 51 | return this.intentType; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Sets the Intent type. |
| 56 | * |
| 57 | * Currently, the following strings are recognized: |
| 58 | * - "SHORTEST_PATH" |
| 59 | * - "CONSTRAINED_SHORTEST_PATH" |
| 60 | * |
| 61 | * @param intentType the Intent type to set. |
| 62 | */ |
| 63 | public void setIntentType(String intentType) { |
| 64 | this.intentType = intentType; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Gets the "staticPath" flag for the intent. |
| 69 | * |
| 70 | * A path for an intent is defined as "static" if it shouldn't be updated |
| 71 | * when the topology changes. |
| 72 | * |
| 73 | * @return true if the intent path is static, otherwise false. |
| 74 | */ |
| 75 | public boolean isStaticPath() { |
| 76 | return this.isStaticPath; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Sets the "staticPath" flag for the intent. |
| 81 | * |
| 82 | * A path for an intent is defined as "static" if it shouldn't be updated |
| 83 | * when the topology changes. |
| 84 | * |
| 85 | * @param staticPath true if the intent path is static, otherwise false. |
| 86 | */ |
| 87 | public void setStaticPath(boolean staticPath) { |
| 88 | this.isStaticPath = staticPath; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Gets the Source Switch DPID. |
| 93 | * |
| 94 | * @return the Source Switch DPID. |
| 95 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 96 | public String getSrcSwitchDpid() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 97 | return this.srcSwitchDpid; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Sets the Source Switch DPID. |
| 102 | * |
| 103 | * @param srcSwitchDpid the Source Switch DPID to set. |
| 104 | */ |
| 105 | public void setSrcSwitchDpid(String srcSwitchDpid) { |
| 106 | this.srcSwitchDpid = srcSwitchDpid; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Gets the Source Switch Port. |
| 111 | * |
| 112 | * @return the Source Switch Port. |
| 113 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 114 | public int getSrcSwitchPort() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 115 | return this.srcSwitchPort; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Sets the Source Switch Port. |
| 120 | * |
| 121 | * @param srcSwitchPort the Source Switch Port to set. |
| 122 | */ |
| 123 | public void setSrcSwitchPort(int srcSwitchPort) { |
| 124 | this.srcSwitchPort = srcSwitchPort; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Gets the Destination Switch DPID. |
| 129 | * |
| 130 | * @return the Destination Switch DPID. |
| 131 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 132 | public String getDstSwitchDpid() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 133 | return this.dstSwitchDpid; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Sets the Destination Switch DPID. |
| 138 | * |
| 139 | * @param dstSwitchDpid the Destination Switch DPID to set. |
| 140 | */ |
| 141 | public void setDstSwitchDpid(String dstSwitchDpid) { |
| 142 | this.dstSwitchDpid = dstSwitchDpid; |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Gets the Destination Switch Port. |
| 147 | * |
| 148 | * @return the Destination Switch Port. |
| 149 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 150 | public int getDstSwitchPort() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 151 | return this.dstSwitchPort; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Sets the Destination Switch Port. |
| 156 | * |
| 157 | * @param dstSwitchPort the Destination Switch Port to set. |
| 158 | */ |
| 159 | public void setDstSwitchPort(int dstSwitchPort) { |
| 160 | this.dstSwitchPort = dstSwitchPort; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Gets the bandwidth for Constrained Shortest Path. |
| 165 | * |
| 166 | * @return the bandwidth for Constrained Shortest Path. |
| 167 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 168 | public double getBandwidth() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 169 | return this.bandwidth; |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Sets the bandwidth for Constrained Shortest Path. |
| 174 | * |
| 175 | * @param bandwidth the bandwidth for Constrained Shortest Path |
| 176 | */ |
| 177 | public void setBandwidth(double bandwidth) { |
| 178 | this.bandwidth = bandwidth; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * Gets the matching source MAC address. |
| 183 | * |
| 184 | * @return the matching source MAC address. |
| 185 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 186 | public String getMatchSrcMac() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 187 | return this.matchSrcMac; |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Sets the matching source MAC address. |
| 192 | * |
| 193 | * @param matchSrcMac the matching source MAC address to set. |
| 194 | */ |
| 195 | public void setMatchSrcMac(String matchSrcMac) { |
| 196 | this.matchSrcMac = matchSrcMac; |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Gets the matching destination MAC address. |
| 201 | * |
| 202 | * @return the matching destination MAC address. |
| 203 | */ |
Pavlin Radoslavov | 954e082 | 2014-06-24 12:59:44 -0700 | [diff] [blame] | 204 | public String getMatchDstMac() { |
Pavlin Radoslavov | 1366905 | 2014-05-13 10:33:39 -0700 | [diff] [blame] | 205 | return this.matchDstMac; |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * Sets the matching destination MAC address. |
| 210 | * |
| 211 | * @param matchDstMac the matching destination MAC address to set. |
| 212 | */ |
| 213 | public void setMatchDstMac(String matchDstMac) { |
| 214 | this.matchDstMac = matchDstMac; |
| 215 | } |
| 216 | } |