Interface LoadErrorHandlingPolicy

    • Method Detail

      • getBlacklistDurationMsFor

        default long getBlacklistDurationMsFor​(LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo)
        Returns the number of milliseconds for which a resource associated to a provided load error should be excluded, or C.TIME_UNSET if the resource should not be excluded.
        Parameters:
        loadErrorInfo - A LoadErrorHandlingPolicy.LoadErrorInfo holding information about the load error.
        Returns:
        The exclusion duration in milliseconds, or C.TIME_UNSET if the resource should not be excluded.
      • getRetryDelayMsFor

        default long getRetryDelayMsFor​(LoadErrorHandlingPolicy.LoadErrorInfo loadErrorInfo)
        Returns the number of milliseconds to wait before attempting the load again, or C.TIME_UNSET if the error is fatal and should not be retried.

        Loaders may ignore the retry delay returned by this method in order to wait for a specific event before retrying. However, the load is retried if and only if this method does not return C.TIME_UNSET.

        Parameters:
        loadErrorInfo - A LoadErrorHandlingPolicy.LoadErrorInfo holding information about the load error.
        Returns:
        The number of milliseconds to wait before attempting the load again, or C.TIME_UNSET if the error is fatal and should not be retried.
      • onLoadTaskConcluded

        default void onLoadTaskConcluded​(long loadTaskId)
        Called once loadTaskId will not be associated with any more load errors.

        Implementations should clean up any resources associated with loadTaskId when this method is called.

      • getMinimumLoadableRetryCount

        int getMinimumLoadableRetryCount​(int dataType)
        Returns the minimum number of times to retry a load in the case of a load error, before propagating the error.
        Parameters:
        dataType - One of the C.DATA_TYPE_* constants indicating the type of data to load.
        Returns:
        The minimum number of times to retry a load in the case of a load error, before propagating the error.
        See Also:
        Loader.startLoading(Loadable, Callback, int)