3 import java.rmi.RemoteException;
5 import java.util.Vector;
7 import dataAccess.DB4oManager;
9 import domain.HouseFeatures;
12 import domain.RuralHouse;
14 public class HouseManager implements HouseManagerInterface {
17 public HouseManager() {
19 dbMngr = DB4oManager.getInstance();
20 } catch (Exception e) {
21 // TODO Auto-generated catch block
27 public boolean registerNewHouse(int houseNumber, Owner owner, String town,
28 int nRooms, int nKitchens, int nBaths, int nLivings, int nParkings) {
29 // TODO Auto-generated method stub
30 boolean stored = false;
31 if (nKitchens < 1 || nLivings < 3 || nBaths < 2)
33 HouseFeatures feature = new HouseFeatures(nRooms, nKitchens, nBaths,
35 stored = this.dbMngr.storeRuralHouses(new RuralHouse(houseNumber,
36 owner, town, feature));
42 public boolean registerNewHouse(int houseNumber, Owner owner,
43 String description, String town, int nRooms, int nKitchens,
44 int nBaths, int nLivings, int nParkings) {
45 // TODO Auto-generated method stub
46 boolean stored = false;
47 if (nKitchens < 1 || nLivings < 3 || nBaths < 2)
49 HouseFeatures feature = new HouseFeatures(nRooms, nKitchens, nBaths,
51 stored = this.dbMngr.storeRuralHouses(new RuralHouse(houseNumber,
52 owner, description, town, feature));
56 public void removeHouse(int houseNumber) {
57 this.dbMngr.removeHouse(houseNumber);
60 // For future implementation
62 // public void modifyHouse(int houseNumber, Owner owner, String description,
63 // String town, int nRooms, int nKitchens, int nBaths, int nLivings,
65 // // TODO Auto-generated method stub
69 // Maybe returning the offer is not necessary. Depends on GUI