Package com.castlabs.android.network

# Class NetworkConfiguration

java.lang.Object
com.castlabs.android.network.NetworkConfiguration

All Implemented Interfaces:
  `Parcelable`

public class NetworkConfiguration extends Object implements Parcelable
Network configuration for the Castlabs SDK. This class is used to configure timeouts and retry strategies for various network requests.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `NetworkConfiguration.Builder`
  Builder for `NetworkConfiguration` instances.

  ## Nested classes/interfaces inherited from interface android.os.Parcelable

  `Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Parcelable.Creator<NetworkConfiguration>`
  `CREATOR`
  Creator used by the Parcelable implementation
  `final int`
  `dashCallbackConnectionTimeoutMs`
  The connection timeout in milliseconds for DASH callbacks
  `final int`
  `dashCallbackReadTimeoutMs`
  The read timeout in milliseconds for DASH callbacks
  `static final boolean`
  `DEFAULT_ALLOW_CROSS_PROTOCOL_REDIRECTS`
  The default whether to allow cross protocol redirects
  `static final int`
  `DEFAULT_CALL_TIMEOUT_MILLIS`
  The default read timeout, in milliseconds.
  `static final int`
  `DEFAULT_CONNECT_TIMEOUT_MILLIS`
  The default connection timeout, in milliseconds.
  `static int`
  `DEFAULT_DRAIN_CONNECTION_TIMEOUT_MS`
  The timeout to use while discarding a download of input data.
  `static final int`
  `DEFAULT_DRM_ACQUISITION_TIMEOUT_MILLIS`
  The default DRM acquisition timeout specific to DRM scheme
  `static final int`
  `DEFAULT_DRM_CONNECT_TIMEOUT_MILLIS`
  The default DRM connection timeout specific to DRM scheme
  `static final int`
  `DEFAULT_DRM_READ_TIMEOUT_MILLIS`
  The default DRM read timeout specific to DRM scheme
  `static final int`
  `DEFAULT_READ_TIMEOUT_MILLIS`
  The default read timeout, in milliseconds.
  `static final int`
  `DEFAULT_THUMBNAIL_CONNECT_TIMEOUT_MILLIS`
  The default thumbnail connection timeout, in milliseconds.
  `static final int`
  `DEFAULT_THUMBNAIL_READ_TIMEOUT_MILLIS`
  The default thumbnail read timeout, in milliseconds.
  `final int`
  `drainConnectionTimeoutMs`
  The drain timeout in milliseconds.
  `final int`
  `drmAcquisitionTimeoutMs`
  The acquisition timeout in milliseconds for DRM requests.
  `final int`
  `drmConnectionTimeoutMs`
  The connection timeout in milliseconds for DRM requests
  `final int`
  `drmReadTimeoutMs`
  The read timeout in milliseconds for DRM requests
  `final RetryConfiguration`
  `drmRetryConfiguration`
  The `RetryConfiguration` for DRM requests that will be to determine how often to retry after loading errors
  `final int`
  `iptvReadTimeoutMs`
  The acquisition timeout in milliseconds for IPTV-UDP/RTP requests.
  `final int`
  `manifestConnectionTimeoutMs`
  The connection timeout in milliseconds for manifest requests
  `final int`
  `manifestReadTimeoutMs`
  The read timeout in milliseconds for manifest requests
  `final RetryConfiguration`
  `manifestRetryConfiguration`
  The `RetryConfiguration` for manifest requests that will be to determine how often to retry after loading errors
  `final RetryConfiguration`
  `provisioningRetryConfiguration`
  The `RetryConfiguration` for provisioning requests that will be to determine how often to retry after loading errors
  `final int`
  `segmentsCallTimeoutMs`
  Sets the Call timeout for segment requests including the request, redirect and response This only currently works with the OkHttp Plugin.
  `final int`
  `segmentsConnectionTimeoutMs`
  The connection timeout in milliseconds for segment requests
  `final int`
  `segmentsReadTimeoutMs`
  The read timeout in milliseconds for segment requests
  `final RetryConfiguration`
  `segmentsRetryConfiguration`
  The `RetryConfiguration` for segment requests that will be to determine how often to retry after loading errors
  `final int`
  `thumbnailConnectionTimeoutMs`
  The connection timeout in milliseconds for thumbnail requests.
  `final int`
  `thumbnailReadTimeoutMs`
  The read timeout in milliseconds for thumbnail requests.

  ### Fields inherited from interface android.os.Parcelable

  `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NetworkConfiguration()`
  Creates a new NetworkConfiguration with default values.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `callTimeoutMs(int requestType)`
  Returns the call timeout for the given request type.
  `int`
  `connectionTimeoutMs(int requestType)`
  Returns the connection timeout for the given request type.
  `int`
  `describeContents()`
  `boolean`
  `equals(Object obj)`
  `int`
  `hashCode()`
  `int`
  `readTimeoutMs(int requestType)`
  Returns the read timeout for the given request type.
  `String`
  `toString()`
  `void`
  `writeToParcel(Parcel dest, int flags)`

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

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_CONNECT_TIMEOUT_MILLIS

    public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS
    The default connection timeout, in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_READ_TIMEOUT_MILLIS

    public static final int DEFAULT_READ_TIMEOUT_MILLIS
    The default read timeout, in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_CALL_TIMEOUT_MILLIS

    public static final int DEFAULT_CALL_TIMEOUT_MILLIS
    The default read timeout, in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_DRM_CONNECT_TIMEOUT_MILLIS

    public static final int DEFAULT_DRM_CONNECT_TIMEOUT_MILLIS
    The default DRM connection timeout specific to DRM scheme
    See Also:
      - Constant Field Values

  - ### DEFAULT_DRM_READ_TIMEOUT_MILLIS

    public static final int DEFAULT_DRM_READ_TIMEOUT_MILLIS
    The default DRM read timeout specific to DRM scheme
    See Also:
      - Constant Field Values

  - ### DEFAULT_DRM_ACQUISITION_TIMEOUT_MILLIS

    public static final int DEFAULT_DRM_ACQUISITION_TIMEOUT_MILLIS
    The default DRM acquisition timeout specific to DRM scheme
    See Also:
      - Constant Field Values

  - ### DEFAULT_THUMBNAIL_CONNECT_TIMEOUT_MILLIS

    public static final int DEFAULT_THUMBNAIL_CONNECT_TIMEOUT_MILLIS
    The default thumbnail connection timeout, in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_THUMBNAIL_READ_TIMEOUT_MILLIS

    public static final int DEFAULT_THUMBNAIL_READ_TIMEOUT_MILLIS
    The default thumbnail read timeout, in milliseconds.
    See Also:
      - Constant Field Values

  - ### DEFAULT_ALLOW_CROSS_PROTOCOL_REDIRECTS

    public static final boolean DEFAULT_ALLOW_CROSS_PROTOCOL_REDIRECTS
    The default whether to allow cross protocol redirects
    See Also:
      - Constant Field Values

  - ### DEFAULT_DRAIN_CONNECTION_TIMEOUT_MS

    public static int DEFAULT_DRAIN_CONNECTION_TIMEOUT_MS
    The timeout to use while discarding a download of input data. This is the time that we allow the connection to drain and finish before the download is aborted. If the download can be drained in time, it increases the chance that the connection can be reused. This timeout should be significantly less than the time it takes to establish a new connection.

  - ### CREATOR

    public static final Parcelable.Creator<NetworkConfiguration> CREATOR
    Creator used by the Parcelable implementation

  - ### manifestConnectionTimeoutMs

    public final int manifestConnectionTimeoutMs
    The connection timeout in milliseconds for manifest requests

  - ### segmentsConnectionTimeoutMs

    public final int segmentsConnectionTimeoutMs
    The connection timeout in milliseconds for segment requests

  - ### drmConnectionTimeoutMs

    public final int drmConnectionTimeoutMs
    The connection timeout in milliseconds for DRM requests

  - ### dashCallbackConnectionTimeoutMs

    public final int dashCallbackConnectionTimeoutMs
    The connection timeout in milliseconds for DASH callbacks

  - ### thumbnailConnectionTimeoutMs

    public final int thumbnailConnectionTimeoutMs
    The connection timeout in milliseconds for thumbnail requests. This timeout is used only if the ThumbsPlugin is registered.

  - ### manifestReadTimeoutMs

    public final int manifestReadTimeoutMs
    The read timeout in milliseconds for manifest requests

  - ### segmentsReadTimeoutMs

    public final int segmentsReadTimeoutMs
    The read timeout in milliseconds for segment requests

  - ### drmReadTimeoutMs

    public final int drmReadTimeoutMs
    The read timeout in milliseconds for DRM requests

  - ### dashCallbackReadTimeoutMs

    public final int dashCallbackReadTimeoutMs
    The read timeout in milliseconds for DASH callbacks

  - ### thumbnailReadTimeoutMs

    public final int thumbnailReadTimeoutMs
    The read timeout in milliseconds for thumbnail requests. This timeout is used only if the ThumbsPlugin is registered.

  - ### drmAcquisitionTimeoutMs

    public final int drmAcquisitionTimeoutMs
    The acquisition timeout in milliseconds for DRM requests. Maximum total time a single DRM request can take.

  - ### drainConnectionTimeoutMs

    public final int drainConnectionTimeoutMs
    The drain timeout in milliseconds. This is the time that we give the player to drain and read all remaining data when a connection is closed. If all data can be drained in time, the connection can potentially be re-used.

  - ### iptvReadTimeoutMs

    public final int iptvReadTimeoutMs
    The acquisition timeout in milliseconds for IPTV-UDP/RTP requests. Maximum total time a single IPTV Read request can take.

  - ### segmentsCallTimeoutMs

    public final int segmentsCallTimeoutMs
    Sets the Call timeout for segment requests including the request, redirect and response This only currently works with the OkHttp Plugin.

  - ### manifestRetryConfiguration

    @NonNull public final RetryConfiguration manifestRetryConfiguration
    The `RetryConfiguration` for manifest requests that will be to determine how often to retry after loading errors

  - ### segmentsRetryConfiguration

    @NonNull public final RetryConfiguration segmentsRetryConfiguration
    The `RetryConfiguration` for segment requests that will be to determine how often to retry after loading errors

  - ### drmRetryConfiguration

    @NonNull public final RetryConfiguration drmRetryConfiguration
    The `RetryConfiguration` for DRM requests that will be to determine how often to retry after loading errors

  - ### provisioningRetryConfiguration

    @NonNull public final RetryConfiguration provisioningRetryConfiguration
    The `RetryConfiguration` for provisioning requests that will be to determine how often to retry after loading errors

- ## Constructor Details

  - ### NetworkConfiguration

    public NetworkConfiguration()
    Creates a new NetworkConfiguration with default values.

- ## Method Details

  - ### readTimeoutMs

    public int readTimeoutMs(int requestType)
    Returns the read timeout for the given request type.
    Parameters:
      `requestType` - The request type
    Returns:
      The read timeout for the given request type

  - ### callTimeoutMs

    public int callTimeoutMs(int requestType)
    Returns the call timeout for the given request type.
    Parameters:
      `requestType` - The request type
    Returns:
      The Call timeout for the given request type

  - ### connectionTimeoutMs

    public int connectionTimeoutMs(int requestType)
    Returns the connection timeout for the given request type.
    Parameters:
      `requestType` - The request type
    Returns:
      The connection timeout for the given request type

  - ### describeContents

    public int describeContents()
    Specified by:
      `describeContents` in interface `Parcelable`

  - ### writeToParcel

    public void writeToParcel(Parcel dest, int flags)
    Specified by:
      `writeToParcel` in interface `Parcelable`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`