Class CarManagementServiceImpl
java.lang.Object
net.andresbustamante.yafoot.core.services.impl.CarManagementServiceImpl
- All Implemented Interfaces:
CarManagementService
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
CarManagementServiceImpl
-
-
Method Details
-
saveCar
Description copied from interface:CarManagementService
Registers a new car in the database.- Specified by:
saveCar
in 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:CarManagementService
Updates the car with the given ID.- Specified by:
updateCar
in 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:CarManagementService
Deactivates a given car.- Specified by:
deactivateCar
in 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:CarManagementService
Deactivates all the cars registered by a player.- Specified by:
deactivateCarsByPlayer
in interfaceCarManagementService
- Parameters:
player
- Player to look forctx
- User context for the responsible of this operation
-