NetworkUtilities

class NetworkUtilities(connectivity: Connectivity, val networkClient: NetworkClient, val networkHelper: NetworkHelper, logger: Logger) : Connectivity

Utility class to group networking utilities onto a single object for a given com.tealium.prism.core.Tealium instance

The shared networkClient and networkHelper make a single attempt per request. To retry failed requests, derive a client with NetworkClient.newClient, adding RequestInterceptors.retryWithBackoff and/or RequestInterceptors.retryWhenConnected, and wrap it with NetworkClient.makeNetworkHelper for the NetworkHelper API.

Parameters

connectivity

The connectivity provider

networkClient

The shared NetworkClient for this instance; it makes a single attempt per request

networkHelper

The shared NetworkHelper for this instance; it makes a single attempt per request

Constructors

Link copied to clipboard
constructor(connectivity: Connectivity, networkClient: NetworkClient, networkHelper: NetworkHelper, logger: Logger)

Properties

Link copied to clipboard

Observable flow of connectivity statuses, enabling reactivity to network status changes

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Utility to return the capability of the current active network.

Link copied to clipboard
open override fun isConnected(): Boolean

Signifies whether the device has a network available for making outbound connections.

Link copied to clipboard
Link copied to clipboard

Creates a ResourceRefresher that will regularly fetch updated values from a remote source as specified in the given parameters.

Creates a ResourceRefresher that will regularly fetch updated values from a remote source as specified in the given parameters, through the given networkHelper.