public static final class CocoClient.ConnectivityTimers
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_BACKGROUND_MAX_RETRY_PERIOD
default time in seconds for
backgroundMaxRetryPeriod. |
static long |
DEFAULT_FAST_RETRY_DURATION
default time in seconds for
fastRetryDuration. |
static long |
DEFAULT_FOREGROUND_MAX_RETRY_PERIOD
default time in seconds for
foregroundMaxRetryPeriod. |
static long |
DEFAULT_KEEP_ALIVE_INTERVAL
default time in seconds for
keepAliveInterval. |
static long |
DEFAULT_KEEP_ALIVE_TIMEOUT
default time in seconds for
keepAliveTimeout. |
| Constructor and Description |
|---|
ConnectivityTimers()
Empty constructor that initializes default timers.
|
ConnectivityTimers(long fastRetryDuration,
long backgroundMaxRetryPeriod,
long foregroundMaxRetryPeriod,
long keepAliveInterval,
long keepAliveTimeout)
Overloaded constructor for a developer to set customized timers.
|
| Modifier and Type | Method and Description |
|---|---|
CocoClient.ConnectivityTimers |
toBackgroundMaxRetryPeriod(long backgroundMaxRetryPeriod)
Get a new timer with just the background retry period changed.
|
CocoClient.ConnectivityTimers |
toFastRetryDuration(long fastRetryDuration)
Get a new timer with just the retry duration changed.
|
CocoClient.ConnectivityTimers |
toForegroundMaxRetryPeriod(long foregroundMaxRetryPeriod)
Get a new timer with just the foreground retry period changed.
|
CocoClient.ConnectivityTimers |
toKeepAliveInterval(long keepAliveInterval)
Get a new timer with just the keep alive interval changed.
|
CocoClient.ConnectivityTimers |
toKeepAliveTimeout(long keepAliveTimeout)
Get a new timer with just the keep alive timeout changed.
|
public static final long DEFAULT_FAST_RETRY_DURATION
fastRetryDuration.public static final long DEFAULT_BACKGROUND_MAX_RETRY_PERIOD
backgroundMaxRetryPeriod.public static final long DEFAULT_FOREGROUND_MAX_RETRY_PERIOD
foregroundMaxRetryPeriod.public static final long DEFAULT_KEEP_ALIVE_TIMEOUT
keepAliveTimeout.public static final long DEFAULT_KEEP_ALIVE_INTERVAL
keepAliveInterval.public ConnectivityTimers()
public ConnectivityTimers(long fastRetryDuration,
long backgroundMaxRetryPeriod,
long foregroundMaxRetryPeriod,
long keepAliveInterval,
long keepAliveTimeout)
fastRetryDuration - non-negative integer after which SDK will connect to other nodesbackgroundMaxRetryPeriod - interval when the app is in background connectivity modeforegroundMaxRetryPeriod - interval when the app is in foreground connectivity modekeepAliveInterval - SDK nodes will send a keep alive packet at keepAliveInterval secondskeepAliveTimeout - the timeout in seconds for which SDK will waitpublic CocoClient.ConnectivityTimers toFastRetryDuration(long fastRetryDuration)
fastRetryDuration - The new fastRetryDuration to usepublic CocoClient.ConnectivityTimers toBackgroundMaxRetryPeriod(long backgroundMaxRetryPeriod)
backgroundMaxRetryPeriod - The new backgroundMaxRetryPeriod to usepublic CocoClient.ConnectivityTimers toForegroundMaxRetryPeriod(long foregroundMaxRetryPeriod)
foregroundMaxRetryPeriod - The new foregroundMaxRetryPeriod to usepublic CocoClient.ConnectivityTimers toKeepAliveInterval(long keepAliveInterval)
keepAliveInterval - The new keepAliveInterval to usepublic CocoClient.ConnectivityTimers toKeepAliveTimeout(long keepAliveTimeout)
keepAliveTimeout - The new keepAliveTimeout to use