public class SegmentServiceImpl extends StravaServiceImpl<SegmentAPI> implements SegmentService
Implementation of SegmentService
requestRate, requestRateDaily, restServiceaccessTokenIsValid, getToken, requestRateDailyPercentage, requestRatePercentagepublic static SegmentService instance(Token token)
Returns an instance of gear 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 StravaSegment getSegment(Integer id)
SegmentService
Retrieve details about a specific segment.
URL GET https://www.strava.com/api/v3/segments/:id
Returns null if the segment does not exist
getSegment in interface SegmentServiceid - The id of the StravaSegment to be retrieveddetailed representation of the StravaSegment.SegmentService.getSegment(java.lang.Integer)public List<StravaSegment> listAuthenticatedAthleteStarredSegments(Paging pagingInstruction)
SegmentService
Returns a summary representation of the segments starred by the authenticated
athlete.
Pagination is supported.
URL GET https://www.strava.com/api/v3/segments/starred
listAuthenticatedAthleteStarredSegments in interface SegmentServicepagingInstruction - (Optional) paging instructionssummary representation of the segments starred by the authenticated
StravaAthlete.SegmentService.listAuthenticatedAthleteStarredSegments(Paging)public List<StravaSegment> listStarredSegments(Integer id, Paging pagingInstruction)
SegmentService
Returns a summary representation of the segments starred by the identified
athlete.
Pagination is supported.
Returns null if the athlete with the given id does not exist.
URL GET https://www.strava.com/api/v3/segments/starred
listStarredSegments in interface SegmentServiceid - Identifier of the StravaAthlete for which starred segments are to be returnedpagingInstruction - (Optional) paging instructionssummary representation of the segments starred by the identified
StravaAthlete.SegmentService.listStarredSegments(Integer, Paging)public List<StravaSegmentEffort> listSegmentEfforts(Integer id, Integer athleteId, Calendar startDateLocalTZ, Calendar endDateLocalTZ, Paging pagingInstruction)
SegmentService
Retrieve an array of segment efforts, for a given StravaSegment, filtered by StravaAthlete and/or a date
range.
Filtering parameters, like athlete_id, start_date_local and end_date_local, are optional. If they are not provided all efforts for the segment will be returned.
Date range filtering is accomplished using an inclusive start and end time, thus start_date_local and end_date_local must be sent together. For open ended ranges pick dates significantly in the past or future. The filtering is done over local time for the segment, so there is no need for timezone conversion. For example, all efforts on Jan. 1st, 2014 for a segment in San Francisco, CA can be fetched using 2014-01-01T00:00:00Z and 2014-01-01T23:59:59Z.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
listSegmentEfforts in interface SegmentServiceid - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystartDateLocalTZ - (Optional) ISO 8601 formatted date timeendDateLocalTZ - (Optional) ISO 8601 formatted date timepagingInstruction - (Optional) Page to start at for pagination / number of results per pagesegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.SegmentService.listSegmentEfforts(Integer, Integer, Calendar, Calendar, Paging)public StravaSegmentLeaderboard getSegmentLeaderboard(Integer id, StravaGender gender, StravaAgeGroup ageGroup, StravaWeightClass weightClass, Boolean following, Integer clubId, StravaLeaderboardDateRange dateRange, Paging pagingInstruction, Integer contextEntries)
SegmentService
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
getSegmentLeaderboard in interface SegmentServiceid - The id of the segment to return a leaderboard forgender - (Optional) StravaGender to filter results byageGroup - (Optional) Age group to filter results byweightClass - (Optional) Weight class to filter results byfollowing - (Optional) If true then will return only results for athletes that the currently authenticated athlete is
followingclubId - (Optional) Id of StravaClub to filter results bydateRange - (Optional) Use to set to return results for this year, this month, this week etc.pagingInstruction - (Optional) Page to start at for paginationcontextEntries - (Optional) number of entries to return as athlete context either side of the athlete (default is 2, maximum is 15)leaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.SegmentService.getSegmentLeaderboard(Integer, StravaGender, StravaAgeGroup, StravaWeightClass, Boolean, Integer,
StravaLeaderboardDateRange, Paging, Integer)public StravaSegmentExplorerResponse segmentExplore(StravaMapPoint southwestCorner, StravaMapPoint northeastCorner, StravaSegmentExplorerActivityType activityType, StravaClimbCategory minCat, StravaClimbCategory maxCat)
SegmentServiceThis endpoint can be used to find popular segments within a given area (defined by the southwest and northeast corners of the area).
Pagination is not supported. Returns up to 10 segments only.
URL GET https://www.strava.com/api/v3/segments/explore
segmentExplore in interface SegmentServicesouthwestCorner - The southwest corner of the area to be explorednortheastCorner - The northeast corner of the area to be exploredactivityType - (Optional) "running" or "riding", default is ridingminCat - (Optional) Minimum climb category filtermaxCat - (Optional) Maximum climb category filterSegmentService.segmentExplore(StravaMapPoint, StravaMapPoint, StravaSegmentExplorerActivityType, StravaClimbCategory,
StravaClimbCategory)public List<StravaSegment> listAuthenticatedAthleteStarredSegments()
SegmentService
Returns a summary representation of the segments starred by the authenticated
athlete.
Pagination is NOT supported. Returns only the first page of segments.
URL GET https://www.strava.com/api/v3/segments/starred
listAuthenticatedAthleteStarredSegments in interface SegmentServicesummary representation of the segments starred by the authenticated
StravaAthlete.SegmentService.listAuthenticatedAthleteStarredSegments()public List<StravaSegment> listStarredSegments(Integer id)
SegmentService
Returns a summary representation of the segments starred by the identified
athlete.
Pagination is NOT supported. Returns only the first page of segments
Returns null if the athlete with the given id does not exist.
URL GET https://www.strava.com/api/v3/segments/starred
listStarredSegments in interface SegmentServiceid - Identifier of the StravaAthlete for which starred segments are to be returnedsummary representation of the segments starred by the identified
StravaAthlete.SegmentService.listStarredSegments(java.lang.Integer)public List<StravaSegmentEffort> listSegmentEfforts(Integer id, Integer athleteId, Calendar startDateLocal, Calendar endDateLocal)
SegmentService
Retrieve an array of segment efforts, for a given StravaSegment, filtered by StravaAthlete and/or a date
range.
Filtering parameters, like athlete_id, start_date_local and end_date_local, are optional. If they are not provided all efforts for the segment will be returned.
Date range filtering is accomplished using an inclusive start and end time, thus start_date_local and end_date_local must be sent together. For open ended ranges pick dates significantly in the past or future. The filtering is done over local time for the segment, so there is no need for timezone conversion. For example, all efforts on Jan. 1st, 2014 for a segment in San Francisco, CA can be fetched using 2014-01-01T00:00:00Z and 2014-01-01T23:59:59Z.
Pagination is NOT supported. Returns only the first page of segment efforts.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
listSegmentEfforts in interface SegmentServiceid - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystartDateLocal - (Optional) ISO 8601 formatted date timeendDateLocal - (Optional) ISO 8601 formatted date timesegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.SegmentService.listSegmentEfforts(java.lang.Integer, java.lang.Integer, java.util.Calendar, java.util.Calendar)public List<StravaSegmentEffort> listSegmentEfforts(Integer id, Paging pagingInstruction)
SegmentService
Retrieve an array of segment efforts, for a given StravaSegment.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
listSegmentEfforts in interface SegmentServiceid - The id of the StravaSegment for which segment efforts are to be returnedpagingInstruction - (Optional) paging parameterssegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.SegmentService.listSegmentEfforts(java.lang.Integer, javastrava.util.Paging)public List<StravaSegmentEffort> listSegmentEfforts(Integer id)
SegmentService
Retrieve an array of segment efforts, for a given StravaSegment.
Pagination is NOT supported. Returns only the first page of segment efforts.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
listSegmentEfforts in interface SegmentServiceid - The id of the StravaSegment for which segment efforts are to be returnedsegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.SegmentService.listSegmentEfforts(java.lang.Integer)public StravaSegmentLeaderboard getSegmentLeaderboard(Integer id, Paging pagingInstruction)
SegmentService
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is supported.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
getSegmentLeaderboard in interface SegmentServiceid - The id of the segment to return a leaderboard forpagingInstruction - (Optional) Page number, Number of results per page (max 200)leaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.SegmentService.getSegmentLeaderboard(java.lang.Integer, javastrava.util.Paging)public StravaSegmentLeaderboard getSegmentLeaderboard(Integer id)
SegmentService
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is NOT supported. Returns only the first page of leaderboard entries.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
getSegmentLeaderboard in interface SegmentServiceid - The id of the segment to return a leaderboard forleaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.SegmentService.getSegmentLeaderboard(java.lang.Integer)public List<StravaSegment> listAllAuthenticatedAthleteStarredSegments()
SegmentService
Returns a summary representation of ALL the segments starred by the authenticated
athlete.
Pagination is NOT supported.
URL GET https://www.strava.com/api/v3/segments/starred
listAllAuthenticatedAthleteStarredSegments in interface SegmentServicesummary representation of the segments starred by the authenticated
StravaAthlete.SegmentService.listAllAuthenticatedAthleteStarredSegments()public List<StravaSegment> listAllStarredSegments(Integer athleteId)
SegmentService
Returns a summary representation of ALL the segments starred by the identified
athlete.
Pagination is NOT supported. Returns ALL starred segments.
Returns null if the athlete with the given id does not exist.
URL GET https://www.strava.com/api/v3/segments/starred
listAllStarredSegments in interface SegmentServiceathleteId - Identifier of the StravaAthlete for which starred segments are to be returnedsummary representation of the segments starred by the identified
StravaAthlete.SegmentService.listAllStarredSegments(java.lang.Integer)public StravaSegmentLeaderboard getAllSegmentLeaderboard(Integer segmentId)
SegmentService
Leaderboards represent the ranking of athletes on specific segments.
Pagination is NOT supported. Returns THE ENTIRE leaderboard.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
getAllSegmentLeaderboard in interface SegmentServicesegmentId - The id of the segment to return a leaderboard forleaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.SegmentService.getAllSegmentLeaderboard(java.lang.Integer)public StravaSegmentLeaderboard getAllSegmentLeaderboard(Integer segmentId, StravaGender gender, StravaAgeGroup ageGroup, StravaWeightClass weightClass, Boolean following, Integer clubId, StravaLeaderboardDateRange dateRange)
SegmentService
Leaderboards represent the ranking of athletes on specific segments.
Filter by age_group and weight_class is only allowed if the authenticated athlete is a Strava premium member.
Pagination is NOT supported. Returns the ENTIRE leaderboard.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/leaderboard
getAllSegmentLeaderboard in interface SegmentServicesegmentId - The id of the segment to return a leaderboard forgender - (Optional) StravaGender to filter results byageGroup - (Optional) Age group to filter results byweightClass - (Optional) Weight class to filter results byfollowing - (Optional) If true then will return only results for athletes that the currently authenticated athlete is
followingclubId - (Optional) Id of StravaClub to filter results bydateRange - (Optional) Use to set to return results for this year, this month, this week etc.leaderboard entry objects. Note that effort ids should be
considered 64-bit integers and effort_count is deprecated, use entry_count instead.SegmentService.getAllSegmentLeaderboard(java.lang.Integer, javastrava.api.v3.model.reference.StravaGender, javastrava.api.v3.model.reference.StravaAgeGroup, javastrava.api.v3.model.reference.StravaWeightClass, java.lang.Boolean, java.lang.Integer, javastrava.api.v3.model.reference.StravaLeaderboardDateRange)public List<StravaSegmentEffort> listAllSegmentEfforts(Integer segmentId)
SegmentService
Retrieve an array of segment efforts, for a given StravaSegment.
Pagination is NOT supported. Returns ALL segment efforts.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
listAllSegmentEfforts in interface SegmentServicesegmentId - The id of the StravaSegment for which segment efforts are to be returnedsegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.SegmentService.listAllSegmentEfforts(java.lang.Integer)public List<StravaSegmentEffort> listAllSegmentEfforts(Integer segmentId, Integer athleteId, Calendar startDate, Calendar endDate)
SegmentService
Retrieve an array of segment efforts, for a given StravaSegment, filtered by StravaAthlete and/or a date
range.
Filtering parameters, like athlete_id, start_date_local and end_date_local, are optional. If they are not provided all efforts for the segment will be returned.
Date range filtering is accomplished using an inclusive start and end time, thus start_date_local and end_date_local must be sent together. For open ended ranges pick dates significantly in the past or future. The filtering is done over local time for the segment, so there is no need for timezone conversion. For example, all efforts on Jan. 1st, 2014 for a segment in San Francisco, CA can be fetched using 2014-01-01T00:00:00Z and 2014-01-01T23:59:59Z.
Pagination is NOT supported. All segment efforts will be returned.
Returns null if the segment does not exist.
URL GET https://www.strava.com/api/v3/segments/:id/all_efforts
listAllSegmentEfforts in interface SegmentServicesegmentId - The id of the StravaSegment for which segment efforts are to be returnedathleteId - (Optional) id of the StravaAthlete to filter results bystartDate - (Optional) ISO 8601 formatted date timeendDate - (Optional) ISO 8601 formatted date timesegment effort summary representations sorted by start_date_local
ascending or by elapsed_time if an athlete_id is provided.SegmentService.listAllSegmentEfforts(java.lang.Integer, java.lang.Integer, java.util.Calendar, java.util.Calendar)Copyright © 2015 Dan Shannon. All rights reserved.