Class SimpleMatchService

  • All Implemented Interfaces:
    MatchService

    public class SimpleMatchService
    extends java.lang.Object
    implements MatchService
    Match Service Implementation
    • 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: MatchService
        Retrieve a tournament's match list.
        Specified by:
        getMatches in interface MatchService
        Parameters:
        tournament - The tournament to get the matches from. Must contain id or url with an optional subdomain
        participant - 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: MatchService
        Retrieve a tournament's match list.
        Specified by:
        getMatches in interface MatchService
        Parameters:
        tournament - The tournament to get the matches from. Must contain id or url with an optional subdomain
        participant - 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 successful
        onFailure - Called with exception if call was not successful
      • getMatch

        public Match getMatch​(Tournament tournament,
                              long matchId,
                              boolean includeAttachments)
                       throws DataAccessException
        Description copied from interface: MatchService
        Retrieve a single match record for a tournament.
        Specified by:
        getMatch in interface MatchService
        Parameters:
        tournament - The tournament to get the match from. Must contain tournament id
        matchId - The match's unique ID
        includeAttachments - 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: MatchService
        Retrieve a single match record for a tournament.
        Specified by:
        getMatch in interface MatchService
        Parameters:
        tournament - The tournament to get the match from. Must contain tournament id
        matchId - The match's unique ID
        includeAttachments - Include an array of associated attachment records
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • updateMatch

        public void updateMatch​(Match match,
                                MatchQuery data,
                                Callback<Match> onSuccess,
                                Callback<DataAccessException> onFailure)
        Description copied from interface: MatchService
        Update/submit the score(s) for a match.
        Specified by:
        updateMatch in interface MatchService
        Parameters:
        match - The match to update. Must contain the tournament- and match id
        data - The new match data
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful
      • reopenMatch

        public Match reopenMatch​(Match match)
                          throws DataAccessException
        Description copied from interface: MatchService
        Reopens a match that was marked completed, automatically resetting matches that follow it.
        Specified by:
        reopenMatch in interface MatchService
        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: MatchService
        Reopens a match that was marked completed, automatically resetting matches that follow it.
        Specified by:
        reopenMatch in interface MatchService
        Parameters:
        match - The match to reopen. Must contain the tournament- and match id
        onSuccess - Called with result if call was successful
        onFailure - Called with exception if call was not successful