Interface CarManagementService
- All Known Implementing Classes:
CarManagementServiceImpl
public interface CarManagementService
Service for managing cars in the DB.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deactivateCar
(Car car, UserContext ctx) Deactivates a given car.void
deactivateCarsByPlayer
(Player player, UserContext ctx) Deactivates all the cars registered by a player.saveCar
(Car car, UserContext ctx) Registers a new car in the database.void
updateCar
(Integer carId, Car updatedCar, UserContext ctx) Updates the car with the given ID.
-
Method Details
-
saveCar
Registers a new car in the database.- Parameters:
car
- New car to registerctx
- User context- Returns:
- New car ID
- Throws:
DatabaseException
-
updateCar
void updateCar(Integer carId, Car updatedCar, UserContext ctx) throws ApplicationException, DatabaseException Updates the car with the given ID.- Parameters:
carId
- Car ID to searchupdatedCar
- Car details to updatectx
- User context- Throws:
ApplicationException
- If the current user is not allowed to perform this actionDatabaseException
-
deactivateCar
Deactivates a given car.- Parameters:
car
- Car to deactivatectx
- User context- Throws:
ApplicationException
- If the current user is not allowed to perform this action of if the car is being used for a future matchDatabaseException
-
deactivateCarsByPlayer
Deactivates all the cars registered by a player.- Parameters:
player
- Player to look forctx
- User context for the responsible of this operation- Throws:
DatabaseException
-