Interface CarManagementService


public interface CarManagementService
Service for managing cars in the DB.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deactivateCar(Car car, net.andresbustamante.yafoot.commons.model.UserContext ctx)
    Deactivates a given car.
    void
    deactivateCarsByPlayer(Player player, net.andresbustamante.yafoot.commons.model.UserContext ctx)
    Deactivates all the cars registered by a player.
    saveCar(Car car, net.andresbustamante.yafoot.commons.model.UserContext ctx)
    Registers a new car in the database.
    void
    updateCar(Integer carId, Car updatedCar, net.andresbustamante.yafoot.commons.model.UserContext ctx)
    Updates the car with the given ID.
  • Method Details

    • saveCar

      Integer saveCar(Car car, net.andresbustamante.yafoot.commons.model.UserContext ctx) throws net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      Registers a new car in the database.
      Parameters:
      car - New car to register
      ctx - User context
      Returns:
      New car ID
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException
    • updateCar

      void updateCar(Integer carId, Car updatedCar, net.andresbustamante.yafoot.commons.model.UserContext ctx) throws net.andresbustamante.yafoot.commons.exceptions.ApplicationException, net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      Updates the car with the given ID.
      Parameters:
      carId - Car ID to search
      updatedCar - Car details to update
      ctx - User context
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.ApplicationException - If the current user is not allowed to perform this action
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException
    • deactivateCar

      void deactivateCar(Car car, net.andresbustamante.yafoot.commons.model.UserContext ctx) throws net.andresbustamante.yafoot.commons.exceptions.ApplicationException, net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      Deactivates a given car.
      Parameters:
      car - Car to deactivate
      ctx - User context
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.ApplicationException - If the current user is not allowed to perform this action of if the car is being used for a future match
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException
    • deactivateCarsByPlayer

      void deactivateCarsByPlayer(Player player, net.andresbustamante.yafoot.commons.model.UserContext ctx) throws net.andresbustamante.yafoot.commons.exceptions.DatabaseException
      Deactivates all the cars registered by a player.
      Parameters:
      player - Player to look for
      ctx - User context for the responsible of this operation
      Throws:
      net.andresbustamante.yafoot.commons.exceptions.DatabaseException