@Override
- public boolean registerNewHouse(int houseNumber, Owner owner,
- String description, String town, int nRooms, int nKitchens,
+ public boolean registerNewHouse(String houseName, Owner owner,
+ String description, String district, int nRooms, int nKitchens,
int nBaths, int nLivings, int nParkings) {
+
boolean stored = false;
if (nKitchens < 1 || nLivings < 3 || nBaths < 2)
return false;
HouseFeatures feature = new HouseFeatures(nRooms, nKitchens, nBaths,
nLivings, nParkings);
- RuralHouse rh = new RuralHouse(houseNumber,
- owner, description, town, feature);
+ RuralHouse rh = new RuralHouse(houseName,
+ owner, description, district, feature);
owner.getRuralHouses().add(rh);
stored = this.dbMngr.storeRuralHouses(rh);
return stored;
}
+
+ @Override
+ public boolean registerNewHouse(RuralHouse rh) {
+
+ boolean stored = false;
+
+ rh.getOwner().getRuralHouses().add(rh);
+ stored = this.dbMngr.storeRuralHouses(rh);
+ return stored;
+ }
+
+ public void removeHouse(RuralHouse rh , Owner owner) {
+ Vector<RuralHouse> temp = owner.getRuralHouses();
+ temp.remove(rh);
+ this.dbMngr.removeHouse(rh, owner);
+ }
+
+
+
+ @Override
+ public Vector<RuralHouse> getHousesByDistrict(String town) {
+
+ return this.dbMngr.getRuralHousesByTown(town);
+ }
- public void removeHouse(int houseNumber) {
- this.dbMngr.removeHouse(houseNumber);
+ public Vector<RuralHouse> getHouses(String town,int nBed , int nKit, int nBath, int nPark, int nLiv) {
+
+ return this.dbMngr.getRuralHouses(town, nBed, nKit, nBath, nPark, nLiv);
}
+
+
+ @Override
+ public Vector<RuralHouse> getAllRuralHouses() throws RemoteException,
+ Exception {
+ return dbMngr.getAllRuralHouses();
+ }
+
+
+
+ @Override
+ public RuralHouse getHouseByName(String Name) {
+ return this.dbMngr.getRuralHouseByName(Name);
+ }
+
+
+
+
+
// For future implementation
// @Override
- // public void modifyHouse(int houseNumber, Owner owner, String description,
+ // public void modifyHouse(int houseName, Owner owner, String description,
// String town, int nRooms, int nKitchens, int nBaths, int nLivings,
// int nParkings) {
// // TODO Auto-generated method stub