Package com.cloudinary.android.policy
Class TimeWindow
java.lang.Object
com.cloudinary.android.policy.TimeWindow
public class TimeWindow
extends java.lang.Object
Represents the time window in which the request must be executed. See
TimeWindow.Builder for details.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTimeWindow.BuilderConstructs aTimeWindowinstance -
Method Summary
Modifier and Type Method Description static TimeWindowgetDefault()longgetMaxExecutionDelayMillis()The maximum time to wait before a request must be executed regardless of the upload policy.longgetMinLatencyOffsetMillis()The minimum time to wait before executing a request.static TimeWindowimmediate()booleanisImmediate()Returns true if the time window is forcing a run within the next minute (i.e.booleanisStartNow()Returns true if the time window is scheduled to start within the next minute.TimeWindownewDeferredWindow(int minutes)Build a new deferred time window instance based on this instance.
-
Method Details
-
immediate
- Returns:
- An instance of
TimeWindowconfigured to execute a request immediately, ignoring policy constraints.
-
getDefault
- Returns:
- An instance of
TimeWindowwith default configuration.
-
getMinLatencyOffsetMillis
public long getMinLatencyOffsetMillis()The minimum time to wait before executing a request. This is defined as offset to current time. -
getMaxExecutionDelayMillis
public long getMaxExecutionDelayMillis()The maximum time to wait before a request must be executed regardless of the upload policy. This is defined as offset to current time. -
newDeferredWindow
Build a new deferred time window instance based on this instance.- Parameters:
minutes- Minutes to defer by- Returns:
- The new instance.
-
isStartNow
public boolean isStartNow()Returns true if the time window is scheduled to start within the next minute. -
isImmediate
public boolean isImmediate()Returns true if the time window is forcing a run within the next minute (i.e. ignoring policy constraints).
-