public class AthleteServiceImpl extends StravaServiceImpl<AthleteAPI> implements AthleteService
Implementation of AthleteService
requestRate, requestRateDaily, restService| Modifier and Type | Method and Description |
|---|---|
StravaAthlete |
getAthlete(Integer id)
This request is used to retrieve information about any
athlete on Strava. |
StravaAthlete |
getAuthenticatedAthlete()
This request is used to retrieve information about the currently authenticated
athlete. |
static AthleteService |
instance(Token token)
Returns an instance of
athlete services |
List<StravaAthlete> |
listAllAthleteFriends(Integer athleteId)
Convenience method for returning ALL of an athlete's friends
|
List<StravaSegmentEffort> |
listAllAthleteKOMs(Integer athleteId)
Convenience method for returning ALL of an athlete's KOM's
|
List<StravaAthlete> |
listAllAthletesBothFollowing(Integer athleteId)
Convenience method for returning ALL of the athletes that both the authenticated athlete and the given athlete are following
|
List<StravaAthlete> |
listAllAuthenticatedAthleteFriends()
Convenience method for returning ALL of the authenticated athlete's friends
|
List<StravaAthlete> |
listAthleteFriends(Integer id)
Friends are users an
athlete is following. |
List<StravaAthlete> |
listAthleteFriends(Integer id,
Paging pagingInstruction)
Friends are users an
athlete is following. |
List<StravaSegmentEffort> |
listAthleteKOMs(Integer id)
Returns an array of
segment efforts representing KOMs/QOMs and course records held by the given athlete. |
List<StravaSegmentEffort> |
listAthleteKOMs(Integer id,
Paging pagingInstruction)
Returns an array of
segment efforts representing KOMs/QOMs and course records held by the given athlete. |
List<StravaAthlete> |
listAthletesBothFollowing(Integer id)
Retrieve the
athletes who both the authenticated athlete and the indicated athlete are following. |
List<StravaAthlete> |
listAthletesBothFollowing(Integer id,
Paging pagingInstruction)
Retrieve the
athletes who both the authenticated athlete and the indicated athlete are following. |
List<StravaAthlete> |
listAuthenticatedAthleteFriends()
Friends are users the current
athlete is following. |
List<StravaAthlete> |
listAuthenticatedAthleteFriends(Paging pagingInstruction)
Friends are users the current
athlete is following. |
StravaStatistics |
statistics(Integer id)
Returns recent (last 4 weeks), year to date and all time stats for a given athlete.
|
StravaAthlete |
updateAuthenticatedAthlete(String city,
String state,
String country,
StravaGender sex,
Float weight)
Updates the personal details of the currently authenticated
athlete. |
accessTokenIsValid, getToken, requestRateDailyPercentage, requestRatePercentagepublic static AthleteService instance(Token token)
Returns an instance of athlete services
Instances are cached so that if 2 requests are made for the same token, the same instance is returned
token - The Strava access token to be used in requests to the Strava APIpublic StravaAthlete getAuthenticatedAthlete()
AthleteService
This request is used to retrieve information about the currently authenticated athlete.
URL GET https://www.strava.com/api/v3/athlete
getAuthenticatedAthlete in interface AthleteServiceathleteAthleteService.getAuthenticatedAthlete()public StravaAthlete getAthlete(Integer id)
AthleteService
This request is used to retrieve information about any athlete on Strava.
Returns null if athlete does not exist
URL GET https://www.strava.com/api/v3/athletes/:id
getAthlete in interface AthleteServiceid - The id of the athlete to be returnedathlete even if the indicated athlete matches the authenticated athlete.AthleteService.getAthlete(java.lang.Integer)public StravaAthlete updateAuthenticatedAthlete(String city, String state, String country, StravaGender sex, Float weight)
AthleteService
Updates the personal details of the currently authenticated athlete.
Requires write permissions, as requested during the authorization process.
Only updates city, state, country, gender (sex) and weight.
URL PUT https://www.strava.com/api/v3/athlete
updateAuthenticatedAthlete in interface AthleteServicecity - The city where the athlete wants Strava to think they livestate - The state, county or whatever the athlete wants Strava to think they livecountry - The country where the athlete wants Strava to think they livesex - The gender the athlete wants Strava to think they identify withweight - The weight that the athlete wants Strava to believe that they areAthleteService.updateAuthenticatedAthlete(java.lang.String, java.lang.String, java.lang.String,
javastrava.api.v3.model.reference.StravaGender, java.lang.Float)public List<StravaSegmentEffort> listAthleteKOMs(Integer id, Paging pagingInstruction)
AthleteService
Returns an array of segment efforts representing KOMs/QOMs and course records held by the given athlete.
Results are sorted by date, newest first.
Pagination is supported.
Returns null if athlete with the given id is not found.
URL GET https://www.strava.com/api/v3/athletes/:id/koms
listAthleteKOMs in interface AthleteServiceid - The id of the athlete whose KOM's are to be returnedpagingInstruction - (Optional) The page to be returnedsegment effort summary representationsAthleteService.listAthleteKOMs(Integer, Paging)public List<StravaAthlete> listAuthenticatedAthleteFriends(Paging pagingInstruction)
AthleteService
Friends are users the current athlete is following. The activities owned by these users will appear in the current athlete's
activity feed.
This request is for the authenticated athlete's friends.
Pagination is supported.
URL GET https://www.strava.com/api/v3/athletes/friends
listAuthenticatedAthleteFriends in interface AthleteServicepagingInstruction - (Optional) The page to be returnedathlete summary representations.AthleteService.listAuthenticatedAthleteFriends(Paging)public List<StravaAthlete> listAthleteFriends(Integer id, Paging pagingInstruction)
AthleteService
Friends are users an athlete is following. The activities owned by these users will appear in the current athlete's activity feed.
If the indicated athlete has blocked the authenticated athlete, the result will be an empty array.
Pagination is supported.
Returns null if athlete with the given id is not found.
URL GET https://www.strava.com/api/v3/athletes/:id/friends
listAthleteFriends in interface AthleteServiceid - The id of the athlete whose friends are to be listedpagingInstruction - (Optional) The page to be returnedathletes who are friends of the identified athlete. Will be empty if the identified athlete has blocked the
currently authenticated athlete.AthleteService.listAthleteFriends(Integer, Paging)public List<StravaAthlete> listAthletesBothFollowing(Integer id, Paging pagingInstruction)
AthleteService
Retrieve the athletes who both the authenticated athlete and the indicated athlete are following.
Pagination is supported.
Returns null if athlete with the given id is not found.
URL GET https://www.strava.com/api/v3/athletes/:id/both-following
listAthletesBothFollowing in interface AthleteServiceid - The id of the athlete for whom the list of mutual friends is to be generatedpagingInstruction - (Optional) The page to be returnedathlete summary representations.AthleteService.listAthletesBothFollowing(Integer, Paging)public List<StravaSegmentEffort> listAthleteKOMs(Integer id)
AthleteService
Returns an array of segment efforts representing KOMs/QOMs and course records held by the given athlete.
Results are sorted by date, newest first.
Pagination is not supported.
Returns null if athlete with the given id is not found.
URL GET https://www.strava.com/api/v3/athletes/:id/koms
listAthleteKOMs in interface AthleteServiceid - The id of the athlete whose KOM's are to be returnedsegment effort summary representationsAthleteService.listAthleteKOMs(java.lang.Integer)public List<StravaAthlete> listAuthenticatedAthleteFriends()
AthleteService
Friends are users the current athlete is following. The activities owned by these users will appear in the current athlete's
activity feed.
This request is for the authenticated athlete's friends.
Pagination is not supported. Returns only the first page of athletes.
URL GET https://www.strava.com/api/v3/athletes/friends
listAuthenticatedAthleteFriends in interface AthleteServiceathlete summary representations.AthleteService.listAuthenticatedAthleteFriends()public List<StravaAthlete> listAthleteFriends(Integer id)
AthleteService
Friends are users an athlete is following. The activities owned by these users will appear in the current athlete's activity feed.
If the indicated athlete has blocked the authenticated athlete, the result will be an empty array.
Pagination is not supported. Returns only the first page of athletes.
Returns null if athlete with the given id is not found.
URL GET https://www.strava.com/api/v3/athletes/:id/friends
listAthleteFriends in interface AthleteServiceid - The id of the athlete whose friends are to be listedathletes who are friends of the identified athlete. Will be empty if the identified athlete has blocked the
currently authenticated athlete.AthleteService.listAthleteFriends(java.lang.Integer)public List<StravaAthlete> listAthletesBothFollowing(Integer id)
AthleteService
Retrieve the athletes who both the authenticated athlete and the indicated athlete are following.
Pagination is not supported. Returns only the first page of athletes.
Returns null if athlete with the given id is not found.
URL GET https://www.strava.com/api/v3/athletes/:id/both-following
listAthletesBothFollowing in interface AthleteServiceid - The id of the athlete for whom the list of mutual friends is to be generatedathlete summary representations.AthleteService.listAthletesBothFollowing(java.lang.Integer)public StravaStatistics statistics(Integer id)
AthleteServiceReturns recent (last 4 weeks), year to date and all time stats for a given athlete. Only available for the authenticated athlete.
This is the recommended endpoint when polling for athlete upload events.
Pagination is not supported. Returns all statistics for the athlete.
URL GET https://www.strava.com/api/v3/athletes/:id/stats
statistics in interface AthleteServiceid - The id of the athlete (must match authenticated athlete)AthleteService.statistics(Integer)public List<StravaAthlete> listAllAthleteFriends(Integer athleteId)
AthleteServiceConvenience method for returning ALL of an athlete's friends
Returns ALL the athlete's friends, regardless of how many there are
Pagination is NOT supported.
Returns null if athlete with the given id is not found.
USE WITH CAUTION - ATHLETES WITH MANY FRIENDS WILL REQUIRE MANY CALLS TO THE STRAVA API
URL GET https://www.strava.com/api/v3/athletes/:id/friends
listAllAthleteFriends in interface AthleteServiceathleteId - The athlete whose friends are to be listednull if the athlete does not existAthleteService.listAllAthleteFriends(java.lang.Integer)public List<StravaAthlete> listAllAuthenticatedAthleteFriends()
AthleteServiceConvenience method for returning ALL of the authenticated athlete's friends
Returns ALL the authenticated athlete's friends, regardless of how many there are
Pagination is NOT supported.
USE WITH CAUTION - ATHLETES WITH MANY FRIENDS WILL REQUIRE MANY CALLS TO THE STRAVA API
URL GET https://www.strava.com/api/v3/athletes/friends
listAllAuthenticatedAthleteFriends in interface AthleteServiceAthleteService.listAllAuthenticatedAthleteFriends()public List<StravaSegmentEffort> listAllAthleteKOMs(Integer athleteId)
AthleteServiceConvenience method for returning ALL of an athlete's KOM's
Returns ALL the athlete's KOM's, regardless of how many there are
Pagination is NOT supported.
Returns null if athlete with the given id is not found.
USE WITH CAUTION - ATHLETES WITH MANY KOMS WILL REQUIRE MANY CALLS TO THE STRAVA API
URL GET https://www.strava.com/api/v3/athletes/:id/koms
listAllAthleteKOMs in interface AthleteServiceathleteId - The athlete whose KOM'ss are to be listednull if the athlete does not existAthleteService.listAllAthleteKOMs(java.lang.Integer)public List<StravaAthlete> listAllAthletesBothFollowing(Integer athleteId)
AthleteServiceConvenience method for returning ALL of the athletes that both the authenticated athlete and the given athlete are following
Returns ALL the followers, regardless of how many there are
Pagination is NOT supported.
USE WITH CAUTION - ATHLETES WITH MANY FRIENDS WILL REQUIRE MANY CALLS TO THE STRAVA API
URL GET https://www.strava.com/api/v3/athletes/:id/both-following
listAllAthletesBothFollowing in interface AthleteServiceathleteId - The athlete who the list is to be generated forAthleteService.listAllAthletesBothFollowing(java.lang.Integer)Copyright © 2015 Dan Shannon. All rights reserved.