Package com.castlabs.android.network
Class NetworkConfiguration
java.lang.Object
com.castlabs.android.network.NetworkConfiguration
- All Implemented Interfaces:
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 ClassesNested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Parcelable.Creator<NetworkConfiguration> Creator used by the Parcelable implementationfinal intThe connection timeout in milliseconds for DASH callbacksfinal intThe read timeout in milliseconds for DASH callbacksstatic final intThe default read timeout, in milliseconds.static final intThe default connection timeout, in milliseconds.static intThe timeout to use while discarding a download of input data.static final intThe default DRM acquisition timeout specific to DRM schemestatic final intThe default DRM connection timeout specific to DRM schemestatic final intThe default DRM read timeout specific to DRM schemestatic final intThe default read timeout, in milliseconds.static final intThe default thumbnail connection timeout, in milliseconds.static final intThe default thumbnail read timeout, in milliseconds.final intThe drain timeout in milliseconds.final intThe acquisition timeout in milliseconds for DRM requests.final intThe connection timeout in milliseconds for DRM requestsfinal intThe read timeout in milliseconds for DRM requestsfinal RetryConfigurationTheRetryConfigurationfor DRM requests that will be to determine how often to retry after loading errorsfinal intThe acquisition timeout in milliseconds for IPTV-UDP/RTP requests.final intThe connection timeout in milliseconds for manifest requestsfinal intThe read timeout in milliseconds for manifest requestsfinal RetryConfigurationTheRetryConfigurationfor manifest requests that will be to determine how often to retry after loading errorsfinal RetryConfigurationTheRetryConfigurationfor provisioning requests that will be to determine how often to retry after loading errorsfinal intSets the Call timeout for segment requests including the request, redirect and response This only currently works with the OkHttp Plugin.final intThe connection timeout in milliseconds for segment requestsfinal intThe read timeout in milliseconds for segment requestsfinal RetryConfigurationTheRetryConfigurationfor segment requests that will be to determine how often to retry after loading errorsfinal intThe connection timeout in milliseconds for thumbnail requests.final intThe read timeout in milliseconds for thumbnail requests.Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new NetworkConfiguration with default values. -
Method Summary
Modifier and TypeMethodDescriptionintcallTimeoutMs(int requestType) Returns the call timeout for the given request type.intconnectionTimeoutMs(int requestType) Returns the connection timeout for the given request type.intbooleaninthashCode()intreadTimeoutMs(int requestType) Returns the read timeout for the given request type.toString()voidwriteToParcel(Parcel dest, int flags)
-
Field Details
-
DEFAULT_CONNECT_TIMEOUT_MILLIS
public static final int DEFAULT_CONNECT_TIMEOUT_MILLISThe default connection timeout, in milliseconds.- See Also:
-
DEFAULT_READ_TIMEOUT_MILLIS
public static final int DEFAULT_READ_TIMEOUT_MILLISThe default read timeout, in milliseconds.- See Also:
-
DEFAULT_CALL_TIMEOUT_MILLIS
public static final int DEFAULT_CALL_TIMEOUT_MILLISThe default read timeout, in milliseconds.- See Also:
-
DEFAULT_DRM_CONNECT_TIMEOUT_MILLIS
public static final int DEFAULT_DRM_CONNECT_TIMEOUT_MILLISThe default DRM connection timeout specific to DRM scheme- See Also:
-
DEFAULT_DRM_READ_TIMEOUT_MILLIS
public static final int DEFAULT_DRM_READ_TIMEOUT_MILLISThe default DRM read timeout specific to DRM scheme- See Also:
-
DEFAULT_DRM_ACQUISITION_TIMEOUT_MILLIS
public static final int DEFAULT_DRM_ACQUISITION_TIMEOUT_MILLISThe default DRM acquisition timeout specific to DRM scheme- See Also:
-
DEFAULT_THUMBNAIL_CONNECT_TIMEOUT_MILLIS
public static final int DEFAULT_THUMBNAIL_CONNECT_TIMEOUT_MILLISThe default thumbnail connection timeout, in milliseconds.- See Also:
-
DEFAULT_THUMBNAIL_READ_TIMEOUT_MILLIS
public static final int DEFAULT_THUMBNAIL_READ_TIMEOUT_MILLISThe default thumbnail read timeout, in milliseconds.- See Also:
-
DEFAULT_DRAIN_CONNECTION_TIMEOUT_MS
public static int DEFAULT_DRAIN_CONNECTION_TIMEOUT_MSThe 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
Creator used by the Parcelable implementation -
manifestConnectionTimeoutMs
public final int manifestConnectionTimeoutMsThe connection timeout in milliseconds for manifest requests -
segmentsConnectionTimeoutMs
public final int segmentsConnectionTimeoutMsThe connection timeout in milliseconds for segment requests -
drmConnectionTimeoutMs
public final int drmConnectionTimeoutMsThe connection timeout in milliseconds for DRM requests -
dashCallbackConnectionTimeoutMs
public final int dashCallbackConnectionTimeoutMsThe connection timeout in milliseconds for DASH callbacks -
thumbnailConnectionTimeoutMs
public final int thumbnailConnectionTimeoutMsThe connection timeout in milliseconds for thumbnail requests. This timeout is used only if the ThumbsPlugin is registered. -
manifestReadTimeoutMs
public final int manifestReadTimeoutMsThe read timeout in milliseconds for manifest requests -
segmentsReadTimeoutMs
public final int segmentsReadTimeoutMsThe read timeout in milliseconds for segment requests -
drmReadTimeoutMs
public final int drmReadTimeoutMsThe read timeout in milliseconds for DRM requests -
dashCallbackReadTimeoutMs
public final int dashCallbackReadTimeoutMsThe read timeout in milliseconds for DASH callbacks -
thumbnailReadTimeoutMs
public final int thumbnailReadTimeoutMsThe read timeout in milliseconds for thumbnail requests. This timeout is used only if the ThumbsPlugin is registered. -
drmAcquisitionTimeoutMs
public final int drmAcquisitionTimeoutMsThe acquisition timeout in milliseconds for DRM requests. Maximum total time a single DRM request can take. -
drainConnectionTimeoutMs
public final int drainConnectionTimeoutMsThe 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 iptvReadTimeoutMsThe acquisition timeout in milliseconds for IPTV-UDP/RTP requests. Maximum total time a single IPTV Read request can take. -
segmentsCallTimeoutMs
public final int segmentsCallTimeoutMsSets the Call timeout for segment requests including the request, redirect and response This only currently works with the OkHttp Plugin. -
manifestRetryConfiguration
TheRetryConfigurationfor manifest requests that will be to determine how often to retry after loading errors -
segmentsRetryConfiguration
TheRetryConfigurationfor segment requests that will be to determine how often to retry after loading errors -
drmRetryConfiguration
TheRetryConfigurationfor DRM requests that will be to determine how often to retry after loading errors -
provisioningRetryConfiguration
TheRetryConfigurationfor 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:
describeContentsin interfaceParcelable
-
writeToParcel
- Specified by:
writeToParcelin interfaceParcelable
-
hashCode
public int hashCode() -
equals
-
toString
-