public abstract class StravaServiceImpl extends Object
Base class for all implementations of Strava services
| Modifier and Type | Field and Description |
|---|---|
protected API |
api
API instance in use
|
static int |
requestRate
Current request rate over the last 15 minutes
|
static int |
requestRateDaily
Current request rate over the last day
|
| Modifier | Constructor and Description |
|---|---|
protected |
StravaServiceImpl(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 static <T> CompletableFuture<T> |
future(AsyncCallback<T> callback) |
protected Token |
getToken()
Get the Strava access token associated with this service
|
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 API api
protected StravaServiceImpl(Token token)
Protected constructor prevents user from getting a service instance without a valid token
token - The access token to be used to authenticate to the Strava APIprotected static <T> CompletableFuture<T> future(AsyncCallback<T> callback)
T - Type which will be returned by the futurecallback - Callback with code to be executedCompletableFuturepublic static float requestRateDailyPercentage()
public static float requestRatePercentage()
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 © 2016 Dan Shannon. All rights reserved.