Class SimpleMatchService
- java.lang.Object
-
- at.stefangeyer.challonge.service.implementation.SimpleMatchService
-
- All Implemented Interfaces:
MatchService
public class SimpleMatchService extends java.lang.Object implements MatchService
Match Service Implementation
-
-
Constructor Summary
Constructors Constructor Description SimpleMatchService(MatchRestClient restClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MatchgetMatch(Tournament tournament, long matchId, boolean includeAttachments)Retrieve a single match record for a tournament.voidgetMatch(Tournament tournament, long matchId, boolean includeAttachments, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)Retrieve a single match record for a tournament.java.util.List<Match>getMatches(Tournament tournament, Participant participant, MatchState state)Retrieve a tournament's match list.voidgetMatches(Tournament tournament, Participant participant, MatchState state, Callback<java.util.List<Match>> onSuccess, Callback<DataAccessException> onFailure)Retrieve a tournament's match list.MatchreopenMatch(Match match)Reopens a match that was marked completed, automatically resetting matches that follow it.voidreopenMatch(Match match, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)Reopens a match that was marked completed, automatically resetting matches that follow it.MatchupdateMatch(Match match, MatchQuery data)Update/submit the score(s) for a match.voidupdateMatch(Match match, MatchQuery data, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)Update/submit the score(s) for a match.
-
-
-
Constructor Detail
-
SimpleMatchService
public SimpleMatchService(MatchRestClient restClient)
-
-
Method Detail
-
getMatches
public java.util.List<Match> getMatches(Tournament tournament, Participant participant, MatchState state) throws DataAccessException
Description copied from interface:MatchServiceRetrieve a tournament's match list.- Specified by:
getMatchesin interfaceMatchService- Parameters:
tournament- The tournament to get the matches from. Must contain id or url with an optional subdomainparticipant- Only retrieve matches that include the specified participant. This parameter is optional. Provide null if you want to skip it.state- all (default), pending, open, complete. This parameter is optional. Provide null if you want to skip it.- Returns:
- The tournament's matches
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
getMatches
public void getMatches(Tournament tournament, Participant participant, MatchState state, Callback<java.util.List<Match>> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:MatchServiceRetrieve a tournament's match list.- Specified by:
getMatchesin interfaceMatchService- Parameters:
tournament- The tournament to get the matches from. Must contain id or url with an optional subdomainparticipant- Only retrieve matches that include the specified participant. This parameter is optional. Provide null if you want to skip it.state- all (default), pending, open, complete. This parameter is optional. Provide null if you want to skip it.onSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getMatch
public Match getMatch(Tournament tournament, long matchId, boolean includeAttachments) throws DataAccessException
Description copied from interface:MatchServiceRetrieve a single match record for a tournament.- Specified by:
getMatchin interfaceMatchService- Parameters:
tournament- The tournament to get the match from. Must contain tournament idmatchId- The match's unique IDincludeAttachments- Include an array of associated attachment records- Returns:
- The requested match
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
getMatch
public void getMatch(Tournament tournament, long matchId, boolean includeAttachments, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:MatchServiceRetrieve a single match record for a tournament.- Specified by:
getMatchin interfaceMatchService- Parameters:
tournament- The tournament to get the match from. Must contain tournament idmatchId- The match's unique IDincludeAttachments- Include an array of associated attachment recordsonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
updateMatch
public Match updateMatch(Match match, MatchQuery data) throws DataAccessException
Description copied from interface:MatchServiceUpdate/submit the score(s) for a match.- Specified by:
updateMatchin interfaceMatchService- Parameters:
match- The match to update. Must contain the tournament- and match iddata- The new match data- Returns:
- The updated match
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
updateMatch
public void updateMatch(Match match, MatchQuery data, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:MatchServiceUpdate/submit the score(s) for a match.- Specified by:
updateMatchin interfaceMatchService- Parameters:
match- The match to update. Must contain the tournament- and match iddata- The new match dataonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
reopenMatch
public Match reopenMatch(Match match) throws DataAccessException
Description copied from interface:MatchServiceReopens a match that was marked completed, automatically resetting matches that follow it.- Specified by:
reopenMatchin interfaceMatchService- Parameters:
match- The match to reopen. Must contain the tournament- and match id- Returns:
- The reopened match
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
reopenMatch
public void reopenMatch(Match match, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:MatchServiceReopens a match that was marked completed, automatically resetting matches that follow it.- Specified by:
reopenMatchin interfaceMatchService- Parameters:
match- The match to reopen. Must contain the tournament- and match idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
-