CmcdConfiguration.RequestConfig


public interface CmcdConfiguration.RequestConfig


Represents configuration which can vary on each request.

Implementations must not make assumptions about which thread called their methods; and must be thread-safe.

Summary

Public methods

default ImmutableListMultimap<@CmcdConfiguration.HeaderKey StringString>

Retrieves the custom data associated with CMCD logging.

default int

Returns the maximum throughput requested in kbps, or RATE_UNSET_INT if the maximum throughput is unknown in which case the maximum throughput will not be logged upstream.

default boolean

Checks whether the specified key is allowed in CMCD logging.

Public methods

getCustomData

default ImmutableListMultimap<@CmcdConfiguration.HeaderKey StringStringgetCustomData()

Retrieves the custom data associated with CMCD logging.

By default, no custom data is provided.

The data payload consists of a series of key/value pairs constructed according to the following rules:

  • Custom keys SHOULD be allocated to one of the four defined header names defined in the HeaderKey annotation.
  • All information in the payload MUST be represented as key=value pairs.
  • The key and value MUST be separated by an equals sign. If the value type is boolean and the value is true, then the equals sign and the value MUST be omitted.
  • The key names are case-sensitive and reserved. Custom key names MUST carry a hyphenated prefix to ensure no namespace collision with future revisions to Common Media Client Data (CMCD) specification. Clients SHOULD use a reverse-DNS syntax when defining their own prefix.
  • Any value of type String MUST be enclosed by opening and closing double quotes. Double quotes and backslashes MUST be escaped using a backslash "\" character. Any value that is not of type string does not require quoting.

Note: The key words MUST and SHOULD are to be interpreted as described in RFC 2119.

Example:

  • CMCD-Request:custom-field1=25400
  • CMCD-Object:custom-field2=3200,custom-field3=4004,custom-field4=v,custom-field5=6000
  • CMCD-Status:custom-field6,custom-field7=15000
  • CMCD-Session:custom-field8="stringValue"

getRequestedMaximumThroughputKbps

default int getRequestedMaximumThroughputKbps(int throughputKbps)

Returns the maximum throughput requested in kbps, or RATE_UNSET_INT if the maximum throughput is unknown in which case the maximum throughput will not be logged upstream.

Parameters
int throughputKbps

The throughput in kbps of the audio or video object being requested.

Returns
int

The maximum throughput requested in kbps.

isKeyAllowed

default boolean isKeyAllowed(
    @CmcdConfiguration.CmcdKey @CmcdConfiguration.CmcdKey String key
)

Checks whether the specified key is allowed in CMCD logging. By default, all keys are allowed.

Parameters
@CmcdConfiguration.CmcdKey @CmcdConfiguration.CmcdKey String key

The key to check.

Returns
boolean

Whether the key is allowed.