CmcdConfiguration.RequestConfig


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 functions

ImmutableListMultimap<@CmcdConfiguration.HeaderKey String!, String!>!

Retrieves the custom data associated with CMCD logging.

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.

Boolean

Checks whether the specified key is allowed in CMCD logging.

Public functions

getCustomData

fun getCustomData(): ImmutableListMultimap<@CmcdConfiguration.HeaderKey String!, String!>!

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

fun getRequestedMaximumThroughputKbps(throughputKbps: Int): 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.

Parameters
throughputKbps: Int

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

Returns
Int

The maximum throughput requested in kbps.

isKeyAllowed

fun isKeyAllowed(
    @CmcdConfiguration.CmcdKey key: @CmcdConfiguration.CmcdKey String!
): Boolean

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

Parameters
@CmcdConfiguration.CmcdKey key: @CmcdConfiguration.CmcdKey String!

The key to check.

Returns
Boolean

Whether the key is allowed.