T - The class of retrofit interface to be createdpublic abstract class StravaServiceImpl<T> extends Object
Base class for all implementations of Strava services
| Modifier and Type | Field and Description |
|---|---|
static int |
requestRate
Current request rate over the last 15 minutes
|
static int |
requestRateDaily
Current request rate over the last day
|
protected T |
restService |
| Modifier | Constructor and Description |
|---|---|
protected |
StravaServiceImpl(Class<T> class1,
Token token)
Protected constructor prevents user from getting a service instance without a valid token
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accessTokenIsValid()
Work out if the access token is valid (i.e.
|
protected Token |
getToken() |
static float |
requestRateDailyPercentage()
Calculates the percentage of the daily request limit that has been used, issues a warning if required
|
static float |
requestRatePercentage()
Calculates the percentage of the per-15-minute request limit that has been used, issues a warning if required
|
public static int requestRate
public static int requestRateDaily
protected final T restService
protected StravaServiceImpl(Class<T> class1, Token token)
Protected constructor prevents user from getting a service instance without a valid token
class1 - The class of the service implementation being createdtoken - The access token to be used to authenticate to the Strava APIpublic static float requestRatePercentage()
public static float requestRateDailyPercentage()
protected boolean accessTokenIsValid()
Work out if the access token is valid (i.e. has not been revoked)
true if the token can be used to get the authenticated athlete, false otherwiseprotected final Token getToken()
Copyright © 2015 Dan Shannon. All rights reserved.