Exemplo n.º 1
0
 public String removeCar(String numberPlate) {
   carCache = provider.getCacheContainer().getCache(CACHE_NAME);
   carCache.remove(encode(numberPlate));
   List<String> carNumbers = getNumberPlateList();
   carNumbers.remove(numberPlate);
   carCache.replace(CAR_NUMBERS_KEY, carNumbers);
   return null;
 }
Exemplo n.º 2
0
 public String addNewCar() {
   carCache = provider.getCacheContainer().getCache(CACHE_NAME);
   carCache.put(CarManager.encode(car.getNumberPlate()), car);
   List<String> carNumbers = getNumberPlateList();
   if (carNumbers == null) carNumbers = new LinkedList<>();
   carNumbers.add(car.getNumberPlate());
   carCache.replace(CAR_NUMBERS_KEY, carNumbers);
   return "home";
 }
Exemplo n.º 3
0
 public List<String> getCarList() {
   // retrieve a cache
   carCache = provider.getCacheContainer().getCache(CACHE_NAME);
   // retrieve a list of number plates from the cache
   return getNumberPlateList();
 }
Exemplo n.º 4
0
 public String showCarDetails(String numberPlate) {
   carCache = provider.getCacheContainer().getCache(CACHE_NAME);
   this.car = (Car) carCache.get(encode(numberPlate));
   return "showdetails";
 }