tom | 0eb04ca | 2014-08-25 14:34:51 -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 com.google.common.collect.ImmutableSet; |
| 30 | import org.jboss.netty.buffer.ChannelBuffer; |
| 31 | import com.google.common.hash.PrimitiveSink; |
| 32 | import com.google.common.hash.Funnel; |
| 33 | |
| 34 | class OFGroupFeaturesStatsReplyVer13 implements OFGroupFeaturesStatsReply { |
| 35 | private static final Logger logger = LoggerFactory.getLogger(OFGroupFeaturesStatsReplyVer13.class); |
| 36 | // version: 1.3 |
| 37 | final static byte WIRE_VERSION = 4; |
| 38 | final static int LENGTH = 56; |
| 39 | |
| 40 | private final static long DEFAULT_XID = 0x0L; |
| 41 | private final static Set<OFStatsReplyFlags> DEFAULT_FLAGS = ImmutableSet.<OFStatsReplyFlags>of(); |
| 42 | private final static long DEFAULT_TYPES = 0x0L; |
| 43 | private final static long DEFAULT_CAPABILITIES = 0x0L; |
| 44 | private final static long DEFAULT_MAX_GROUPS_ALL = 0x0L; |
| 45 | private final static long DEFAULT_MAX_GROUPS_SELECT = 0x0L; |
| 46 | private final static long DEFAULT_MAX_GROUPS_INDIRECT = 0x0L; |
| 47 | private final static long DEFAULT_MAX_GROUPS_FF = 0x0L; |
| 48 | private final static long DEFAULT_ACTIONS_ALL = 0x0L; |
| 49 | private final static long DEFAULT_ACTIONS_SELECT = 0x0L; |
| 50 | private final static long DEFAULT_ACTIONS_INDIRECT = 0x0L; |
| 51 | private final static long DEFAULT_ACTIONS_FF = 0x0L; |
| 52 | |
| 53 | // OF message fields |
| 54 | private final long xid; |
| 55 | private final Set<OFStatsReplyFlags> flags; |
| 56 | private final long types; |
| 57 | private final long capabilities; |
| 58 | private final long maxGroupsAll; |
| 59 | private final long maxGroupsSelect; |
| 60 | private final long maxGroupsIndirect; |
| 61 | private final long maxGroupsFf; |
| 62 | private final long actionsAll; |
| 63 | private final long actionsSelect; |
| 64 | private final long actionsIndirect; |
| 65 | private final long actionsFf; |
| 66 | // |
| 67 | // Immutable default instance |
| 68 | final static OFGroupFeaturesStatsReplyVer13 DEFAULT = new OFGroupFeaturesStatsReplyVer13( |
| 69 | DEFAULT_XID, DEFAULT_FLAGS, DEFAULT_TYPES, DEFAULT_CAPABILITIES, DEFAULT_MAX_GROUPS_ALL, DEFAULT_MAX_GROUPS_SELECT, DEFAULT_MAX_GROUPS_INDIRECT, DEFAULT_MAX_GROUPS_FF, DEFAULT_ACTIONS_ALL, DEFAULT_ACTIONS_SELECT, DEFAULT_ACTIONS_INDIRECT, DEFAULT_ACTIONS_FF |
| 70 | ); |
| 71 | |
| 72 | // package private constructor - used by readers, builders, and factory |
| 73 | OFGroupFeaturesStatsReplyVer13(long xid, Set<OFStatsReplyFlags> flags, long types, long capabilities, long maxGroupsAll, long maxGroupsSelect, long maxGroupsIndirect, long maxGroupsFf, long actionsAll, long actionsSelect, long actionsIndirect, long actionsFf) { |
| 74 | this.xid = xid; |
| 75 | this.flags = flags; |
| 76 | this.types = types; |
| 77 | this.capabilities = capabilities; |
| 78 | this.maxGroupsAll = maxGroupsAll; |
| 79 | this.maxGroupsSelect = maxGroupsSelect; |
| 80 | this.maxGroupsIndirect = maxGroupsIndirect; |
| 81 | this.maxGroupsFf = maxGroupsFf; |
| 82 | this.actionsAll = actionsAll; |
| 83 | this.actionsSelect = actionsSelect; |
| 84 | this.actionsIndirect = actionsIndirect; |
| 85 | this.actionsFf = actionsFf; |
| 86 | } |
| 87 | |
| 88 | // Accessors for OF message fields |
| 89 | @Override |
| 90 | public OFVersion getVersion() { |
| 91 | return OFVersion.OF_13; |
| 92 | } |
| 93 | |
| 94 | @Override |
| 95 | public OFType getType() { |
| 96 | return OFType.STATS_REPLY; |
| 97 | } |
| 98 | |
| 99 | @Override |
| 100 | public long getXid() { |
| 101 | return xid; |
| 102 | } |
| 103 | |
| 104 | @Override |
| 105 | public OFStatsType getStatsType() { |
| 106 | return OFStatsType.GROUP_FEATURES; |
| 107 | } |
| 108 | |
| 109 | @Override |
| 110 | public Set<OFStatsReplyFlags> getFlags() { |
| 111 | return flags; |
| 112 | } |
| 113 | |
| 114 | @Override |
| 115 | public long getTypes() { |
| 116 | return types; |
| 117 | } |
| 118 | |
| 119 | @Override |
| 120 | public long getCapabilities() { |
| 121 | return capabilities; |
| 122 | } |
| 123 | |
| 124 | @Override |
| 125 | public long getMaxGroupsAll() { |
| 126 | return maxGroupsAll; |
| 127 | } |
| 128 | |
| 129 | @Override |
| 130 | public long getMaxGroupsSelect() { |
| 131 | return maxGroupsSelect; |
| 132 | } |
| 133 | |
| 134 | @Override |
| 135 | public long getMaxGroupsIndirect() { |
| 136 | return maxGroupsIndirect; |
| 137 | } |
| 138 | |
| 139 | @Override |
| 140 | public long getMaxGroupsFf() { |
| 141 | return maxGroupsFf; |
| 142 | } |
| 143 | |
| 144 | @Override |
| 145 | public long getActionsAll() { |
| 146 | return actionsAll; |
| 147 | } |
| 148 | |
| 149 | @Override |
| 150 | public long getActionsSelect() { |
| 151 | return actionsSelect; |
| 152 | } |
| 153 | |
| 154 | @Override |
| 155 | public long getActionsIndirect() { |
| 156 | return actionsIndirect; |
| 157 | } |
| 158 | |
| 159 | @Override |
| 160 | public long getActionsFf() { |
| 161 | return actionsFf; |
| 162 | } |
| 163 | |
| 164 | |
| 165 | |
| 166 | public OFGroupFeaturesStatsReply.Builder createBuilder() { |
| 167 | return new BuilderWithParent(this); |
| 168 | } |
| 169 | |
| 170 | static class BuilderWithParent implements OFGroupFeaturesStatsReply.Builder { |
| 171 | final OFGroupFeaturesStatsReplyVer13 parentMessage; |
| 172 | |
| 173 | // OF message fields |
| 174 | private boolean xidSet; |
| 175 | private long xid; |
| 176 | private boolean flagsSet; |
| 177 | private Set<OFStatsReplyFlags> flags; |
| 178 | private boolean typesSet; |
| 179 | private long types; |
| 180 | private boolean capabilitiesSet; |
| 181 | private long capabilities; |
| 182 | private boolean maxGroupsAllSet; |
| 183 | private long maxGroupsAll; |
| 184 | private boolean maxGroupsSelectSet; |
| 185 | private long maxGroupsSelect; |
| 186 | private boolean maxGroupsIndirectSet; |
| 187 | private long maxGroupsIndirect; |
| 188 | private boolean maxGroupsFfSet; |
| 189 | private long maxGroupsFf; |
| 190 | private boolean actionsAllSet; |
| 191 | private long actionsAll; |
| 192 | private boolean actionsSelectSet; |
| 193 | private long actionsSelect; |
| 194 | private boolean actionsIndirectSet; |
| 195 | private long actionsIndirect; |
| 196 | private boolean actionsFfSet; |
| 197 | private long actionsFf; |
| 198 | |
| 199 | BuilderWithParent(OFGroupFeaturesStatsReplyVer13 parentMessage) { |
| 200 | this.parentMessage = parentMessage; |
| 201 | } |
| 202 | |
| 203 | @Override |
| 204 | public OFVersion getVersion() { |
| 205 | return OFVersion.OF_13; |
| 206 | } |
| 207 | |
| 208 | @Override |
| 209 | public OFType getType() { |
| 210 | return OFType.STATS_REPLY; |
| 211 | } |
| 212 | |
| 213 | @Override |
| 214 | public long getXid() { |
| 215 | return xid; |
| 216 | } |
| 217 | |
| 218 | @Override |
| 219 | public OFGroupFeaturesStatsReply.Builder setXid(long xid) { |
| 220 | this.xid = xid; |
| 221 | this.xidSet = true; |
| 222 | return this; |
| 223 | } |
| 224 | @Override |
| 225 | public OFStatsType getStatsType() { |
| 226 | return OFStatsType.GROUP_FEATURES; |
| 227 | } |
| 228 | |
| 229 | @Override |
| 230 | public Set<OFStatsReplyFlags> getFlags() { |
| 231 | return flags; |
| 232 | } |
| 233 | |
| 234 | @Override |
| 235 | public OFGroupFeaturesStatsReply.Builder setFlags(Set<OFStatsReplyFlags> flags) { |
| 236 | this.flags = flags; |
| 237 | this.flagsSet = true; |
| 238 | return this; |
| 239 | } |
| 240 | @Override |
| 241 | public long getTypes() { |
| 242 | return types; |
| 243 | } |
| 244 | |
| 245 | @Override |
| 246 | public OFGroupFeaturesStatsReply.Builder setTypes(long types) { |
| 247 | this.types = types; |
| 248 | this.typesSet = true; |
| 249 | return this; |
| 250 | } |
| 251 | @Override |
| 252 | public long getCapabilities() { |
| 253 | return capabilities; |
| 254 | } |
| 255 | |
| 256 | @Override |
| 257 | public OFGroupFeaturesStatsReply.Builder setCapabilities(long capabilities) { |
| 258 | this.capabilities = capabilities; |
| 259 | this.capabilitiesSet = true; |
| 260 | return this; |
| 261 | } |
| 262 | @Override |
| 263 | public long getMaxGroupsAll() { |
| 264 | return maxGroupsAll; |
| 265 | } |
| 266 | |
| 267 | @Override |
| 268 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsAll(long maxGroupsAll) { |
| 269 | this.maxGroupsAll = maxGroupsAll; |
| 270 | this.maxGroupsAllSet = true; |
| 271 | return this; |
| 272 | } |
| 273 | @Override |
| 274 | public long getMaxGroupsSelect() { |
| 275 | return maxGroupsSelect; |
| 276 | } |
| 277 | |
| 278 | @Override |
| 279 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsSelect(long maxGroupsSelect) { |
| 280 | this.maxGroupsSelect = maxGroupsSelect; |
| 281 | this.maxGroupsSelectSet = true; |
| 282 | return this; |
| 283 | } |
| 284 | @Override |
| 285 | public long getMaxGroupsIndirect() { |
| 286 | return maxGroupsIndirect; |
| 287 | } |
| 288 | |
| 289 | @Override |
| 290 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsIndirect(long maxGroupsIndirect) { |
| 291 | this.maxGroupsIndirect = maxGroupsIndirect; |
| 292 | this.maxGroupsIndirectSet = true; |
| 293 | return this; |
| 294 | } |
| 295 | @Override |
| 296 | public long getMaxGroupsFf() { |
| 297 | return maxGroupsFf; |
| 298 | } |
| 299 | |
| 300 | @Override |
| 301 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsFf(long maxGroupsFf) { |
| 302 | this.maxGroupsFf = maxGroupsFf; |
| 303 | this.maxGroupsFfSet = true; |
| 304 | return this; |
| 305 | } |
| 306 | @Override |
| 307 | public long getActionsAll() { |
| 308 | return actionsAll; |
| 309 | } |
| 310 | |
| 311 | @Override |
| 312 | public OFGroupFeaturesStatsReply.Builder setActionsAll(long actionsAll) { |
| 313 | this.actionsAll = actionsAll; |
| 314 | this.actionsAllSet = true; |
| 315 | return this; |
| 316 | } |
| 317 | @Override |
| 318 | public long getActionsSelect() { |
| 319 | return actionsSelect; |
| 320 | } |
| 321 | |
| 322 | @Override |
| 323 | public OFGroupFeaturesStatsReply.Builder setActionsSelect(long actionsSelect) { |
| 324 | this.actionsSelect = actionsSelect; |
| 325 | this.actionsSelectSet = true; |
| 326 | return this; |
| 327 | } |
| 328 | @Override |
| 329 | public long getActionsIndirect() { |
| 330 | return actionsIndirect; |
| 331 | } |
| 332 | |
| 333 | @Override |
| 334 | public OFGroupFeaturesStatsReply.Builder setActionsIndirect(long actionsIndirect) { |
| 335 | this.actionsIndirect = actionsIndirect; |
| 336 | this.actionsIndirectSet = true; |
| 337 | return this; |
| 338 | } |
| 339 | @Override |
| 340 | public long getActionsFf() { |
| 341 | return actionsFf; |
| 342 | } |
| 343 | |
| 344 | @Override |
| 345 | public OFGroupFeaturesStatsReply.Builder setActionsFf(long actionsFf) { |
| 346 | this.actionsFf = actionsFf; |
| 347 | this.actionsFfSet = true; |
| 348 | return this; |
| 349 | } |
| 350 | |
| 351 | |
| 352 | @Override |
| 353 | public OFGroupFeaturesStatsReply build() { |
| 354 | long xid = this.xidSet ? this.xid : parentMessage.xid; |
| 355 | Set<OFStatsReplyFlags> flags = this.flagsSet ? this.flags : parentMessage.flags; |
| 356 | if(flags == null) |
| 357 | throw new NullPointerException("Property flags must not be null"); |
| 358 | long types = this.typesSet ? this.types : parentMessage.types; |
| 359 | long capabilities = this.capabilitiesSet ? this.capabilities : parentMessage.capabilities; |
| 360 | long maxGroupsAll = this.maxGroupsAllSet ? this.maxGroupsAll : parentMessage.maxGroupsAll; |
| 361 | long maxGroupsSelect = this.maxGroupsSelectSet ? this.maxGroupsSelect : parentMessage.maxGroupsSelect; |
| 362 | long maxGroupsIndirect = this.maxGroupsIndirectSet ? this.maxGroupsIndirect : parentMessage.maxGroupsIndirect; |
| 363 | long maxGroupsFf = this.maxGroupsFfSet ? this.maxGroupsFf : parentMessage.maxGroupsFf; |
| 364 | long actionsAll = this.actionsAllSet ? this.actionsAll : parentMessage.actionsAll; |
| 365 | long actionsSelect = this.actionsSelectSet ? this.actionsSelect : parentMessage.actionsSelect; |
| 366 | long actionsIndirect = this.actionsIndirectSet ? this.actionsIndirect : parentMessage.actionsIndirect; |
| 367 | long actionsFf = this.actionsFfSet ? this.actionsFf : parentMessage.actionsFf; |
| 368 | |
| 369 | // |
| 370 | return new OFGroupFeaturesStatsReplyVer13( |
| 371 | xid, |
| 372 | flags, |
| 373 | types, |
| 374 | capabilities, |
| 375 | maxGroupsAll, |
| 376 | maxGroupsSelect, |
| 377 | maxGroupsIndirect, |
| 378 | maxGroupsFf, |
| 379 | actionsAll, |
| 380 | actionsSelect, |
| 381 | actionsIndirect, |
| 382 | actionsFf |
| 383 | ); |
| 384 | } |
| 385 | |
| 386 | } |
| 387 | |
| 388 | static class Builder implements OFGroupFeaturesStatsReply.Builder { |
| 389 | // OF message fields |
| 390 | private boolean xidSet; |
| 391 | private long xid; |
| 392 | private boolean flagsSet; |
| 393 | private Set<OFStatsReplyFlags> flags; |
| 394 | private boolean typesSet; |
| 395 | private long types; |
| 396 | private boolean capabilitiesSet; |
| 397 | private long capabilities; |
| 398 | private boolean maxGroupsAllSet; |
| 399 | private long maxGroupsAll; |
| 400 | private boolean maxGroupsSelectSet; |
| 401 | private long maxGroupsSelect; |
| 402 | private boolean maxGroupsIndirectSet; |
| 403 | private long maxGroupsIndirect; |
| 404 | private boolean maxGroupsFfSet; |
| 405 | private long maxGroupsFf; |
| 406 | private boolean actionsAllSet; |
| 407 | private long actionsAll; |
| 408 | private boolean actionsSelectSet; |
| 409 | private long actionsSelect; |
| 410 | private boolean actionsIndirectSet; |
| 411 | private long actionsIndirect; |
| 412 | private boolean actionsFfSet; |
| 413 | private long actionsFf; |
| 414 | |
| 415 | @Override |
| 416 | public OFVersion getVersion() { |
| 417 | return OFVersion.OF_13; |
| 418 | } |
| 419 | |
| 420 | @Override |
| 421 | public OFType getType() { |
| 422 | return OFType.STATS_REPLY; |
| 423 | } |
| 424 | |
| 425 | @Override |
| 426 | public long getXid() { |
| 427 | return xid; |
| 428 | } |
| 429 | |
| 430 | @Override |
| 431 | public OFGroupFeaturesStatsReply.Builder setXid(long xid) { |
| 432 | this.xid = xid; |
| 433 | this.xidSet = true; |
| 434 | return this; |
| 435 | } |
| 436 | @Override |
| 437 | public OFStatsType getStatsType() { |
| 438 | return OFStatsType.GROUP_FEATURES; |
| 439 | } |
| 440 | |
| 441 | @Override |
| 442 | public Set<OFStatsReplyFlags> getFlags() { |
| 443 | return flags; |
| 444 | } |
| 445 | |
| 446 | @Override |
| 447 | public OFGroupFeaturesStatsReply.Builder setFlags(Set<OFStatsReplyFlags> flags) { |
| 448 | this.flags = flags; |
| 449 | this.flagsSet = true; |
| 450 | return this; |
| 451 | } |
| 452 | @Override |
| 453 | public long getTypes() { |
| 454 | return types; |
| 455 | } |
| 456 | |
| 457 | @Override |
| 458 | public OFGroupFeaturesStatsReply.Builder setTypes(long types) { |
| 459 | this.types = types; |
| 460 | this.typesSet = true; |
| 461 | return this; |
| 462 | } |
| 463 | @Override |
| 464 | public long getCapabilities() { |
| 465 | return capabilities; |
| 466 | } |
| 467 | |
| 468 | @Override |
| 469 | public OFGroupFeaturesStatsReply.Builder setCapabilities(long capabilities) { |
| 470 | this.capabilities = capabilities; |
| 471 | this.capabilitiesSet = true; |
| 472 | return this; |
| 473 | } |
| 474 | @Override |
| 475 | public long getMaxGroupsAll() { |
| 476 | return maxGroupsAll; |
| 477 | } |
| 478 | |
| 479 | @Override |
| 480 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsAll(long maxGroupsAll) { |
| 481 | this.maxGroupsAll = maxGroupsAll; |
| 482 | this.maxGroupsAllSet = true; |
| 483 | return this; |
| 484 | } |
| 485 | @Override |
| 486 | public long getMaxGroupsSelect() { |
| 487 | return maxGroupsSelect; |
| 488 | } |
| 489 | |
| 490 | @Override |
| 491 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsSelect(long maxGroupsSelect) { |
| 492 | this.maxGroupsSelect = maxGroupsSelect; |
| 493 | this.maxGroupsSelectSet = true; |
| 494 | return this; |
| 495 | } |
| 496 | @Override |
| 497 | public long getMaxGroupsIndirect() { |
| 498 | return maxGroupsIndirect; |
| 499 | } |
| 500 | |
| 501 | @Override |
| 502 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsIndirect(long maxGroupsIndirect) { |
| 503 | this.maxGroupsIndirect = maxGroupsIndirect; |
| 504 | this.maxGroupsIndirectSet = true; |
| 505 | return this; |
| 506 | } |
| 507 | @Override |
| 508 | public long getMaxGroupsFf() { |
| 509 | return maxGroupsFf; |
| 510 | } |
| 511 | |
| 512 | @Override |
| 513 | public OFGroupFeaturesStatsReply.Builder setMaxGroupsFf(long maxGroupsFf) { |
| 514 | this.maxGroupsFf = maxGroupsFf; |
| 515 | this.maxGroupsFfSet = true; |
| 516 | return this; |
| 517 | } |
| 518 | @Override |
| 519 | public long getActionsAll() { |
| 520 | return actionsAll; |
| 521 | } |
| 522 | |
| 523 | @Override |
| 524 | public OFGroupFeaturesStatsReply.Builder setActionsAll(long actionsAll) { |
| 525 | this.actionsAll = actionsAll; |
| 526 | this.actionsAllSet = true; |
| 527 | return this; |
| 528 | } |
| 529 | @Override |
| 530 | public long getActionsSelect() { |
| 531 | return actionsSelect; |
| 532 | } |
| 533 | |
| 534 | @Override |
| 535 | public OFGroupFeaturesStatsReply.Builder setActionsSelect(long actionsSelect) { |
| 536 | this.actionsSelect = actionsSelect; |
| 537 | this.actionsSelectSet = true; |
| 538 | return this; |
| 539 | } |
| 540 | @Override |
| 541 | public long getActionsIndirect() { |
| 542 | return actionsIndirect; |
| 543 | } |
| 544 | |
| 545 | @Override |
| 546 | public OFGroupFeaturesStatsReply.Builder setActionsIndirect(long actionsIndirect) { |
| 547 | this.actionsIndirect = actionsIndirect; |
| 548 | this.actionsIndirectSet = true; |
| 549 | return this; |
| 550 | } |
| 551 | @Override |
| 552 | public long getActionsFf() { |
| 553 | return actionsFf; |
| 554 | } |
| 555 | |
| 556 | @Override |
| 557 | public OFGroupFeaturesStatsReply.Builder setActionsFf(long actionsFf) { |
| 558 | this.actionsFf = actionsFf; |
| 559 | this.actionsFfSet = true; |
| 560 | return this; |
| 561 | } |
| 562 | // |
| 563 | @Override |
| 564 | public OFGroupFeaturesStatsReply build() { |
| 565 | long xid = this.xidSet ? this.xid : DEFAULT_XID; |
| 566 | Set<OFStatsReplyFlags> flags = this.flagsSet ? this.flags : DEFAULT_FLAGS; |
| 567 | if(flags == null) |
| 568 | throw new NullPointerException("Property flags must not be null"); |
| 569 | long types = this.typesSet ? this.types : DEFAULT_TYPES; |
| 570 | long capabilities = this.capabilitiesSet ? this.capabilities : DEFAULT_CAPABILITIES; |
| 571 | long maxGroupsAll = this.maxGroupsAllSet ? this.maxGroupsAll : DEFAULT_MAX_GROUPS_ALL; |
| 572 | long maxGroupsSelect = this.maxGroupsSelectSet ? this.maxGroupsSelect : DEFAULT_MAX_GROUPS_SELECT; |
| 573 | long maxGroupsIndirect = this.maxGroupsIndirectSet ? this.maxGroupsIndirect : DEFAULT_MAX_GROUPS_INDIRECT; |
| 574 | long maxGroupsFf = this.maxGroupsFfSet ? this.maxGroupsFf : DEFAULT_MAX_GROUPS_FF; |
| 575 | long actionsAll = this.actionsAllSet ? this.actionsAll : DEFAULT_ACTIONS_ALL; |
| 576 | long actionsSelect = this.actionsSelectSet ? this.actionsSelect : DEFAULT_ACTIONS_SELECT; |
| 577 | long actionsIndirect = this.actionsIndirectSet ? this.actionsIndirect : DEFAULT_ACTIONS_INDIRECT; |
| 578 | long actionsFf = this.actionsFfSet ? this.actionsFf : DEFAULT_ACTIONS_FF; |
| 579 | |
| 580 | |
| 581 | return new OFGroupFeaturesStatsReplyVer13( |
| 582 | xid, |
| 583 | flags, |
| 584 | types, |
| 585 | capabilities, |
| 586 | maxGroupsAll, |
| 587 | maxGroupsSelect, |
| 588 | maxGroupsIndirect, |
| 589 | maxGroupsFf, |
| 590 | actionsAll, |
| 591 | actionsSelect, |
| 592 | actionsIndirect, |
| 593 | actionsFf |
| 594 | ); |
| 595 | } |
| 596 | |
| 597 | } |
| 598 | |
| 599 | |
| 600 | final static Reader READER = new Reader(); |
| 601 | static class Reader implements OFMessageReader<OFGroupFeaturesStatsReply> { |
| 602 | @Override |
| 603 | public OFGroupFeaturesStatsReply readFrom(ChannelBuffer bb) throws OFParseError { |
| 604 | int start = bb.readerIndex(); |
| 605 | // fixed value property version == 4 |
| 606 | byte version = bb.readByte(); |
| 607 | if(version != (byte) 0x4) |
| 608 | throw new OFParseError("Wrong version: Expected=OFVersion.OF_13(4), got="+version); |
| 609 | // fixed value property type == 19 |
| 610 | byte type = bb.readByte(); |
| 611 | if(type != (byte) 0x13) |
| 612 | throw new OFParseError("Wrong type: Expected=OFType.STATS_REPLY(19), got="+type); |
| 613 | int length = U16.f(bb.readShort()); |
| 614 | if(length != 56) |
| 615 | throw new OFParseError("Wrong length: Expected=56(56), got="+length); |
| 616 | if(bb.readableBytes() + (bb.readerIndex() - start) < length) { |
| 617 | // Buffer does not have all data yet |
| 618 | bb.readerIndex(start); |
| 619 | return null; |
| 620 | } |
| 621 | if(logger.isTraceEnabled()) |
| 622 | logger.trace("readFrom - length={}", length); |
| 623 | long xid = U32.f(bb.readInt()); |
| 624 | // fixed value property statsType == 8 |
| 625 | short statsType = bb.readShort(); |
| 626 | if(statsType != (short) 0x8) |
| 627 | throw new OFParseError("Wrong statsType: Expected=OFStatsType.GROUP_FEATURES(8), got="+statsType); |
| 628 | Set<OFStatsReplyFlags> flags = OFStatsReplyFlagsSerializerVer13.readFrom(bb); |
| 629 | // pad: 4 bytes |
| 630 | bb.skipBytes(4); |
| 631 | long types = U32.f(bb.readInt()); |
| 632 | long capabilities = U32.f(bb.readInt()); |
| 633 | long maxGroupsAll = U32.f(bb.readInt()); |
| 634 | long maxGroupsSelect = U32.f(bb.readInt()); |
| 635 | long maxGroupsIndirect = U32.f(bb.readInt()); |
| 636 | long maxGroupsFf = U32.f(bb.readInt()); |
| 637 | long actionsAll = U32.f(bb.readInt()); |
| 638 | long actionsSelect = U32.f(bb.readInt()); |
| 639 | long actionsIndirect = U32.f(bb.readInt()); |
| 640 | long actionsFf = U32.f(bb.readInt()); |
| 641 | |
| 642 | OFGroupFeaturesStatsReplyVer13 groupFeaturesStatsReplyVer13 = new OFGroupFeaturesStatsReplyVer13( |
| 643 | xid, |
| 644 | flags, |
| 645 | types, |
| 646 | capabilities, |
| 647 | maxGroupsAll, |
| 648 | maxGroupsSelect, |
| 649 | maxGroupsIndirect, |
| 650 | maxGroupsFf, |
| 651 | actionsAll, |
| 652 | actionsSelect, |
| 653 | actionsIndirect, |
| 654 | actionsFf |
| 655 | ); |
| 656 | if(logger.isTraceEnabled()) |
| 657 | logger.trace("readFrom - read={}", groupFeaturesStatsReplyVer13); |
| 658 | return groupFeaturesStatsReplyVer13; |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | public void putTo(PrimitiveSink sink) { |
| 663 | FUNNEL.funnel(this, sink); |
| 664 | } |
| 665 | |
| 666 | final static OFGroupFeaturesStatsReplyVer13Funnel FUNNEL = new OFGroupFeaturesStatsReplyVer13Funnel(); |
| 667 | static class OFGroupFeaturesStatsReplyVer13Funnel implements Funnel<OFGroupFeaturesStatsReplyVer13> { |
| 668 | private static final long serialVersionUID = 1L; |
| 669 | @Override |
| 670 | public void funnel(OFGroupFeaturesStatsReplyVer13 message, PrimitiveSink sink) { |
| 671 | // fixed value property version = 4 |
| 672 | sink.putByte((byte) 0x4); |
| 673 | // fixed value property type = 19 |
| 674 | sink.putByte((byte) 0x13); |
| 675 | // fixed value property length = 56 |
| 676 | sink.putShort((short) 0x38); |
| 677 | sink.putLong(message.xid); |
| 678 | // fixed value property statsType = 8 |
| 679 | sink.putShort((short) 0x8); |
| 680 | OFStatsReplyFlagsSerializerVer13.putTo(message.flags, sink); |
| 681 | // skip pad (4 bytes) |
| 682 | sink.putLong(message.types); |
| 683 | sink.putLong(message.capabilities); |
| 684 | sink.putLong(message.maxGroupsAll); |
| 685 | sink.putLong(message.maxGroupsSelect); |
| 686 | sink.putLong(message.maxGroupsIndirect); |
| 687 | sink.putLong(message.maxGroupsFf); |
| 688 | sink.putLong(message.actionsAll); |
| 689 | sink.putLong(message.actionsSelect); |
| 690 | sink.putLong(message.actionsIndirect); |
| 691 | sink.putLong(message.actionsFf); |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | |
| 696 | public void writeTo(ChannelBuffer bb) { |
| 697 | WRITER.write(bb, this); |
| 698 | } |
| 699 | |
| 700 | final static Writer WRITER = new Writer(); |
| 701 | static class Writer implements OFMessageWriter<OFGroupFeaturesStatsReplyVer13> { |
| 702 | @Override |
| 703 | public void write(ChannelBuffer bb, OFGroupFeaturesStatsReplyVer13 message) { |
| 704 | // fixed value property version = 4 |
| 705 | bb.writeByte((byte) 0x4); |
| 706 | // fixed value property type = 19 |
| 707 | bb.writeByte((byte) 0x13); |
| 708 | // fixed value property length = 56 |
| 709 | bb.writeShort((short) 0x38); |
| 710 | bb.writeInt(U32.t(message.xid)); |
| 711 | // fixed value property statsType = 8 |
| 712 | bb.writeShort((short) 0x8); |
| 713 | OFStatsReplyFlagsSerializerVer13.writeTo(bb, message.flags); |
| 714 | // pad: 4 bytes |
| 715 | bb.writeZero(4); |
| 716 | bb.writeInt(U32.t(message.types)); |
| 717 | bb.writeInt(U32.t(message.capabilities)); |
| 718 | bb.writeInt(U32.t(message.maxGroupsAll)); |
| 719 | bb.writeInt(U32.t(message.maxGroupsSelect)); |
| 720 | bb.writeInt(U32.t(message.maxGroupsIndirect)); |
| 721 | bb.writeInt(U32.t(message.maxGroupsFf)); |
| 722 | bb.writeInt(U32.t(message.actionsAll)); |
| 723 | bb.writeInt(U32.t(message.actionsSelect)); |
| 724 | bb.writeInt(U32.t(message.actionsIndirect)); |
| 725 | bb.writeInt(U32.t(message.actionsFf)); |
| 726 | |
| 727 | |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | @Override |
| 732 | public String toString() { |
| 733 | StringBuilder b = new StringBuilder("OFGroupFeaturesStatsReplyVer13("); |
| 734 | b.append("xid=").append(xid); |
| 735 | b.append(", "); |
| 736 | b.append("flags=").append(flags); |
| 737 | b.append(", "); |
| 738 | b.append("types=").append(types); |
| 739 | b.append(", "); |
| 740 | b.append("capabilities=").append(capabilities); |
| 741 | b.append(", "); |
| 742 | b.append("maxGroupsAll=").append(maxGroupsAll); |
| 743 | b.append(", "); |
| 744 | b.append("maxGroupsSelect=").append(maxGroupsSelect); |
| 745 | b.append(", "); |
| 746 | b.append("maxGroupsIndirect=").append(maxGroupsIndirect); |
| 747 | b.append(", "); |
| 748 | b.append("maxGroupsFf=").append(maxGroupsFf); |
| 749 | b.append(", "); |
| 750 | b.append("actionsAll=").append(actionsAll); |
| 751 | b.append(", "); |
| 752 | b.append("actionsSelect=").append(actionsSelect); |
| 753 | b.append(", "); |
| 754 | b.append("actionsIndirect=").append(actionsIndirect); |
| 755 | b.append(", "); |
| 756 | b.append("actionsFf=").append(actionsFf); |
| 757 | b.append(")"); |
| 758 | return b.toString(); |
| 759 | } |
| 760 | |
| 761 | @Override |
| 762 | public boolean equals(Object obj) { |
| 763 | if (this == obj) |
| 764 | return true; |
| 765 | if (obj == null) |
| 766 | return false; |
| 767 | if (getClass() != obj.getClass()) |
| 768 | return false; |
| 769 | OFGroupFeaturesStatsReplyVer13 other = (OFGroupFeaturesStatsReplyVer13) obj; |
| 770 | |
| 771 | if( xid != other.xid) |
| 772 | return false; |
| 773 | if (flags == null) { |
| 774 | if (other.flags != null) |
| 775 | return false; |
| 776 | } else if (!flags.equals(other.flags)) |
| 777 | return false; |
| 778 | if( types != other.types) |
| 779 | return false; |
| 780 | if( capabilities != other.capabilities) |
| 781 | return false; |
| 782 | if( maxGroupsAll != other.maxGroupsAll) |
| 783 | return false; |
| 784 | if( maxGroupsSelect != other.maxGroupsSelect) |
| 785 | return false; |
| 786 | if( maxGroupsIndirect != other.maxGroupsIndirect) |
| 787 | return false; |
| 788 | if( maxGroupsFf != other.maxGroupsFf) |
| 789 | return false; |
| 790 | if( actionsAll != other.actionsAll) |
| 791 | return false; |
| 792 | if( actionsSelect != other.actionsSelect) |
| 793 | return false; |
| 794 | if( actionsIndirect != other.actionsIndirect) |
| 795 | return false; |
| 796 | if( actionsFf != other.actionsFf) |
| 797 | return false; |
| 798 | return true; |
| 799 | } |
| 800 | |
| 801 | @Override |
| 802 | public int hashCode() { |
| 803 | final int prime = 31; |
| 804 | int result = 1; |
| 805 | |
| 806 | result = prime * (int) (xid ^ (xid >>> 32)); |
| 807 | result = prime * result + ((flags == null) ? 0 : flags.hashCode()); |
| 808 | result = prime * (int) (types ^ (types >>> 32)); |
| 809 | result = prime * (int) (capabilities ^ (capabilities >>> 32)); |
| 810 | result = prime * (int) (maxGroupsAll ^ (maxGroupsAll >>> 32)); |
| 811 | result = prime * (int) (maxGroupsSelect ^ (maxGroupsSelect >>> 32)); |
| 812 | result = prime * (int) (maxGroupsIndirect ^ (maxGroupsIndirect >>> 32)); |
| 813 | result = prime * (int) (maxGroupsFf ^ (maxGroupsFf >>> 32)); |
| 814 | result = prime * (int) (actionsAll ^ (actionsAll >>> 32)); |
| 815 | result = prime * (int) (actionsSelect ^ (actionsSelect >>> 32)); |
| 816 | result = prime * (int) (actionsIndirect ^ (actionsIndirect >>> 32)); |
| 817 | result = prime * (int) (actionsFf ^ (actionsFf >>> 32)); |
| 818 | return result; |
| 819 | } |
| 820 | |
| 821 | } |