alshabib | 86ac11c | 2014-08-14 16:14:41 -0700 | [diff] [blame] | 1 | // Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 2 | // Copyright (c) 2011, 2012 Open Networking Foundation |
| 3 | // Copyright (c) 2012, 2013 Big Switch Networks, Inc. |
| 4 | // This library was generated by the LoxiGen Compiler. |
| 5 | // See the file LICENSE.txt which should have been included in the source distribution |
| 6 | |
| 7 | // Automatically generated by LOXI from template of_class.java |
| 8 | // Do not modify |
| 9 | |
| 10 | package org.projectfloodlight.openflow.protocol.ver13; |
| 11 | |
| 12 | import org.projectfloodlight.openflow.protocol.*; |
| 13 | import org.projectfloodlight.openflow.protocol.action.*; |
| 14 | import org.projectfloodlight.openflow.protocol.actionid.*; |
| 15 | import org.projectfloodlight.openflow.protocol.bsntlv.*; |
| 16 | import org.projectfloodlight.openflow.protocol.errormsg.*; |
| 17 | import org.projectfloodlight.openflow.protocol.meterband.*; |
| 18 | import org.projectfloodlight.openflow.protocol.instruction.*; |
| 19 | import org.projectfloodlight.openflow.protocol.instructionid.*; |
| 20 | import org.projectfloodlight.openflow.protocol.match.*; |
| 21 | import org.projectfloodlight.openflow.protocol.oxm.*; |
| 22 | import org.projectfloodlight.openflow.protocol.queueprop.*; |
| 23 | import org.projectfloodlight.openflow.types.*; |
| 24 | import org.projectfloodlight.openflow.util.*; |
| 25 | import org.projectfloodlight.openflow.exceptions.*; |
| 26 | import org.slf4j.Logger; |
| 27 | import org.slf4j.LoggerFactory; |
| 28 | import java.util.Set; |
| 29 | import org.jboss.netty.buffer.ChannelBuffer; |
| 30 | import com.google.common.hash.PrimitiveSink; |
| 31 | import com.google.common.hash.Funnel; |
| 32 | |
| 33 | class OFBsnLacpStatsEntryVer13 implements OFBsnLacpStatsEntry { |
| 34 | private static final Logger logger = LoggerFactory.getLogger(OFBsnLacpStatsEntryVer13.class); |
| 35 | // version: 1.3 |
| 36 | final static byte WIRE_VERSION = 4; |
| 37 | final static int LENGTH = 36; |
| 38 | |
| 39 | private final static OFPort DEFAULT_PORT_NO = OFPort.ANY; |
| 40 | private final static int DEFAULT_ACTOR_SYS_PRIORITY = 0x0; |
| 41 | private final static MacAddress DEFAULT_ACTOR_SYS_MAC = MacAddress.NONE; |
| 42 | private final static int DEFAULT_ACTOR_PORT_PRIORITY = 0x0; |
| 43 | private final static int DEFAULT_ACTOR_PORT_NUM = 0x0; |
| 44 | private final static int DEFAULT_ACTOR_KEY = 0x0; |
| 45 | private final static short DEFAULT_CONVERGENCE_STATUS = (short) 0x0; |
| 46 | private final static int DEFAULT_PARTNER_SYS_PRIORITY = 0x0; |
| 47 | private final static MacAddress DEFAULT_PARTNER_SYS_MAC = MacAddress.NONE; |
| 48 | private final static int DEFAULT_PARTNER_PORT_PRIORITY = 0x0; |
| 49 | private final static int DEFAULT_PARTNER_PORT_NUM = 0x0; |
| 50 | private final static int DEFAULT_PARTNER_KEY = 0x0; |
| 51 | |
| 52 | // OF message fields |
| 53 | private final OFPort portNo; |
| 54 | private final int actorSysPriority; |
| 55 | private final MacAddress actorSysMac; |
| 56 | private final int actorPortPriority; |
| 57 | private final int actorPortNum; |
| 58 | private final int actorKey; |
| 59 | private final short convergenceStatus; |
| 60 | private final int partnerSysPriority; |
| 61 | private final MacAddress partnerSysMac; |
| 62 | private final int partnerPortPriority; |
| 63 | private final int partnerPortNum; |
| 64 | private final int partnerKey; |
| 65 | // |
| 66 | // Immutable default instance |
| 67 | final static OFBsnLacpStatsEntryVer13 DEFAULT = new OFBsnLacpStatsEntryVer13( |
| 68 | DEFAULT_PORT_NO, DEFAULT_ACTOR_SYS_PRIORITY, DEFAULT_ACTOR_SYS_MAC, DEFAULT_ACTOR_PORT_PRIORITY, DEFAULT_ACTOR_PORT_NUM, DEFAULT_ACTOR_KEY, DEFAULT_CONVERGENCE_STATUS, DEFAULT_PARTNER_SYS_PRIORITY, DEFAULT_PARTNER_SYS_MAC, DEFAULT_PARTNER_PORT_PRIORITY, DEFAULT_PARTNER_PORT_NUM, DEFAULT_PARTNER_KEY |
| 69 | ); |
| 70 | |
| 71 | // package private constructor - used by readers, builders, and factory |
| 72 | OFBsnLacpStatsEntryVer13(OFPort portNo, int actorSysPriority, MacAddress actorSysMac, int actorPortPriority, int actorPortNum, int actorKey, short convergenceStatus, int partnerSysPriority, MacAddress partnerSysMac, int partnerPortPriority, int partnerPortNum, int partnerKey) { |
| 73 | this.portNo = portNo; |
| 74 | this.actorSysPriority = actorSysPriority; |
| 75 | this.actorSysMac = actorSysMac; |
| 76 | this.actorPortPriority = actorPortPriority; |
| 77 | this.actorPortNum = actorPortNum; |
| 78 | this.actorKey = actorKey; |
| 79 | this.convergenceStatus = convergenceStatus; |
| 80 | this.partnerSysPriority = partnerSysPriority; |
| 81 | this.partnerSysMac = partnerSysMac; |
| 82 | this.partnerPortPriority = partnerPortPriority; |
| 83 | this.partnerPortNum = partnerPortNum; |
| 84 | this.partnerKey = partnerKey; |
| 85 | } |
| 86 | |
| 87 | // Accessors for OF message fields |
| 88 | @Override |
| 89 | public OFPort getPortNo() { |
| 90 | return portNo; |
| 91 | } |
| 92 | |
| 93 | @Override |
| 94 | public int getActorSysPriority() { |
| 95 | return actorSysPriority; |
| 96 | } |
| 97 | |
| 98 | @Override |
| 99 | public MacAddress getActorSysMac() { |
| 100 | return actorSysMac; |
| 101 | } |
| 102 | |
| 103 | @Override |
| 104 | public int getActorPortPriority() { |
| 105 | return actorPortPriority; |
| 106 | } |
| 107 | |
| 108 | @Override |
| 109 | public int getActorPortNum() { |
| 110 | return actorPortNum; |
| 111 | } |
| 112 | |
| 113 | @Override |
| 114 | public int getActorKey() { |
| 115 | return actorKey; |
| 116 | } |
| 117 | |
| 118 | @Override |
| 119 | public short getConvergenceStatus() { |
| 120 | return convergenceStatus; |
| 121 | } |
| 122 | |
| 123 | @Override |
| 124 | public int getPartnerSysPriority() { |
| 125 | return partnerSysPriority; |
| 126 | } |
| 127 | |
| 128 | @Override |
| 129 | public MacAddress getPartnerSysMac() { |
| 130 | return partnerSysMac; |
| 131 | } |
| 132 | |
| 133 | @Override |
| 134 | public int getPartnerPortPriority() { |
| 135 | return partnerPortPriority; |
| 136 | } |
| 137 | |
| 138 | @Override |
| 139 | public int getPartnerPortNum() { |
| 140 | return partnerPortNum; |
| 141 | } |
| 142 | |
| 143 | @Override |
| 144 | public int getPartnerKey() { |
| 145 | return partnerKey; |
| 146 | } |
| 147 | |
| 148 | @Override |
| 149 | public OFVersion getVersion() { |
| 150 | return OFVersion.OF_13; |
| 151 | } |
| 152 | |
| 153 | |
| 154 | |
| 155 | public OFBsnLacpStatsEntry.Builder createBuilder() { |
| 156 | return new BuilderWithParent(this); |
| 157 | } |
| 158 | |
| 159 | static class BuilderWithParent implements OFBsnLacpStatsEntry.Builder { |
| 160 | final OFBsnLacpStatsEntryVer13 parentMessage; |
| 161 | |
| 162 | // OF message fields |
| 163 | private boolean portNoSet; |
| 164 | private OFPort portNo; |
| 165 | private boolean actorSysPrioritySet; |
| 166 | private int actorSysPriority; |
| 167 | private boolean actorSysMacSet; |
| 168 | private MacAddress actorSysMac; |
| 169 | private boolean actorPortPrioritySet; |
| 170 | private int actorPortPriority; |
| 171 | private boolean actorPortNumSet; |
| 172 | private int actorPortNum; |
| 173 | private boolean actorKeySet; |
| 174 | private int actorKey; |
| 175 | private boolean convergenceStatusSet; |
| 176 | private short convergenceStatus; |
| 177 | private boolean partnerSysPrioritySet; |
| 178 | private int partnerSysPriority; |
| 179 | private boolean partnerSysMacSet; |
| 180 | private MacAddress partnerSysMac; |
| 181 | private boolean partnerPortPrioritySet; |
| 182 | private int partnerPortPriority; |
| 183 | private boolean partnerPortNumSet; |
| 184 | private int partnerPortNum; |
| 185 | private boolean partnerKeySet; |
| 186 | private int partnerKey; |
| 187 | |
| 188 | BuilderWithParent(OFBsnLacpStatsEntryVer13 parentMessage) { |
| 189 | this.parentMessage = parentMessage; |
| 190 | } |
| 191 | |
| 192 | @Override |
| 193 | public OFPort getPortNo() { |
| 194 | return portNo; |
| 195 | } |
| 196 | |
| 197 | @Override |
| 198 | public OFBsnLacpStatsEntry.Builder setPortNo(OFPort portNo) { |
| 199 | this.portNo = portNo; |
| 200 | this.portNoSet = true; |
| 201 | return this; |
| 202 | } |
| 203 | @Override |
| 204 | public int getActorSysPriority() { |
| 205 | return actorSysPriority; |
| 206 | } |
| 207 | |
| 208 | @Override |
| 209 | public OFBsnLacpStatsEntry.Builder setActorSysPriority(int actorSysPriority) { |
| 210 | this.actorSysPriority = actorSysPriority; |
| 211 | this.actorSysPrioritySet = true; |
| 212 | return this; |
| 213 | } |
| 214 | @Override |
| 215 | public MacAddress getActorSysMac() { |
| 216 | return actorSysMac; |
| 217 | } |
| 218 | |
| 219 | @Override |
| 220 | public OFBsnLacpStatsEntry.Builder setActorSysMac(MacAddress actorSysMac) { |
| 221 | this.actorSysMac = actorSysMac; |
| 222 | this.actorSysMacSet = true; |
| 223 | return this; |
| 224 | } |
| 225 | @Override |
| 226 | public int getActorPortPriority() { |
| 227 | return actorPortPriority; |
| 228 | } |
| 229 | |
| 230 | @Override |
| 231 | public OFBsnLacpStatsEntry.Builder setActorPortPriority(int actorPortPriority) { |
| 232 | this.actorPortPriority = actorPortPriority; |
| 233 | this.actorPortPrioritySet = true; |
| 234 | return this; |
| 235 | } |
| 236 | @Override |
| 237 | public int getActorPortNum() { |
| 238 | return actorPortNum; |
| 239 | } |
| 240 | |
| 241 | @Override |
| 242 | public OFBsnLacpStatsEntry.Builder setActorPortNum(int actorPortNum) { |
| 243 | this.actorPortNum = actorPortNum; |
| 244 | this.actorPortNumSet = true; |
| 245 | return this; |
| 246 | } |
| 247 | @Override |
| 248 | public int getActorKey() { |
| 249 | return actorKey; |
| 250 | } |
| 251 | |
| 252 | @Override |
| 253 | public OFBsnLacpStatsEntry.Builder setActorKey(int actorKey) { |
| 254 | this.actorKey = actorKey; |
| 255 | this.actorKeySet = true; |
| 256 | return this; |
| 257 | } |
| 258 | @Override |
| 259 | public short getConvergenceStatus() { |
| 260 | return convergenceStatus; |
| 261 | } |
| 262 | |
| 263 | @Override |
| 264 | public OFBsnLacpStatsEntry.Builder setConvergenceStatus(short convergenceStatus) { |
| 265 | this.convergenceStatus = convergenceStatus; |
| 266 | this.convergenceStatusSet = true; |
| 267 | return this; |
| 268 | } |
| 269 | @Override |
| 270 | public int getPartnerSysPriority() { |
| 271 | return partnerSysPriority; |
| 272 | } |
| 273 | |
| 274 | @Override |
| 275 | public OFBsnLacpStatsEntry.Builder setPartnerSysPriority(int partnerSysPriority) { |
| 276 | this.partnerSysPriority = partnerSysPriority; |
| 277 | this.partnerSysPrioritySet = true; |
| 278 | return this; |
| 279 | } |
| 280 | @Override |
| 281 | public MacAddress getPartnerSysMac() { |
| 282 | return partnerSysMac; |
| 283 | } |
| 284 | |
| 285 | @Override |
| 286 | public OFBsnLacpStatsEntry.Builder setPartnerSysMac(MacAddress partnerSysMac) { |
| 287 | this.partnerSysMac = partnerSysMac; |
| 288 | this.partnerSysMacSet = true; |
| 289 | return this; |
| 290 | } |
| 291 | @Override |
| 292 | public int getPartnerPortPriority() { |
| 293 | return partnerPortPriority; |
| 294 | } |
| 295 | |
| 296 | @Override |
| 297 | public OFBsnLacpStatsEntry.Builder setPartnerPortPriority(int partnerPortPriority) { |
| 298 | this.partnerPortPriority = partnerPortPriority; |
| 299 | this.partnerPortPrioritySet = true; |
| 300 | return this; |
| 301 | } |
| 302 | @Override |
| 303 | public int getPartnerPortNum() { |
| 304 | return partnerPortNum; |
| 305 | } |
| 306 | |
| 307 | @Override |
| 308 | public OFBsnLacpStatsEntry.Builder setPartnerPortNum(int partnerPortNum) { |
| 309 | this.partnerPortNum = partnerPortNum; |
| 310 | this.partnerPortNumSet = true; |
| 311 | return this; |
| 312 | } |
| 313 | @Override |
| 314 | public int getPartnerKey() { |
| 315 | return partnerKey; |
| 316 | } |
| 317 | |
| 318 | @Override |
| 319 | public OFBsnLacpStatsEntry.Builder setPartnerKey(int partnerKey) { |
| 320 | this.partnerKey = partnerKey; |
| 321 | this.partnerKeySet = true; |
| 322 | return this; |
| 323 | } |
| 324 | @Override |
| 325 | public OFVersion getVersion() { |
| 326 | return OFVersion.OF_13; |
| 327 | } |
| 328 | |
| 329 | |
| 330 | |
| 331 | @Override |
| 332 | public OFBsnLacpStatsEntry build() { |
| 333 | OFPort portNo = this.portNoSet ? this.portNo : parentMessage.portNo; |
| 334 | if(portNo == null) |
| 335 | throw new NullPointerException("Property portNo must not be null"); |
| 336 | int actorSysPriority = this.actorSysPrioritySet ? this.actorSysPriority : parentMessage.actorSysPriority; |
| 337 | MacAddress actorSysMac = this.actorSysMacSet ? this.actorSysMac : parentMessage.actorSysMac; |
| 338 | if(actorSysMac == null) |
| 339 | throw new NullPointerException("Property actorSysMac must not be null"); |
| 340 | int actorPortPriority = this.actorPortPrioritySet ? this.actorPortPriority : parentMessage.actorPortPriority; |
| 341 | int actorPortNum = this.actorPortNumSet ? this.actorPortNum : parentMessage.actorPortNum; |
| 342 | int actorKey = this.actorKeySet ? this.actorKey : parentMessage.actorKey; |
| 343 | short convergenceStatus = this.convergenceStatusSet ? this.convergenceStatus : parentMessage.convergenceStatus; |
| 344 | int partnerSysPriority = this.partnerSysPrioritySet ? this.partnerSysPriority : parentMessage.partnerSysPriority; |
| 345 | MacAddress partnerSysMac = this.partnerSysMacSet ? this.partnerSysMac : parentMessage.partnerSysMac; |
| 346 | if(partnerSysMac == null) |
| 347 | throw new NullPointerException("Property partnerSysMac must not be null"); |
| 348 | int partnerPortPriority = this.partnerPortPrioritySet ? this.partnerPortPriority : parentMessage.partnerPortPriority; |
| 349 | int partnerPortNum = this.partnerPortNumSet ? this.partnerPortNum : parentMessage.partnerPortNum; |
| 350 | int partnerKey = this.partnerKeySet ? this.partnerKey : parentMessage.partnerKey; |
| 351 | |
| 352 | // |
| 353 | return new OFBsnLacpStatsEntryVer13( |
| 354 | portNo, |
| 355 | actorSysPriority, |
| 356 | actorSysMac, |
| 357 | actorPortPriority, |
| 358 | actorPortNum, |
| 359 | actorKey, |
| 360 | convergenceStatus, |
| 361 | partnerSysPriority, |
| 362 | partnerSysMac, |
| 363 | partnerPortPriority, |
| 364 | partnerPortNum, |
| 365 | partnerKey |
| 366 | ); |
| 367 | } |
| 368 | |
| 369 | } |
| 370 | |
| 371 | static class Builder implements OFBsnLacpStatsEntry.Builder { |
| 372 | // OF message fields |
| 373 | private boolean portNoSet; |
| 374 | private OFPort portNo; |
| 375 | private boolean actorSysPrioritySet; |
| 376 | private int actorSysPriority; |
| 377 | private boolean actorSysMacSet; |
| 378 | private MacAddress actorSysMac; |
| 379 | private boolean actorPortPrioritySet; |
| 380 | private int actorPortPriority; |
| 381 | private boolean actorPortNumSet; |
| 382 | private int actorPortNum; |
| 383 | private boolean actorKeySet; |
| 384 | private int actorKey; |
| 385 | private boolean convergenceStatusSet; |
| 386 | private short convergenceStatus; |
| 387 | private boolean partnerSysPrioritySet; |
| 388 | private int partnerSysPriority; |
| 389 | private boolean partnerSysMacSet; |
| 390 | private MacAddress partnerSysMac; |
| 391 | private boolean partnerPortPrioritySet; |
| 392 | private int partnerPortPriority; |
| 393 | private boolean partnerPortNumSet; |
| 394 | private int partnerPortNum; |
| 395 | private boolean partnerKeySet; |
| 396 | private int partnerKey; |
| 397 | |
| 398 | @Override |
| 399 | public OFPort getPortNo() { |
| 400 | return portNo; |
| 401 | } |
| 402 | |
| 403 | @Override |
| 404 | public OFBsnLacpStatsEntry.Builder setPortNo(OFPort portNo) { |
| 405 | this.portNo = portNo; |
| 406 | this.portNoSet = true; |
| 407 | return this; |
| 408 | } |
| 409 | @Override |
| 410 | public int getActorSysPriority() { |
| 411 | return actorSysPriority; |
| 412 | } |
| 413 | |
| 414 | @Override |
| 415 | public OFBsnLacpStatsEntry.Builder setActorSysPriority(int actorSysPriority) { |
| 416 | this.actorSysPriority = actorSysPriority; |
| 417 | this.actorSysPrioritySet = true; |
| 418 | return this; |
| 419 | } |
| 420 | @Override |
| 421 | public MacAddress getActorSysMac() { |
| 422 | return actorSysMac; |
| 423 | } |
| 424 | |
| 425 | @Override |
| 426 | public OFBsnLacpStatsEntry.Builder setActorSysMac(MacAddress actorSysMac) { |
| 427 | this.actorSysMac = actorSysMac; |
| 428 | this.actorSysMacSet = true; |
| 429 | return this; |
| 430 | } |
| 431 | @Override |
| 432 | public int getActorPortPriority() { |
| 433 | return actorPortPriority; |
| 434 | } |
| 435 | |
| 436 | @Override |
| 437 | public OFBsnLacpStatsEntry.Builder setActorPortPriority(int actorPortPriority) { |
| 438 | this.actorPortPriority = actorPortPriority; |
| 439 | this.actorPortPrioritySet = true; |
| 440 | return this; |
| 441 | } |
| 442 | @Override |
| 443 | public int getActorPortNum() { |
| 444 | return actorPortNum; |
| 445 | } |
| 446 | |
| 447 | @Override |
| 448 | public OFBsnLacpStatsEntry.Builder setActorPortNum(int actorPortNum) { |
| 449 | this.actorPortNum = actorPortNum; |
| 450 | this.actorPortNumSet = true; |
| 451 | return this; |
| 452 | } |
| 453 | @Override |
| 454 | public int getActorKey() { |
| 455 | return actorKey; |
| 456 | } |
| 457 | |
| 458 | @Override |
| 459 | public OFBsnLacpStatsEntry.Builder setActorKey(int actorKey) { |
| 460 | this.actorKey = actorKey; |
| 461 | this.actorKeySet = true; |
| 462 | return this; |
| 463 | } |
| 464 | @Override |
| 465 | public short getConvergenceStatus() { |
| 466 | return convergenceStatus; |
| 467 | } |
| 468 | |
| 469 | @Override |
| 470 | public OFBsnLacpStatsEntry.Builder setConvergenceStatus(short convergenceStatus) { |
| 471 | this.convergenceStatus = convergenceStatus; |
| 472 | this.convergenceStatusSet = true; |
| 473 | return this; |
| 474 | } |
| 475 | @Override |
| 476 | public int getPartnerSysPriority() { |
| 477 | return partnerSysPriority; |
| 478 | } |
| 479 | |
| 480 | @Override |
| 481 | public OFBsnLacpStatsEntry.Builder setPartnerSysPriority(int partnerSysPriority) { |
| 482 | this.partnerSysPriority = partnerSysPriority; |
| 483 | this.partnerSysPrioritySet = true; |
| 484 | return this; |
| 485 | } |
| 486 | @Override |
| 487 | public MacAddress getPartnerSysMac() { |
| 488 | return partnerSysMac; |
| 489 | } |
| 490 | |
| 491 | @Override |
| 492 | public OFBsnLacpStatsEntry.Builder setPartnerSysMac(MacAddress partnerSysMac) { |
| 493 | this.partnerSysMac = partnerSysMac; |
| 494 | this.partnerSysMacSet = true; |
| 495 | return this; |
| 496 | } |
| 497 | @Override |
| 498 | public int getPartnerPortPriority() { |
| 499 | return partnerPortPriority; |
| 500 | } |
| 501 | |
| 502 | @Override |
| 503 | public OFBsnLacpStatsEntry.Builder setPartnerPortPriority(int partnerPortPriority) { |
| 504 | this.partnerPortPriority = partnerPortPriority; |
| 505 | this.partnerPortPrioritySet = true; |
| 506 | return this; |
| 507 | } |
| 508 | @Override |
| 509 | public int getPartnerPortNum() { |
| 510 | return partnerPortNum; |
| 511 | } |
| 512 | |
| 513 | @Override |
| 514 | public OFBsnLacpStatsEntry.Builder setPartnerPortNum(int partnerPortNum) { |
| 515 | this.partnerPortNum = partnerPortNum; |
| 516 | this.partnerPortNumSet = true; |
| 517 | return this; |
| 518 | } |
| 519 | @Override |
| 520 | public int getPartnerKey() { |
| 521 | return partnerKey; |
| 522 | } |
| 523 | |
| 524 | @Override |
| 525 | public OFBsnLacpStatsEntry.Builder setPartnerKey(int partnerKey) { |
| 526 | this.partnerKey = partnerKey; |
| 527 | this.partnerKeySet = true; |
| 528 | return this; |
| 529 | } |
| 530 | @Override |
| 531 | public OFVersion getVersion() { |
| 532 | return OFVersion.OF_13; |
| 533 | } |
| 534 | |
| 535 | // |
| 536 | @Override |
| 537 | public OFBsnLacpStatsEntry build() { |
| 538 | OFPort portNo = this.portNoSet ? this.portNo : DEFAULT_PORT_NO; |
| 539 | if(portNo == null) |
| 540 | throw new NullPointerException("Property portNo must not be null"); |
| 541 | int actorSysPriority = this.actorSysPrioritySet ? this.actorSysPriority : DEFAULT_ACTOR_SYS_PRIORITY; |
| 542 | MacAddress actorSysMac = this.actorSysMacSet ? this.actorSysMac : DEFAULT_ACTOR_SYS_MAC; |
| 543 | if(actorSysMac == null) |
| 544 | throw new NullPointerException("Property actorSysMac must not be null"); |
| 545 | int actorPortPriority = this.actorPortPrioritySet ? this.actorPortPriority : DEFAULT_ACTOR_PORT_PRIORITY; |
| 546 | int actorPortNum = this.actorPortNumSet ? this.actorPortNum : DEFAULT_ACTOR_PORT_NUM; |
| 547 | int actorKey = this.actorKeySet ? this.actorKey : DEFAULT_ACTOR_KEY; |
| 548 | short convergenceStatus = this.convergenceStatusSet ? this.convergenceStatus : DEFAULT_CONVERGENCE_STATUS; |
| 549 | int partnerSysPriority = this.partnerSysPrioritySet ? this.partnerSysPriority : DEFAULT_PARTNER_SYS_PRIORITY; |
| 550 | MacAddress partnerSysMac = this.partnerSysMacSet ? this.partnerSysMac : DEFAULT_PARTNER_SYS_MAC; |
| 551 | if(partnerSysMac == null) |
| 552 | throw new NullPointerException("Property partnerSysMac must not be null"); |
| 553 | int partnerPortPriority = this.partnerPortPrioritySet ? this.partnerPortPriority : DEFAULT_PARTNER_PORT_PRIORITY; |
| 554 | int partnerPortNum = this.partnerPortNumSet ? this.partnerPortNum : DEFAULT_PARTNER_PORT_NUM; |
| 555 | int partnerKey = this.partnerKeySet ? this.partnerKey : DEFAULT_PARTNER_KEY; |
| 556 | |
| 557 | |
| 558 | return new OFBsnLacpStatsEntryVer13( |
| 559 | portNo, |
| 560 | actorSysPriority, |
| 561 | actorSysMac, |
| 562 | actorPortPriority, |
| 563 | actorPortNum, |
| 564 | actorKey, |
| 565 | convergenceStatus, |
| 566 | partnerSysPriority, |
| 567 | partnerSysMac, |
| 568 | partnerPortPriority, |
| 569 | partnerPortNum, |
| 570 | partnerKey |
| 571 | ); |
| 572 | } |
| 573 | |
| 574 | } |
| 575 | |
| 576 | |
| 577 | final static Reader READER = new Reader(); |
| 578 | static class Reader implements OFMessageReader<OFBsnLacpStatsEntry> { |
| 579 | @Override |
| 580 | public OFBsnLacpStatsEntry readFrom(ChannelBuffer bb) throws OFParseError { |
| 581 | OFPort portNo = OFPort.read4Bytes(bb); |
| 582 | int actorSysPriority = U16.f(bb.readShort()); |
| 583 | MacAddress actorSysMac = MacAddress.read6Bytes(bb); |
| 584 | int actorPortPriority = U16.f(bb.readShort()); |
| 585 | int actorPortNum = U16.f(bb.readShort()); |
| 586 | int actorKey = U16.f(bb.readShort()); |
| 587 | short convergenceStatus = U8.f(bb.readByte()); |
| 588 | // pad: 1 bytes |
| 589 | bb.skipBytes(1); |
| 590 | int partnerSysPriority = U16.f(bb.readShort()); |
| 591 | MacAddress partnerSysMac = MacAddress.read6Bytes(bb); |
| 592 | int partnerPortPriority = U16.f(bb.readShort()); |
| 593 | int partnerPortNum = U16.f(bb.readShort()); |
| 594 | int partnerKey = U16.f(bb.readShort()); |
| 595 | // pad: 2 bytes |
| 596 | bb.skipBytes(2); |
| 597 | |
| 598 | OFBsnLacpStatsEntryVer13 bsnLacpStatsEntryVer13 = new OFBsnLacpStatsEntryVer13( |
| 599 | portNo, |
| 600 | actorSysPriority, |
| 601 | actorSysMac, |
| 602 | actorPortPriority, |
| 603 | actorPortNum, |
| 604 | actorKey, |
| 605 | convergenceStatus, |
| 606 | partnerSysPriority, |
| 607 | partnerSysMac, |
| 608 | partnerPortPriority, |
| 609 | partnerPortNum, |
| 610 | partnerKey |
| 611 | ); |
| 612 | if(logger.isTraceEnabled()) |
| 613 | logger.trace("readFrom - read={}", bsnLacpStatsEntryVer13); |
| 614 | return bsnLacpStatsEntryVer13; |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | public void putTo(PrimitiveSink sink) { |
| 619 | FUNNEL.funnel(this, sink); |
| 620 | } |
| 621 | |
| 622 | final static OFBsnLacpStatsEntryVer13Funnel FUNNEL = new OFBsnLacpStatsEntryVer13Funnel(); |
| 623 | static class OFBsnLacpStatsEntryVer13Funnel implements Funnel<OFBsnLacpStatsEntryVer13> { |
| 624 | private static final long serialVersionUID = 1L; |
| 625 | @Override |
| 626 | public void funnel(OFBsnLacpStatsEntryVer13 message, PrimitiveSink sink) { |
| 627 | message.portNo.putTo(sink); |
| 628 | sink.putInt(message.actorSysPriority); |
| 629 | message.actorSysMac.putTo(sink); |
| 630 | sink.putInt(message.actorPortPriority); |
| 631 | sink.putInt(message.actorPortNum); |
| 632 | sink.putInt(message.actorKey); |
| 633 | sink.putShort(message.convergenceStatus); |
| 634 | // skip pad (1 bytes) |
| 635 | sink.putInt(message.partnerSysPriority); |
| 636 | message.partnerSysMac.putTo(sink); |
| 637 | sink.putInt(message.partnerPortPriority); |
| 638 | sink.putInt(message.partnerPortNum); |
| 639 | sink.putInt(message.partnerKey); |
| 640 | // skip pad (2 bytes) |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | |
| 645 | public void writeTo(ChannelBuffer bb) { |
| 646 | WRITER.write(bb, this); |
| 647 | } |
| 648 | |
| 649 | final static Writer WRITER = new Writer(); |
| 650 | static class Writer implements OFMessageWriter<OFBsnLacpStatsEntryVer13> { |
| 651 | @Override |
| 652 | public void write(ChannelBuffer bb, OFBsnLacpStatsEntryVer13 message) { |
| 653 | message.portNo.write4Bytes(bb); |
| 654 | bb.writeShort(U16.t(message.actorSysPriority)); |
| 655 | message.actorSysMac.write6Bytes(bb); |
| 656 | bb.writeShort(U16.t(message.actorPortPriority)); |
| 657 | bb.writeShort(U16.t(message.actorPortNum)); |
| 658 | bb.writeShort(U16.t(message.actorKey)); |
| 659 | bb.writeByte(U8.t(message.convergenceStatus)); |
| 660 | // pad: 1 bytes |
| 661 | bb.writeZero(1); |
| 662 | bb.writeShort(U16.t(message.partnerSysPriority)); |
| 663 | message.partnerSysMac.write6Bytes(bb); |
| 664 | bb.writeShort(U16.t(message.partnerPortPriority)); |
| 665 | bb.writeShort(U16.t(message.partnerPortNum)); |
| 666 | bb.writeShort(U16.t(message.partnerKey)); |
| 667 | // pad: 2 bytes |
| 668 | bb.writeZero(2); |
| 669 | |
| 670 | |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | @Override |
| 675 | public String toString() { |
| 676 | StringBuilder b = new StringBuilder("OFBsnLacpStatsEntryVer13("); |
| 677 | b.append("portNo=").append(portNo); |
| 678 | b.append(", "); |
| 679 | b.append("actorSysPriority=").append(actorSysPriority); |
| 680 | b.append(", "); |
| 681 | b.append("actorSysMac=").append(actorSysMac); |
| 682 | b.append(", "); |
| 683 | b.append("actorPortPriority=").append(actorPortPriority); |
| 684 | b.append(", "); |
| 685 | b.append("actorPortNum=").append(actorPortNum); |
| 686 | b.append(", "); |
| 687 | b.append("actorKey=").append(actorKey); |
| 688 | b.append(", "); |
| 689 | b.append("convergenceStatus=").append(convergenceStatus); |
| 690 | b.append(", "); |
| 691 | b.append("partnerSysPriority=").append(partnerSysPriority); |
| 692 | b.append(", "); |
| 693 | b.append("partnerSysMac=").append(partnerSysMac); |
| 694 | b.append(", "); |
| 695 | b.append("partnerPortPriority=").append(partnerPortPriority); |
| 696 | b.append(", "); |
| 697 | b.append("partnerPortNum=").append(partnerPortNum); |
| 698 | b.append(", "); |
| 699 | b.append("partnerKey=").append(partnerKey); |
| 700 | b.append(")"); |
| 701 | return b.toString(); |
| 702 | } |
| 703 | |
| 704 | @Override |
| 705 | public boolean equals(Object obj) { |
| 706 | if (this == obj) |
| 707 | return true; |
| 708 | if (obj == null) |
| 709 | return false; |
| 710 | if (getClass() != obj.getClass()) |
| 711 | return false; |
| 712 | OFBsnLacpStatsEntryVer13 other = (OFBsnLacpStatsEntryVer13) obj; |
| 713 | |
| 714 | if (portNo == null) { |
| 715 | if (other.portNo != null) |
| 716 | return false; |
| 717 | } else if (!portNo.equals(other.portNo)) |
| 718 | return false; |
| 719 | if( actorSysPriority != other.actorSysPriority) |
| 720 | return false; |
| 721 | if (actorSysMac == null) { |
| 722 | if (other.actorSysMac != null) |
| 723 | return false; |
| 724 | } else if (!actorSysMac.equals(other.actorSysMac)) |
| 725 | return false; |
| 726 | if( actorPortPriority != other.actorPortPriority) |
| 727 | return false; |
| 728 | if( actorPortNum != other.actorPortNum) |
| 729 | return false; |
| 730 | if( actorKey != other.actorKey) |
| 731 | return false; |
| 732 | if( convergenceStatus != other.convergenceStatus) |
| 733 | return false; |
| 734 | if( partnerSysPriority != other.partnerSysPriority) |
| 735 | return false; |
| 736 | if (partnerSysMac == null) { |
| 737 | if (other.partnerSysMac != null) |
| 738 | return false; |
| 739 | } else if (!partnerSysMac.equals(other.partnerSysMac)) |
| 740 | return false; |
| 741 | if( partnerPortPriority != other.partnerPortPriority) |
| 742 | return false; |
| 743 | if( partnerPortNum != other.partnerPortNum) |
| 744 | return false; |
| 745 | if( partnerKey != other.partnerKey) |
| 746 | return false; |
| 747 | return true; |
| 748 | } |
| 749 | |
| 750 | @Override |
| 751 | public int hashCode() { |
| 752 | final int prime = 31; |
| 753 | int result = 1; |
| 754 | |
| 755 | result = prime * result + ((portNo == null) ? 0 : portNo.hashCode()); |
| 756 | result = prime * result + actorSysPriority; |
| 757 | result = prime * result + ((actorSysMac == null) ? 0 : actorSysMac.hashCode()); |
| 758 | result = prime * result + actorPortPriority; |
| 759 | result = prime * result + actorPortNum; |
| 760 | result = prime * result + actorKey; |
| 761 | result = prime * result + convergenceStatus; |
| 762 | result = prime * result + partnerSysPriority; |
| 763 | result = prime * result + ((partnerSysMac == null) ? 0 : partnerSysMac.hashCode()); |
| 764 | result = prime * result + partnerPortPriority; |
| 765 | result = prime * result + partnerPortNum; |
| 766 | result = prime * result + partnerKey; |
| 767 | return result; |
| 768 | } |
| 769 | |
| 770 | } |