Class LoadResponseState
-
- All Implemented Interfaces:
-
com.inmobi.media.ads.common.base.state.State,com.inmobi.media.ads.common.listeners.AUMDestroyListener,com.inmobi.media.ads.common.listeners.InternalLoadTimeoutListener
public abstract class LoadResponseState extends AdManagerComponentWrapper implements State, InternalLoadTimeoutListener, AUMDestroyListener
Represents the state when processing a pre-existing ad response for loading.
This abstract state handles the processing of ad response data that was provided directly rather than fetched from the server. It validates the response data, processes it using ABAdResponseManager, and handles various failure scenarios. The state manages timeout events and coordinates with AdFetchEventHelper to track processing events. Upon successful processing, it transitions to the next appropriate state, while failures result in transitions to failed states.
-
-
Field Summary
Fields Modifier and Type Field Description private final ContextapplicationContextprivate final AdManagerContextadManagerContextprivate final CoroutineScopeadManagerScopeprivate final AdConfigadConfigprivate final PubSettingspubSettingsprivate final InMobiLoggerloggerprivate final AdLifecycleDataadLifecycleDataprivate final AdManagerTelemetryHelperadManagerTelemetryHelper
-
Constructor Summary
Constructors Constructor Description LoadResponseState(ByteArray response, AdManagerComponent adManagerComponent, AdUnitTimeoutManager adUnitTimeout, PublisherCallbacks publisherCallbacks, AUMStateMachine stateMachine)
-
Method Summary
Modifier and Type Method Description Unitinitialize()Initializes the load response state and begins processing the ad response. UnitcleanUp()Finalizes the state and cancels the child coroutine scope. UnitonInternalLoadTimeout()Handles internal load timeout events during response processing. UnitonDestroy()Handles destruction of the ad unit manager. -
Methods inherited from class com.inmobi.media.ads.context.wrapper.AdManagerComponentWrapper
getAdConfig, getAdLifecycleData, getAdManagerContext, getAdManagerScope, getAdManagerTelemetryHelper, getApplicationContext, getLogger, getPubSettings -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
LoadResponseState
LoadResponseState(ByteArray response, AdManagerComponent adManagerComponent, AdUnitTimeoutManager adUnitTimeout, PublisherCallbacks publisherCallbacks, AUMStateMachine stateMachine)
-
-
Method Detail
-
initialize
Unit initialize()
Initializes the load response state and begins processing the ad response.
This method validates the response data and processes it using ABAdResponseManager. If the response is null or empty, it immediately fails. Otherwise, it processes the response asynchronously, handling both successful parsing and various failure scenarios through exception handling.
-
onInternalLoadTimeout
Unit onInternalLoadTimeout()
Handles internal load timeout events during response processing.
This method transitions to FetchFailedState with timeout error codes when processing takes too long.
-
onDestroy
Unit onDestroy()
Handles destruction of the ad unit manager.
Transitions to DestroyedState for proper cleanup.
-
-
-
-