Class InMobiNetworkClientImpl
-
- All Implemented Interfaces:
-
com.inmobi.media.network.okhttp.InMobiNetworkClient
public final class InMobiNetworkClientImpl implements InMobiNetworkClient
Implementation of the InMobiNetworkClient interface. This class uses a ConnectionManager to handle network requests.
-
-
Constructor Summary
Constructors Constructor Description InMobiNetworkClientImpl(Array<Interceptor> interceptors, Array<Interceptor> networkInterceptors, Dispatcher dispatcher, TimeoutConfig timeoutConfig)
-
Method Summary
Modifier and Type Method Description NetworkResponsehitSync(NetworkRequest request)Executes the network operation synchronously. Deferred<NetworkResponse>hitAsync(NetworkRequest request)Executes the network operation asynchronously. final UnitsetConnection(ConnectionManager connection)Sets a new ConnectionManager for this client. -
-
Constructor Detail
-
InMobiNetworkClientImpl
InMobiNetworkClientImpl(Array<Interceptor> interceptors, Array<Interceptor> networkInterceptors, Dispatcher dispatcher, TimeoutConfig timeoutConfig)
- Parameters:
interceptors- An array of Interceptors to be added to the OkHttp client.timeoutConfig- Configuration for network timeouts.
-
-
Method Detail
-
hitSync
NetworkResponse hitSync(NetworkRequest request)
Executes the network operation synchronously.
- Parameters:
request- The NetworkRequest to be executed.- Returns:
NetworkResponse containing the response data.
-
hitAsync
Deferred<NetworkResponse> hitAsync(NetworkRequest request)
Executes the network operation asynchronously.
- Parameters:
request- The NetworkRequest to be executed.- Returns:
A Future representing the asynchronous result of the NetworkResponse.
-
setConnection
final Unit setConnection(ConnectionManager connection)
Sets a new ConnectionManager for this client. This method is intended for testing purposes.
- Parameters:
connection- The ConnectionManager to set.
-
-
-
-