Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard
 
4bc36b7ddf2a9626f60c551cf999ec24052087cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package businessLogic;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Vector;

import common.HouseInterface;

import dataAccess.DB4oManager;
import domain.Owner;
import domain.RuralHouse;


public class HouseManager extends UnicastRemoteObject implements HouseInterface {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	DB4oManager dbMngr;
	public HouseManager() throws RemoteException {
		super();
		try {
			dbMngr = DB4oManager.getInstance();
		} catch (Exception e) {

			e.printStackTrace();
		}
	}


	private boolean suitsRegulations(int nKitchens, int nBaths, int nLivings) {
		if (nKitchens < 1 || nLivings < 3 || nBaths < 2)
			return false;
		else
			return true;
	}

	@Override
	public boolean registerNewHouse(RuralHouse rh) {

		boolean stored = false;
		if (!suitsRegulations(rh.getFeatures().getnKitchens(), rh.getFeatures()
				.getnBaths(), rh.getFeatures().getnKitchens()))
			return false;
		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);
	}



	public Vector<RuralHouse> getHouses(Owner ow, String name,String town, int nBed, int nKit,
			int nBath, int nPark, int nLiv) {

		return this.dbMngr.getRuralHouses( ow, name ,town, nBed, nKit, nBath, nPark, nLiv);
	}

	@Override
	public Vector<RuralHouse> getAllRuralHouses() throws RemoteException,
			Exception {
		return dbMngr.getAllRuralHouses();
	}



	// For future implementation
	// @Override
	// 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
	//
	// }

	// Maybe returning the offer is not necessary. Depends on GUI
	// implementation.

}

Commits for RRRRHHHH_CoderuralHouses/src/businessLogic/HouseManager.java

Diff revisions: vs.
Revision Author Commited Message
ad3773 ... Diff Diff pinene picture pinene Tue 19 May, 2015 18:01:40 +0000

data now is gotten using queries

799949 ... Diff Diff epinzolas001 Mon 18 May, 2015 11:12:36 +0000

debugging

4f8bcc ... Diff Diff epinzolas001 Mon 18 May, 2015 09:49:54 +0000

Merge conflicts solutioned

7bf57b ... Diff Diff camjan Sun 17 May, 2015 11:59:22 +0000

Possibility of registering new owners added

dd0098 ... Diff Diff pinene picture pinene Sun 19 Apr, 2015 15:23:19 +0000

database management

520867 ... Diff Diff pinene picture pinene Sun 19 Apr, 2015 14:09:12 +0000

tmp

5761bc ... Diff Diff camjan Wed 15 Apr, 2015 15:27:07 +0000

Bugs when deleting houses and offers fixed and GUI’s adapated for empty cases

e2ae30 ... Diff Diff Eneko Pinzolas Murua Tue 14 Apr, 2015 15:07:35 +0000

imports leaned

66f0c8 ... Diff Diff Eneko Pinzolas Murua Sun 12 Apr, 2015 18:11:42 +0000

Model modified so that owners now request for a new house insetion or a house removal. Furthermore, all Administrator GUI and bussines logic create. However, Login GUI and BussinesLogic are to be modified so that they integrate Admin identification.

afdc66 ... camjan Wed 25 Mar, 2015 16:43:35 +0000

Villatripas de arriba districs added and the option of searching houses with diferent parameters