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; }
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"; }
public List<String> getCarList() { // retrieve a cache carCache = provider.getCacheContainer().getCache(CACHE_NAME); // retrieve a list of number plates from the cache return getNumberPlateList(); }
public String showCarDetails(String numberPlate) { carCache = provider.getCacheContainer().getCache(CACHE_NAME); this.car = (Car) carCache.get(encode(numberPlate)); return "showdetails"; }