Interface MatchManagementService


public interface MatchManagementService
Matches management service.
Author:
andresbustamante
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cancelMatch(Match match, net.andresbustamante.yafoot.commons.model.UserContext userContext)
    Cancels a match by a logical suppression in database.
    void
    registerPlayer(Player player, Match match, Car car, net.andresbustamante.yafoot.commons.model.UserContext userContext)
    Register a player to an existing match.
    saveMatch(Match match, net.andresbustamante.yafoot.commons.model.UserContext userContext)
    Create a new match in database.
    void
    unregisterPlayer(Player player, Match match, net.andresbustamante.yafoot.commons.model.UserContext userContext)
    Unregister a player from a match.
    void
    unregisterPlayerFromAllMatches(Player player, net.andresbustamante.yafoot.commons.model.UserContext userContext)
    Unregister a player from all matches.
  • Method Details

    • saveMatch

      Integer saveMatch(Match match, net.andresbustamante.yafoot.commons.model.UserContext userContext) throws net.andresbustamante.yafoot.commons.exceptions.DatabaseException, net.andresbustamante.yafoot.commons.exceptions.ApplicationException
      Create a new match in database.
      Parameters:
      match - Match to create
      userContext -
      Returns:
      New match ID
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      net.andresbustamante.yafoot.commons.exceptions.ApplicationException - Invalid arguments
    • registerPlayer

      void registerPlayer(Player player, Match match, Car car, net.andresbustamante.yafoot.commons.model.UserContext userContext) throws net.andresbustamante.yafoot.commons.exceptions.ApplicationException, net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      Register a player to an existing match. If the player is already registered, the existing registration is updated by the new one.
      Parameters:
      player - Player to register
      match - Match to update
      car - Car used by the player to assist to the match. If the player is registering himself but is not the owner of the car, the player is registered but the car seat is not confirmed until the owner confirms it
      userContext -
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      net.andresbustamante.yafoot.commons.exceptions.ApplicationException - Invalid arguments
    • unregisterPlayer

      void unregisterPlayer(Player player, Match match, net.andresbustamante.yafoot.commons.model.UserContext userContext) throws net.andresbustamante.yafoot.commons.exceptions.DatabaseException, net.andresbustamante.yafoot.commons.exceptions.ApplicationException
      Unregister a player from a match.
      Parameters:
      player - Player to unregister
      match - Match to search
      userContext -
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      net.andresbustamante.yafoot.commons.exceptions.ApplicationException - Invalid arguments
    • unregisterPlayerFromAllMatches

      void unregisterPlayerFromAllMatches(Player player, net.andresbustamante.yafoot.commons.model.UserContext userContext) throws net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      Unregister a player from all matches.
      Parameters:
      player - Player to search
      userContext - User context
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException
    • cancelMatch

      void cancelMatch(Match match, net.andresbustamante.yafoot.commons.model.UserContext userContext) throws net.andresbustamante.yafoot.commons.exceptions.DatabaseException, net.andresbustamante.yafoot.commons.exceptions.ApplicationException
      Cancels a match by a logical suppression in database. All registrations are kept for consultation.
      Parameters:
      match - Match to cancel
      userContext - Context of the user asking for this action
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException - Unexpected exception when updating the match in database
      net.andresbustamante.yafoot.commons.exceptions.ApplicationException - When the match is already in the past or the user is not allowed to cancel the match