Package at.stefangeyer.challonge.service
Interface ParticipantService
-
- All Known Implementing Classes:
Challonge,SimpleParticipantService
public interface ParticipantServiceParticipant Service Definitions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.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.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.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.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.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.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.
-
-
-
Method Detail
-
getParticipants
java.util.List<Participant> getParticipants(Tournament tournament) throws DataAccessException
Retrieve a tournament's participant list.- 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
void getParticipants(Tournament tournament, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)
Retrieve a tournament's participant list.- 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
Participant getParticipant(Tournament tournament, long participantId, boolean includeMatches) throws DataAccessException
Retrieve a single participant record for a tournament.- 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
void getParticipant(Tournament tournament, long participantId, boolean includeMatches, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Retrieve a single participant record for a tournament.- 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
-
addParticipant
Participant addParticipant(Tournament tournament, ParticipantQuery data) throws DataAccessException
Add a participant to a tournament (up until it is started).- 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
void addParticipant(Tournament tournament, ParticipantQuery data, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Add a participant to a tournament (up until it is started).- 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
java.util.List<Participant> bulkAddParticipants(Tournament tournament, java.util.List<ParticipantQuery> data) throws DataAccessException
Bulk 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.- 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
void bulkAddParticipants(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). If an invalid participant is detected, bulk participant creation will halt and any previously added participants (from this API request) will be rolled back.- 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
Participant updateParticipant(Participant participant, ParticipantQuery data) throws DataAccessException
Update the attributes of a tournament participant.- 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
void updateParticipant(Participant participant, ParticipantQuery data, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Update the attributes of a tournament participant.- 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
Participant checkInParticipant(Participant participant) throws DataAccessException
Checks a participant in, setting checked_in_at to the current time.- 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
void checkInParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Checks a participant in, setting checked_in_at to the current time.- 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
Participant undoCheckInParticipant(Participant participant) throws DataAccessException
Marks a participant as having not checked in, setting checked_in_at to nil.- 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
void undoCheckInParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
Marks a participant as having not checked in, setting checked_in_at to nil.- 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
Participant deleteParticipant(Participant participant) throws DataAccessException
If 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.- 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
void deleteParticipant(Participant participant, Callback<Participant> onSuccess, Callback<DataAccessException> onFailure)
If 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.- 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
java.util.List<Participant> randomizeParticipants(Tournament tournament) throws DataAccessException
Randomize seeds among participants. Only applicable before a tournament has started.- 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
void randomizeParticipants(Tournament tournament, Callback<java.util.List<Participant>> onSuccess, Callback<DataAccessException> onFailure)
Randomize seeds among participants. Only applicable before a tournament has started.- 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
-
-