public class BoxAutoRefreshingSession
extends BoxSession
| Modifier and Type | Field and Description |
|---|---|
static long |
ACCESS_TOKEN_MAX_LIFE |
static long |
SUGGESTED_GRACE_PERIOD |
| Constructor and Description |
|---|
BoxAutoRefreshingSession(BoxSession session)
Convenience constructor that uses the suggested grace period of 1 minute.
|
BoxAutoRefreshingSession(BoxSession session,
long gracePeriod)
Creates a BoxSession that automatically refreshes when the access token is about to expire.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getDelayTillNextRefreshTime() |
void |
onAuthFailure(BoxAuthentication.BoxAuthenticationInfo info,
java.lang.Exception ex) |
void |
onLoggedOut(BoxAuthentication.BoxAuthenticationInfo info,
java.lang.Exception ex) |
void |
onRefreshed(BoxAuthentication.BoxAuthenticationInfo info) |
|
refresh() |
void |
startAutoRefreshing() |
void |
stopAutoRefreshing() |
public static final long ACCESS_TOKEN_MAX_LIFE
public static long SUGGESTED_GRACE_PERIOD
public BoxAutoRefreshingSession(BoxSession session)
session - a session to copy values from.public BoxAutoRefreshingSession(BoxSession session,
long gracePeriod)
session - a session to copy data from.gracePeriod - an amount of time in milliseconds to refresh before estimated expiration time.public long getDelayTillNextRefreshTime()
public void startAutoRefreshing()
public void stopAutoRefreshing()
publicrefresh()
public void onRefreshed(BoxAuthentication.BoxAuthenticationInfo info)
public void onAuthFailure(BoxAuthentication.BoxAuthenticationInfo info,
java.lang.Exception ex)
public void onLoggedOut(BoxAuthentication.BoxAuthenticationInfo info,
java.lang.Exception ex)