Class CarManagementServiceImpl
java.lang.Object
net.andresbustamante.yafoot.core.services.impl.CarManagementServiceImpl
- All Implemented Interfaces:
CarManagementService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeactivateCar(Car car, UserContext ctx) Deactivates a given car.voiddeactivateCarsByPlayer(Player player, UserContext ctx) Deactivates all the cars registered by a player.saveCar(Car car, UserContext ctx) Registers a new car in the database.voidupdateCar(Integer carId, Car updatedCar, UserContext ctx) Updates the car with the given ID.
-
Constructor Details
-
CarManagementServiceImpl
-
-
Method Details
-
saveCar
Description copied from interface:CarManagementServiceRegisters a new car in the database.- Specified by:
saveCarin interfaceCarManagementService- Parameters:
car- New car to registerctx- User context- Returns:
- New car ID
-
updateCar
@Transactional public void updateCar(Integer carId, Car updatedCar, UserContext ctx) throws ApplicationException Description copied from interface:CarManagementServiceUpdates the car with the given ID.- Specified by:
updateCarin interfaceCarManagementService- Parameters:
carId- Car ID to searchupdatedCar- Car details to updatectx- User context- Throws:
ApplicationException- If the current user is not allowed to perform this action
-
deactivateCar
Description copied from interface:CarManagementServiceDeactivates a given car.- Specified by:
deactivateCarin interfaceCarManagementService- 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 match
-
deactivateCarsByPlayer
Description copied from interface:CarManagementServiceDeactivates all the cars registered by a player.- Specified by:
deactivateCarsByPlayerin interfaceCarManagementService- Parameters:
player- Player to look forctx- User context for the responsible of this operation
-