com.h3c.of.lib.msg

## Class Bucket

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.msg.Bucket

- All Implemented Interfaces:
    Structure
  Direct Known Subclasses:
    MutableBucket

      public class Bucket
      extends OpenflowStructure

  Represents a bucket used in `groups`; Since 1.1.

  The weight of the bucket is only defined for select groups, and support is optional. The bucket's share of the traffic processed by the group is defined by the individual bucket's weight divided by the sum of the bucket weights in the group.

  The `watch port` and `watch group` are only required for fast failover groups, and may be optionally implemented for other group types. These fields indicate the port and/or group whose liveness controls whether this bucket is a candidate for forwarding. For fast failover groups, the first bucket defined is the highest-priority bucket, and only the highest-priority live bucket is used.

- - ### Field Summary

    - ### Fields inherited from class com.h3c.of.lib.OpenflowStructure

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Bucket(ProtocolVersion pv)` Constructs a bucket.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<Action>` | `getActions()` Returns the actions associated with this bucket; Since 1.1.
    `GroupId` | `getWatchGroup()` Returns the ID of the watch group.
    `BigPortNumber` | `getWatchPort()` Returns the watch port id; Since 1.1.
    `int` | `getWeight()` Returns the weight of this bucket; Since 1.1.
    `String` | `toDebugString()` Returns a multi-line representation of this bucket.
    `String` | `toDebugString(int indent)` Returns a multi-line representation of this bucket.
    `String` | `toString()`

    - ### Methods inherited from class com.h3c.of.lib.OpenflowStructure

      `getVersion, hex, hex, validate`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Bucket

          public Bucket(ProtocolVersion pv)

      Constructs a bucket.
      Parameters:
        `pv` - the protocol version

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `OpenflowStructure`

    - #### toDebugString

          public String toDebugString()

      Returns a multi-line representation of this bucket. Useful for debug output.
      Specified by:
        `toDebugString` in interface `Structure`
      Overrides:
        `toDebugString` in class `OpenflowStructure`
      Returns:
        a multi-line representation

    - #### toDebugString

          public String toDebugString(int indent)

      Returns a multi-line representation of this bucket. Useful for debug output.
      Parameters:
        `indent` - number of spaces to prefix each line with
      Returns:
        a multi-line representation

    - #### getWeight

          public int getWeight()

      Returns the weight of this bucket; Since 1.1.
      Returns:
        the weight

    - #### getWatchPort

          public BigPortNumber getWatchPort()

      Returns the watch port id; Since 1.1.
      Returns:
        the watch port id

    - #### getWatchGroup

          public GroupId getWatchGroup()

      Returns the ID of the watch group.
      Returns:
        the watch group id

    - #### getActions

          public List<Action> getActions()

      Returns the actions associated with this bucket; Since 1.1.
      Returns:
        the actions

Copyright © 2014. All Rights Reserved.