Class Challonge
- java.lang.Object
-
- at.stefangeyer.challonge.Challonge
-
- All Implemented Interfaces:
AttachmentService,MatchService,ParticipantService,TournamentService
public class Challonge extends java.lang.Object implements TournamentService, ParticipantService, MatchService, AttachmentService
-
-
Constructor Summary
Constructors Constructor Description Challonge(Credentials credentials, Serializer serializer, RestClient restClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TournamentabortCheckIn(Tournament tournament)TournamentabortCheckIn(Tournament tournament, boolean includeParticipants, boolean includeMatches)When your tournament is in a 'checking_in' or 'checked_in' state, there's no way to edit the tournament's start time (start_at) or check-in duration (check_in_duration).voidabortCheckIn(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)When your tournament is in a 'checking_in' or 'checked_in' state, there's no way to edit the tournament's start time (start_at) or check-in duration (check_in_duration).voidabortCheckIn(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)ParticipantaddParticipant(Tournament tournament, ParticipantQuery data)Add a participant to a tournament (up until it is started).voidaddParticipant(Tournament tournament, ParticipantQuery data, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)Add a participant to a tournament (up until it is started).java.util.List<Participant>bulkAddParticipants(Tournament tournament, java.util.List<ParticipantQuery> data)Bulk add participants to a tournament (up until it is started).voidbulkAddParticipants(Tournament tournament, java.util.List<ParticipantQuery> data, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)Bulk add participants to a tournament (up until it is started).ParticipantcheckInParticipant(Participant participant)Checks a participant in, setting checked_in_at to the current time.voidcheckInParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)Checks a participant in, setting checked_in_at to the current time.AttachmentcreateAttachment(Match match, AttachmentQuery data)Add a file, link, or text attachment to a match.voidcreateAttachment(Match match, AttachmentQuery data, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Add a file, link, or text attachment to a match.TournamentcreateTournament(TournamentQuery data)Create a new tournament.voidcreateTournament(TournamentQuery data, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Create a new tournament.AttachmentdeleteAttachment(Match match, Attachment attachment)Delete a match attachment.voiddeleteAttachment(Match match, Attachment attachment, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Delete a match attachment.ParticipantdeleteParticipant(Participant participant)If the tournament has not started, delete a participant, automatically filling in the abandoned seed number.voiddeleteParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)If the tournament has not started, delete a participant, automatically filling in the abandoned seed number.TournamentdeleteTournament(Tournament tournament)Deletes a tournament along with all its associated records.voiddeleteTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Deletes a tournament along with all its associated records.TournamentfinalizeTournament(Tournament tournament)TournamentfinalizeTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches)Finalize a tournament that has had all match scores submitted, rendering its results permanent.voidfinalizeTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Finalize a tournament that has had all match scores submitted, rendering its results permanent.voidfinalizeTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)AttachmentgetAttachment(Match match, long attachmentId)Retrieve a single match attachment record.voidgetAttachment(Match match, long attachmentId, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Retrieve a single match attachment record.java.util.List<Attachment>getAttachments(Match match)Retrieve a match's attachments.voidgetAttachments(Match match, Callback<java.util.List<Attachment>> onSuccess, Callback<DataAccessException> onFailure)Retrieve a match's attachments.MatchgetMatch(Tournament tournament, long matchId)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.voidgetMatch(Tournament tournament, long matchId, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)java.util.List<Match>getMatches(Tournament tournament)voidgetMatches(Tournament tournament, Callback<java.util.List<Match>> onSuccess, Callback<DataAccessException> onFailure)java.util.List<Match>getMatches(Tournament tournament, Participant participant)voidgetMatches(Tournament tournament, Participant participant, Callback<java.util.List<Match>> onSuccess, Callback<DataAccessException> onFailure)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.ParticipantgetParticipant(Tournament tournament, long participantId)ParticipantgetParticipant(Tournament tournament, long participantId, boolean includeMatches)Retrieve a single participant record for a tournament.voidgetParticipant(Tournament tournament, long participantId, boolean includeMatches, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)Retrieve a single participant record for a tournament.voidgetParticipant(Tournament tournament, long participantId, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)java.util.List<Participant>getParticipants(Tournament tournament)Retrieve a tournament's participant list.voidgetParticipants(Tournament tournament, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)Retrieve a tournament's participant list.TournamentgetTournament(java.lang.String tournament)TournamentgetTournament(java.lang.String tournament, boolean includeParticipants, boolean includeMatches)Retrieve a single tournament record created with your account.voidgetTournament(java.lang.String tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Retrieve a single tournament record created with your account.voidgetTournament(java.lang.String tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)java.util.List<Tournament>getTournaments()voidgetTournaments(Callback<java.util.List<Tournament>> onSuccess, Callback<DataAccessException> onFailure)voidgetTournaments(TournamentQueryState state, TournamentType type, java.time.OffsetDateTime createdAfter, java.time.OffsetDateTime createdBefore, Callback<java.util.List<Tournament>> onSuccess, Callback<DataAccessException> onFailure)java.util.List<Tournament>getTournaments(TournamentQueryState state, TournamentType type, java.time.OffsetDateTime createdAfter, java.time.OffsetDateTime createdBefore, java.lang.String subdomain)Retrieve a set of tournaments created with your account.voidgetTournaments(TournamentQueryState state, TournamentType type, java.time.OffsetDateTime createdAfter, java.time.OffsetDateTime createdBefore, java.lang.String subdomain, Callback<java.util.List<Tournament>> onSuccess, Callback<DataAccessException> onFailure)Retrieve a set of tournaments created with your account.TournamentopenTournamentForPredictions(Tournament tournament)TournamentopenTournamentForPredictions(Tournament tournament, boolean includeParticipants, boolean includeMatches)Sets the state of the tournament to start accepting predictions.voidopenTournamentForPredictions(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Sets the state of the tournament to start accepting predictions.voidopenTournamentForPredictions(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)TournamentprocessCheckIns(Tournament tournament)TournamentprocessCheckIns(Tournament tournament, boolean includeParticipants, boolean includeMatches)This should be invoked after a tournament's check-in window closes before the tournament is started.voidprocessCheckIns(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)This should be invoked after a tournament's check-in window closes before the tournament is started.voidprocessCheckIns(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)java.util.List<Participant>randomizeParticipants(Tournament tournament)Randomize seeds among participants.voidrandomizeParticipants(Tournament tournament, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)Randomize seeds among participants.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.TournamentresetTournament(Tournament tournament)TournamentresetTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches)Reset a tournament, clearing all of its scores and attachments.voidresetTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Reset a tournament, clearing all of its scores and attachments.voidresetTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)TournamentstartTournament(Tournament tournament)TournamentstartTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches)Start a tournament, opening up first round matches for score reporting.voidstartTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Start a tournament, opening up first round matches for score reporting.voidstartTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)ParticipantundoCheckInParticipant(Participant participant)Marks a participant as having not checked in, setting checked_in_at to nil.voidundoCheckInParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)Marks a participant as having not checked in, setting checked_in_at to nil.AttachmentupdateAttachment(Match match, Attachment attachment, AttachmentQuery data)Update the attributes of a match attachment.voidupdateAttachment(Match match, Attachment attachment, AttachmentQuery data, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)Update the attributes of a match attachment.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.ParticipantupdateParticipant(Participant participant, ParticipantQuery data)Update the attributes of a tournament participant.voidupdateParticipant(Participant participant, ParticipantQuery data, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)Update the attributes of a tournament participant.TournamentupdateTournament(Tournament tournament, TournamentQuery data)Update a tournament's attributes.voidupdateTournament(Tournament tournament, TournamentQuery data, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Update a tournament's attributes.
-
-
-
Constructor Detail
-
Challonge
public Challonge(Credentials credentials, Serializer serializer, RestClient restClient)
-
-
Method Detail
-
getTournaments
public final java.util.List<Tournament> getTournaments(TournamentQueryState state, TournamentType type, java.time.OffsetDateTime createdAfter, java.time.OffsetDateTime createdBefore, java.lang.String subdomain) throws DataAccessException
Description copied from interface:TournamentServiceRetrieve a set of tournaments created with your account.- Specified by:
getTournamentsin interfaceTournamentService- Parameters:
state- Only get tournaments with this statetype- Only get tournaments with this typecreatedAfter- Get tournaments created after this datecreatedBefore- Get tournaments created before this datesubdomain- Only get tournaments with this subdomain- Returns:
- The filtered tournaments
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
getTournaments
public final java.util.List<Tournament> getTournaments() throws DataAccessException
- Throws:
DataAccessException
-
getTournaments
public final void getTournaments(TournamentQueryState state, TournamentType type, java.time.OffsetDateTime createdAfter, java.time.OffsetDateTime createdBefore, java.lang.String subdomain, Callback<java.util.List<Tournament>> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceRetrieve a set of tournaments created with your account.- Specified by:
getTournamentsin interfaceTournamentService- Parameters:
state- Only get tournaments with this statetype- Only get tournaments with this typecreatedAfter- Get tournaments created after this datecreatedBefore- Get tournaments created before this datesubdomain- Only get tournaments with this subdomainonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getTournaments
public final void getTournaments(TournamentQueryState state, TournamentType type, java.time.OffsetDateTime createdAfter, java.time.OffsetDateTime createdBefore, Callback<java.util.List<Tournament>> onSuccess, Callback<DataAccessException> onFailure)
-
getTournaments
public final void getTournaments(Callback<java.util.List<Tournament>> onSuccess, Callback<DataAccessException> onFailure)
-
getTournament
public final Tournament getTournament(java.lang.String tournament, boolean includeParticipants, boolean includeMatches) throws DataAccessException
Description copied from interface:TournamentServiceRetrieve a single tournament record created with your account.- Specified by:
getTournamentin interfaceTournamentService- Parameters:
tournament- Tournament ID (e.g. 10230) or URL (e.g. 'single_elim' for challonge.com/single_elim). If assigned to a subdomain, URL format must be :subdomain-:tournament_url (e.g. 'test-mytourney' for test.challonge.com/mytourney)includeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the response- Returns:
- The matching tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
getTournament
public final Tournament getTournament(java.lang.String tournament) throws DataAccessException
- Throws:
DataAccessException
-
getTournament
public final void getTournament(java.lang.String tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)Description copied from interface:TournamentServiceRetrieve a single tournament record created with your account.- Specified by:
getTournamentin interfaceTournamentService- Parameters:
tournament- Tournament ID (e.g. 10230) or URL (e.g. 'single_elim' for challonge.com/single_elim). If assigned to a subdomain, URL format must be :subdomain-:tournament_url (e.g. 'test-mytourney' for test.challonge.com/mytourney)includeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the responseonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getTournament
public final void getTournament(java.lang.String tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
-
createTournament
public final Tournament createTournament(TournamentQuery data) throws DataAccessException
Description copied from interface:TournamentServiceCreate a new tournament.- Specified by:
createTournamentin interfaceTournamentService- Parameters:
data- An object with all the necessary information to create the tournament- Returns:
- The created tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
createTournament
public final void createTournament(TournamentQuery data, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceCreate a new tournament.- Specified by:
createTournamentin interfaceTournamentService- Parameters:
data- An object with all the necessary information to create the tournamentonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
updateTournament
public final Tournament updateTournament(Tournament tournament, TournamentQuery data) throws DataAccessException
Description copied from interface:TournamentServiceUpdate a tournament's attributes.- Specified by:
updateTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to update. Must contain tournament iddata- An object with all the necessary information to update the tournament- Returns:
- The updated tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
updateTournament
public final void updateTournament(Tournament tournament, TournamentQuery data, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceUpdate a tournament's attributes.- Specified by:
updateTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to update. Must contain tournament iddata- An object with all the necessary information to update the tournamentonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
deleteTournament
public final Tournament deleteTournament(Tournament tournament) throws DataAccessException
Description copied from interface:TournamentServiceDeletes a tournament along with all its associated records. There is no undo, so use with care!- Specified by:
deleteTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to delete. Must contain tournament id- Returns:
- The deleted tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
deleteTournament
public final void deleteTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceDeletes a tournament along with all its associated records. There is no undo, so use with care!- Specified by:
deleteTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to delete. Must contain tournament idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
processCheckIns
public final Tournament processCheckIns(Tournament tournament, boolean includeParticipants, boolean includeMatches) throws DataAccessException
Description copied from interface:TournamentServiceThis should be invoked after a tournament's check-in window closes before the tournament is started.1. Marks participants who have not checked in as inactive. 2. Moves inactive participants to bottom seeds (ordered by original seed). 3. Transitions the tournament state from 'checking_in' to 'checked_in'
NOTE: Checked in participants on the waiting list will be promoted if slots become available.
- Specified by:
processCheckInsin interfaceTournamentService- Parameters:
tournament- The tournament to process check ins for. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the response- Returns:
- The updated tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
processCheckIns
public final Tournament processCheckIns(Tournament tournament) throws DataAccessException
- Throws:
DataAccessException
-
processCheckIns
public final void processCheckIns(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceThis should be invoked after a tournament's check-in window closes before the tournament is started.1. Marks participants who have not checked in as inactive. 2. Moves inactive participants to bottom seeds (ordered by original seed). 3. Transitions the tournament state from 'checking_in' to 'checked_in'
NOTE: Checked in participants on the waiting list will be promoted if slots become available.
- Specified by:
processCheckInsin interfaceTournamentService- Parameters:
tournament- The tournament to process check ins for. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the responseonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
processCheckIns
public final void processCheckIns(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
-
abortCheckIn
public final Tournament abortCheckIn(Tournament tournament, boolean includeParticipants, boolean includeMatches) throws DataAccessException
Description copied from interface:TournamentServiceWhen your tournament is in a 'checking_in' or 'checked_in' state, there's no way to edit the tournament's start time (start_at) or check-in duration (check_in_duration). You must first abort check-in, then you may edit those attributes.1. Makes all participants active and clears their checked_in_at times. 2. Transitions the tournament state from 'checking_in' or 'checked_in' to 'pending'
- Specified by:
abortCheckInin interfaceTournamentService- Parameters:
tournament- The tournament to abort check in for. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the response- Returns:
- The updated tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
abortCheckIn
public final Tournament abortCheckIn(Tournament tournament) throws DataAccessException
- Throws:
DataAccessException
-
abortCheckIn
public final void abortCheckIn(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceWhen your tournament is in a 'checking_in' or 'checked_in' state, there's no way to edit the tournament's start time (start_at) or check-in duration (check_in_duration). You must first abort check-in, then you may edit those attributes.1. Makes all participants active and clears their checked_in_at times. 2. Transitions the tournament state from 'checking_in' or 'checked_in' to 'pending'
- Specified by:
abortCheckInin interfaceTournamentService- Parameters:
tournament- The tournament to abort check in for. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the responseonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
abortCheckIn
public final void abortCheckIn(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
-
startTournament
public final Tournament startTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches) throws DataAccessException
Description copied from interface:TournamentServiceStart a tournament, opening up first round matches for score reporting. The tournament must have at least 2 participants.- Specified by:
startTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to start. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the response- Returns:
- The started tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
startTournament
public final Tournament startTournament(Tournament tournament) throws DataAccessException
- Throws:
DataAccessException
-
startTournament
public final void startTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceStart a tournament, opening up first round matches for score reporting. The tournament must have at least 2 participants.- Specified by:
startTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to start. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the responseonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
startTournament
public final void startTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
-
finalizeTournament
public final Tournament finalizeTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches) throws DataAccessException
Description copied from interface:TournamentServiceFinalize a tournament that has had all match scores submitted, rendering its results permanent.- Specified by:
finalizeTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to finalize. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the response- Returns:
- The finalized tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
finalizeTournament
public final Tournament finalizeTournament(Tournament tournament) throws DataAccessException
- Throws:
DataAccessException
-
finalizeTournament
public final void finalizeTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceFinalize a tournament that has had all match scores submitted, rendering its results permanent.- Specified by:
finalizeTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to finalize. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the responseonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
finalizeTournament
public final void finalizeTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
-
resetTournament
public final Tournament resetTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches) throws DataAccessException
Description copied from interface:TournamentServiceReset a tournament, clearing all of its scores and attachments. You can then add/remove/edit participants before starting the tournament again.- Specified by:
resetTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to reset. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the response- Returns:
- The reset tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
resetTournament
public final Tournament resetTournament(Tournament tournament) throws DataAccessException
- Throws:
DataAccessException
-
resetTournament
public final void resetTournament(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceReset a tournament, clearing all of its scores and attachments. You can then add/remove/edit participants before starting the tournament again.- Specified by:
resetTournamentin interfaceTournamentService- Parameters:
tournament- The tournament to reset. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the responseonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
resetTournament
public final void resetTournament(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
-
openTournamentForPredictions
public final Tournament openTournamentForPredictions(Tournament tournament, boolean includeParticipants, boolean includeMatches) throws DataAccessException
Description copied from interface:TournamentServiceSets the state of the tournament to start accepting predictions. Your tournament's 'prediction_method' attribute must be set to 1 (exponential scoring) or 2 (linear scoring) to use this option. Note: Once open for predictions, match records will be persisted, so participant additions and removals will no longer be permitted.- Specified by:
openTournamentForPredictionsin interfaceTournamentService- Parameters:
tournament- The tournament to open predictions for. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the response- Returns:
- The reset tournament
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
openTournamentForPredictions
public final Tournament openTournamentForPredictions(Tournament tournament) throws DataAccessException
- Throws:
DataAccessException
-
openTournamentForPredictions
public final void openTournamentForPredictions(Tournament tournament, boolean includeParticipants, boolean includeMatches, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:TournamentServiceSets the state of the tournament to start accepting predictions. Your tournament's 'prediction_method' attribute must be set to 1 (exponential scoring) or 2 (linear scoring) to use this option. Note: Once open for predictions, match records will be persisted, so participant additions and removals will no longer be permitted.- Specified by:
openTournamentForPredictionsin interfaceTournamentService- Parameters:
tournament- The tournament to open predictions for. Must contain tournament idincludeParticipants- Include a list of participants in the responseincludeMatches- Include a list of matches in the responseonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
openTournamentForPredictions
public final void openTournamentForPredictions(Tournament tournament, Callback<Tournament> onSuccess, Callback<DataAccessException> onFailure)
-
getParticipants
public final java.util.List<Participant> getParticipants(Tournament tournament) throws DataAccessException
Description copied from interface:ParticipantServiceRetrieve a tournament's participant list.- Specified by:
getParticipantsin interfaceParticipantService- Parameters:
tournament- The tournament to get the participants from. Must contain tournament id- Returns:
- The tournaments participants
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
getParticipants
public final void getParticipants(Tournament tournament, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceRetrieve a tournament's participant list.- Specified by:
getParticipantsin interfaceParticipantService- Parameters:
tournament- The tournament to get the participants from. Must contain tournament idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getParticipant
public final Participant getParticipant(Tournament tournament, long participantId, boolean includeMatches) throws DataAccessException
Description copied from interface:ParticipantServiceRetrieve a single participant record for a tournament.- Specified by:
getParticipantin interfaceParticipantService- Parameters:
tournament- The tournament to get the participant from. Must contain tournament idparticipantId- The participant's unique IDincludeMatches- Includes an array of associated match records- Returns:
- The requested participant
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
getParticipant
public final Participant getParticipant(Tournament tournament, long participantId) throws DataAccessException
- Throws:
DataAccessException
-
getParticipant
public final void getParticipant(Tournament tournament, long participantId, boolean includeMatches, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceRetrieve a single participant record for a tournament.- Specified by:
getParticipantin interfaceParticipantService- Parameters:
tournament- The tournament to get the participant from. Must contain tournament idparticipantId- The participant's unique IDincludeMatches- Includes an array of associated match recordsonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getParticipant
public final void getParticipant(Tournament tournament, long participantId, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
-
addParticipant
public final Participant addParticipant(Tournament tournament, ParticipantQuery data) throws DataAccessException
Description copied from interface:ParticipantServiceAdd a participant to a tournament (up until it is started).- Specified by:
addParticipantin interfaceParticipantService- Parameters:
tournament- The tournament to add the participant to. Must contain tournament iddata- The participant data- Returns:
- The added participant
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
addParticipant
public final void addParticipant(Tournament tournament, ParticipantQuery data, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceAdd a participant to a tournament (up until it is started).- Specified by:
addParticipantin interfaceParticipantService- Parameters:
tournament- The tournament to add the participant to. Must contain tournament iddata- The participant dataonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
bulkAddParticipants
public final java.util.List<Participant> bulkAddParticipants(Tournament tournament, java.util.List<ParticipantQuery> data) throws DataAccessException
Description copied from interface:ParticipantServiceBulk add participants to a tournament (up until it is started). If an invalid participant is detected, bulk participant creation will halt and any previously added participants (from this API request) will be rolled back.- Specified by:
bulkAddParticipantsin interfaceParticipantService- Parameters:
tournament- The tournament to add the participants to. Must contain tournament iddata- The participant data- Returns:
- The added participants
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
bulkAddParticipants
public final void bulkAddParticipants(Tournament tournament, java.util.List<ParticipantQuery> data, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceBulk add participants to a tournament (up until it is started). If an invalid participant is detected, bulk participant creation will halt and any previously added participants (from this API request) will be rolled back.- Specified by:
bulkAddParticipantsin interfaceParticipantService- Parameters:
tournament- The tournament to add the participants to. Must contain tournament iddata- The participant dataonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
updateParticipant
public final Participant updateParticipant(Participant participant, ParticipantQuery data) throws DataAccessException
Description copied from interface:ParticipantServiceUpdate the attributes of a tournament participant.- Specified by:
updateParticipantin interfaceParticipantService- Parameters:
participant- The participant to update. Must contain the tournament id and the participant's iddata- The participant data- Returns:
- The updates participant
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
updateParticipant
public final void updateParticipant(Participant participant, ParticipantQuery data, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceUpdate the attributes of a tournament participant.- Specified by:
updateParticipantin interfaceParticipantService- Parameters:
participant- The participant to update. Must contain the tournament id and the participant's iddata- The participant dataonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
checkInParticipant
public final Participant checkInParticipant(Participant participant) throws DataAccessException
Description copied from interface:ParticipantServiceChecks a participant in, setting checked_in_at to the current time.- Specified by:
checkInParticipantin interfaceParticipantService- Parameters:
participant- The participant to check in. Must contain the tournament id and the participant's id- Returns:
- The checked in participant
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
checkInParticipant
public final void checkInParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceChecks a participant in, setting checked_in_at to the current time.- Specified by:
checkInParticipantin interfaceParticipantService- Parameters:
participant- The participant to check in. Must contain the tournament id and the participant's idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
undoCheckInParticipant
public final Participant undoCheckInParticipant(Participant participant) throws DataAccessException
Description copied from interface:ParticipantServiceMarks a participant as having not checked in, setting checked_in_at to nil.- Specified by:
undoCheckInParticipantin interfaceParticipantService- Parameters:
participant- The participant to check in. Must contain the tournament id and the participant's id- Returns:
- The checked out participant
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
undoCheckInParticipant
public final void undoCheckInParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceMarks a participant as having not checked in, setting checked_in_at to nil.- Specified by:
undoCheckInParticipantin interfaceParticipantService- Parameters:
participant- The participant to check in. Must contain the tournament id and the participant's idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
deleteParticipant
public final Participant deleteParticipant(Participant participant) throws DataAccessException
Description copied from interface:ParticipantServiceIf the tournament has not started, delete a participant, automatically filling in the abandoned seed number. If tournament is underway, mark a participant inactive, automatically forfeiting his/her remaining matches.- Specified by:
deleteParticipantin interfaceParticipantService- Parameters:
participant- The participant to delete. Must contain the tournament id and the participant's id- Returns:
- The deleted participant
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
deleteParticipant
public final void deleteParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceIf the tournament has not started, delete a participant, automatically filling in the abandoned seed number. If tournament is underway, mark a participant inactive, automatically forfeiting his/her remaining matches.- Specified by:
deleteParticipantin interfaceParticipantService- Parameters:
participant- The participant to delete. Must contain the tournament id and the participant's idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
randomizeParticipants
public final java.util.List<Participant> randomizeParticipants(Tournament tournament) throws DataAccessException
Description copied from interface:ParticipantServiceRandomize seeds among participants. Only applicable before a tournament has started.- Specified by:
randomizeParticipantsin interfaceParticipantService- Parameters:
tournament- The tournament to randomize. Must contain the tournament id- Returns:
- The randomized participants
- Throws:
DataAccessException- Exchange with the rest api or validation failed
-
randomizeParticipants
public final void randomizeParticipants(Tournament tournament, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:ParticipantServiceRandomize seeds among participants. Only applicable before a tournament has started.- Specified by:
randomizeParticipantsin interfaceParticipantService- Parameters:
tournament- The tournament to randomize. Must contain the tournament idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getMatches
public final 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 final java.util.List<Match> getMatches(Tournament tournament, Participant participant) throws DataAccessException
- Throws:
DataAccessException
-
getMatches
public final java.util.List<Match> getMatches(Tournament tournament) throws DataAccessException
- Throws:
DataAccessException
-
getMatches
public final 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
-
getMatches
public final void getMatches(Tournament tournament, Participant participant, Callback<java.util.List<Match>> onSuccess, Callback<DataAccessException> onFailure)
-
getMatches
public final void getMatches(Tournament tournament, Callback<java.util.List<Match>> onSuccess, Callback<DataAccessException> onFailure)
-
getMatch
public final 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 final Match getMatch(Tournament tournament, long matchId) throws DataAccessException
- Throws:
DataAccessException
-
getMatch
public final 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
-
getMatch
public final void getMatch(Tournament tournament, long matchId, Callback<Match> onSuccess, Callback<DataAccessException> onFailure)
-
updateMatch
public final 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 final 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 final 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 final 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
-
getAttachments
public final java.util.List<Attachment> getAttachments(Match match) throws DataAccessException
Description copied from interface:AttachmentServiceRetrieve a match's attachments.- Specified by:
getAttachmentsin interfaceAttachmentService- Parameters:
match- The match to get the attachments from. Must contain the tournament- and match id- Returns:
- The match attachments
- Throws:
DataAccessException- Exchange with the rest api failed
-
getAttachments
public final void getAttachments(Match match, Callback<java.util.List<Attachment>> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:AttachmentServiceRetrieve a match's attachments.- Specified by:
getAttachmentsin interfaceAttachmentService- Parameters:
match- The match to get the attachments from. Must contain the tournament- and match idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
getAttachment
public final Attachment getAttachment(Match match, long attachmentId) throws DataAccessException
Description copied from interface:AttachmentServiceRetrieve a single match attachment record.- Specified by:
getAttachmentin interfaceAttachmentService- Parameters:
match- The match to get the attachment from. Must contain the tournament- and match idattachmentId- The attachment's unique ID- Returns:
- The requested attachment
- Throws:
DataAccessException- Exchange with the rest api failed
-
getAttachment
public final void getAttachment(Match match, long attachmentId, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:AttachmentServiceRetrieve a single match attachment record.- Specified by:
getAttachmentin interfaceAttachmentService- Parameters:
match- The match to get the attachment from. Must contain the tournament- and match idattachmentId- The attachment's unique IDonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
createAttachment
public final Attachment createAttachment(Match match, AttachmentQuery data) throws DataAccessException
Description copied from interface:AttachmentServiceAdd a file, link, or text attachment to a match. NOTE: The associated tournament's "accept_attachments" attribute must be true for this action to succeed.At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.
- Specified by:
createAttachmentin interfaceAttachmentService- Parameters:
match- The match to create the attachment for. Must contain the tournament- and match iddata- The attachment to create- Returns:
- The created attachment
- Throws:
DataAccessException- Exchange with the rest api failed
-
createAttachment
public final void createAttachment(Match match, AttachmentQuery data, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:AttachmentServiceAdd a file, link, or text attachment to a match. NOTE: The associated tournament's "accept_attachments" attribute must be true for this action to succeed.At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.
- Specified by:
createAttachmentin interfaceAttachmentService- Parameters:
match- The match to create the attachment for. Must contain the tournament- and match iddata- The attachment to createonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
updateAttachment
public final Attachment updateAttachment(Match match, Attachment attachment, AttachmentQuery data) throws DataAccessException
Description copied from interface:AttachmentServiceUpdate the attributes of a match attachment.Sending the asset does neither work with base64 nor with a multipart-form-data request
At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.
- Specified by:
updateAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to update. Must contain the tournament- and match iddata- The attachment to update- Returns:
- The updated attachment
- Throws:
DataAccessException- Exchange with the rest api failed
-
updateAttachment
public final void updateAttachment(Match match, Attachment attachment, AttachmentQuery data, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:AttachmentServiceUpdate the attributes of a match attachment.Sending the asset does neither work with base64 nor with a multipart-form-data request
At least 1 of the 3 optional parameters (asset, url or description in the enumeration object) must be provided. Files up to 25MB are allowed for tournaments hosted by Challonge Premier subscribers.
- Specified by:
updateAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to update. Must contain the tournament- and match iddata- The attachment to updateonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
deleteAttachment
public final Attachment deleteAttachment(Match match, Attachment attachment) throws DataAccessException
Description copied from interface:AttachmentServiceDelete a match attachment.- Specified by:
deleteAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to delete. Must contain the tournament- and match id- Returns:
- The deleted attachment
- Throws:
DataAccessException- Exchange with the rest api failed
-
deleteAttachment
public final void deleteAttachment(Match match, Attachment attachment, Callback<Attachment> onSuccess, Callback<DataAccessException> onFailure)
Description copied from interface:AttachmentServiceDelete a match attachment.- Specified by:
deleteAttachmentin interfaceAttachmentService- Parameters:
match- The match to delete the attachment from. Must contain the tournament- and match idattachment- The attachment to delete. Must contain the tournament- and match idonSuccess- Called with result if call was successfulonFailure- Called with exception if call was not successful
-
-