-
- All Implemented Interfaces:
-
java.util.concurrent.Callable,kotlin.Comparable
public abstract class HttpTask<Result extends Object> extends Task<Response<Result>>
Base task for any work that talks to an HTTP backend. Wraps the standard Task lifecycle with:
dev-key and SDK-stopped guards (see
AppsFlyerLib.stop(boolean, Context));building and executing the underlying Call (provided by createHttpCall);
best-effort disk caching of the outbound request so it can be retried on the next launch if the process is killed before it lands;
listener notifications via getRequestListener for success, response-code failure, missing dev key, SDK-stopped and network-level errors.
Caching follows the contract advertised by shouldCacheRequest — subclasses that carry session-scoped state (e.g. SendRegisterTask) MUST return
false.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classHttpTask.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Response<Result>resultprivate final Set<TaskType>dependenciesprivate final Set<TaskType>softDependenciesprivate final Integerorderprivate LongexecutionTimeprivate ThrowableexecutionErrorprivate volatile IntegerretryCountprivate final TaskTypetype
-
Method Summary
Modifier and Type Method Description Response<Result>getResult()final Set<TaskType>getDependencies()final Set<TaskType>getSoftDependencies()final IntegergetOrder()Chronological order in which the task object was created. final LonggetExecutionTime()final UnitsetExecutionTime(Long executionTime)final ThrowablegetExecutionError()Error which happened during task execution, or nullif the task was successful.final UnitsetExecutionError(Throwable executionError)final IntegergetRetryCount()Number of times the task was executed, INCLUDING the initial try. final UnitsetRetryCount(Integer retryCount)final TaskTypegetType()-
Methods inherited from class com.appsflyer.internal.components.queue.tasks.HttpTask
addDependency, addSoftDependency, call, compareTo, equals, executionResult, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getDependencies
final Set<TaskType> getDependencies()
-
getSoftDependencies
final Set<TaskType> getSoftDependencies()
-
getOrder
final Integer getOrder()
Chronological order in which the task object was created. Required to support natural ordering in the Queue SkipListSet: two tasks of the same type and priority — the first one has the smaller order.
-
getExecutionTime
final Long getExecutionTime()
-
setExecutionTime
final Unit setExecutionTime(Long executionTime)
-
getExecutionError
final Throwable getExecutionError()
Error which happened during task execution, or
nullif the task was successful.
-
setExecutionError
final Unit setExecutionError(Throwable executionError)
-
getRetryCount
final Integer getRetryCount()
Number of times the task was executed, INCLUDING the initial try. E.g. if the task succeeded on the first try this returns 1.
-
setRetryCount
final Unit setRetryCount(Integer retryCount)
-
-
-
-