Interface Policer.Builder

    • Method Detail

      • forDeviceId

        Policer.Builder forDeviceId​(DeviceId deviceId)
        Assigns the device for this policer.

        Note: mandatory setter for this builder

        Parameters:
        deviceId - a device id
        Returns:
        this
      • fromApp

        Policer.Builder fromApp​(ApplicationId appId)
        Assigns the application that built this policer.

        Note: mandatory setter for this builder

        Parameters:
        appId - an application id
        Returns:
        this
      • withId

        Policer.Builder withId​(PolicerId id)
        Assigns the id to this policer.

        Note: mandatory setter for this builder

        Parameters:
        id - an identifier
        Returns:
        this
      • colorAware

        Policer.Builder colorAware​(boolean isColorAware)
        Sets this policer to be color aware. Defaults to false.
        Parameters:
        isColorAware - if it is color aware or not
        Returns:
        this
      • withUnit

        Policer.Builder withUnit​(Policer.Unit unit)
        Assigns the unit to use for this policer. Defaults to MB/s.
        Parameters:
        unit - a unit
        Returns:
        this
      • withPolicingResource

        Policer.Builder withPolicingResource​(PolicingResource policingResource)
        Assigns policer id and device id for this policer.
        Parameters:
        policingResource - the policing resource
        Returns:
        this
      • withTokenBuckets

        Policer.Builder withTokenBuckets​(java.util.Collection<TokenBucket> tokenBuckets)
        Assigns token buckets for this policer.

        Note: at least one token bucket

        Parameters:
        tokenBuckets - the collection of token buckets
        Returns:
        this
      • withDescription

        Policer.Builder withDescription​(java.lang.String description)
        Assigns description for this policer. Default is empty description.
        Parameters:
        description - the description
        Returns:
        this
      • build

        Policer build()
        Builds the policer based on the specified parameters when possible.
        Returns:
        a policer