From: camjan Date: Tue, 19 May 2015 14:51:35 +0000 (+0200) Subject: Some improvements done, owner deletion started, some bugs remain there X-Git-Url: https://xp-dev.com/git/RRRRHHHH_Code/commitdiff_plain/fca164613c536b71c093e6104901cd35ab8522f0 Some improvements done, owner deletion started, some bugs remain there --- diff --git a/ruralHouses client/src/common/BookingInterface.java b/ruralHouses client/src/common/BookingInterface.java index 8262f30..8780f2f 100644 --- a/ruralHouses client/src/common/BookingInterface.java +++ b/ruralHouses client/src/common/BookingInterface.java @@ -16,7 +16,7 @@ public interface BookingInterface extends Remote { public int getNumber() throws RemoteException; - public void removeDenyBooking(Booking b) throws RemoteException; + public void denyBooking(Booking b) throws RemoteException; public void acceptBooking(Booking b) throws RemoteException; diff --git a/ruralHouses client/src/domain/Client.java b/ruralHouses client/src/domain/Client.java index 4dd9eb2..a4c0baf 100644 --- a/ruralHouses client/src/domain/Client.java +++ b/ruralHouses client/src/domain/Client.java @@ -1,7 +1,13 @@ package domain; -public class Client { +import java.io.Serializable; +public class Client implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = 1L; private String name; private String mailAccount; private String telephone; diff --git a/ruralHouses client/src/domain/RuralHouse.java b/ruralHouses client/src/domain/RuralHouse.java index 4245458..d988b39 100644 --- a/ruralHouses client/src/domain/RuralHouse.java +++ b/ruralHouses client/src/domain/RuralHouse.java @@ -14,8 +14,8 @@ public class RuralHouse implements Serializable { private Owner owner; private String district; private HouseFeatures features; - public Vector offers; - public boolean isAccepted; + private Vector offers; + private boolean isAccepted; public RuralHouse() { super(); @@ -167,4 +167,12 @@ public class RuralHouse implements Serializable { } + public boolean isAccepted() { + return isAccepted; + } + + public void setAccepted(boolean isAccepted) { + this.isAccepted = isAccepted; + } + } diff --git a/ruralHouses client/src/gui/BookRuralHouseConfirmationWindow.java b/ruralHouses client/src/gui/BookRuralHouseConfirmationWindow.java index a268b46..a313f3f 100644 --- a/ruralHouses client/src/gui/BookRuralHouseConfirmationWindow.java +++ b/ruralHouses client/src/gui/BookRuralHouseConfirmationWindow.java @@ -79,10 +79,10 @@ public class BookRuralHouseConfirmationWindow extends JFrame { jTextField3.setBounds(new Rectangle(180, 140, 115, 25)); jTextField3.setEditable(false); - jTextField3.setText(Float.toString(book.getPrice()) + " �"); + jTextField3.setText(Float.toString(book.getPrice()) + "€"); jTextField4.setBounds(new Rectangle(180, 175, 115, 25)); jTextField4.setEditable(false); - jTextField4.setText(Float.toString(book.getPrice()*(float)0.2) + " �"); + jTextField4.setText(Float.toString(book.getPrice()*(float)0.2) + "€"); this.getContentPane().add(jTextField4, null); this.getContentPane().add(jTextField3, null); this.getContentPane().add(jLabel5, null); diff --git a/ruralHouses client/src/gui/DeleteOfferGUI.java b/ruralHouses client/src/gui/DeleteOfferGUI.java index d3a79e4..0ed19e8 100644 --- a/ruralHouses client/src/gui/DeleteOfferGUI.java +++ b/ruralHouses client/src/gui/DeleteOfferGUI.java @@ -50,7 +50,7 @@ public class DeleteOfferGUI extends JFrame { comboBox_1 = new JComboBox(); comboBox_1.setBounds(101, 76, 314, 20); - Vector vo = ((RuralHouse) comboBox.getSelectedItem()).offers; + Vector vo = ((RuralHouse) comboBox.getSelectedItem()).getAllOffers(); comboBox_1.removeAllItems(); for (Offer of : vo) { comboBox_1.addItem(of); @@ -68,7 +68,7 @@ public class DeleteOfferGUI extends JFrame { @Override public void itemStateChanged(ItemEvent arg0) { - Vector vo = ((RuralHouse) comboBox.getSelectedItem()).offers; + Vector vo = ((RuralHouse) comboBox.getSelectedItem()).getAllOffers(); comboBox_1.removeAllItems(); for (Offer of : vo) { comboBox_1.addItem(of); diff --git a/ruralHouses client/src/gui/DeleteOwnerGUI.java b/ruralHouses client/src/gui/DeleteOwnerGUI.java new file mode 100644 index 0000000..ac471ed --- /dev/null +++ b/ruralHouses client/src/gui/DeleteOwnerGUI.java @@ -0,0 +1,5 @@ +package gui; + +public class DeleteOwnerGUI { + +} diff --git a/ruralHouses client/src/gui/HouseFeaturesGUI.java b/ruralHouses client/src/gui/HouseFeaturesGUI.java index 254f9c9..1e49dca 100644 --- a/ruralHouses client/src/gui/HouseFeaturesGUI.java +++ b/ruralHouses client/src/gui/HouseFeaturesGUI.java @@ -55,6 +55,7 @@ public class HouseFeaturesGUI extends JFrame { private JTable table; private DefaultTableModel tableModel; private RuralHouse rh; + private Vector offers= new Vector(); private JTextField telIn; private int row; private JLabel labelPhone; @@ -238,7 +239,8 @@ public class HouseFeaturesGUI extends JFrame { while (rhs.hasMoreElements()) { Offer of = rhs.nextElement(); if (of.getBookings() == null - || of.isBooked()) { + || !of.isBooked()) { + offers.add(of); Vector row = new Vector(); row.add(of.getOfferNumber()); row.add(of.getFirstDay()); @@ -301,8 +303,8 @@ public class HouseFeaturesGUI extends JFrame { if (table.getRowCount() != 0) { Client cl = new Client(nameField.getText(), mailField.getText(), telIn.getText()); - book = bookingM.createBooking(rh, rh.offers.get(row) - .getFirstDay(), rh.offers.get(row).getLastDay(),cl); + book = bookingM.createBooking(rh, offers.get(row) + .getFirstDay(), offers.get(row).getLastDay(),cl); } } catch (Exception e) { e.printStackTrace(); diff --git a/ruralHouses client/src/gui/ModifyOfferGUI.java b/ruralHouses client/src/gui/ModifyOfferGUI.java index 7cb5b85..171bcb9 100644 --- a/ruralHouses client/src/gui/ModifyOfferGUI.java +++ b/ruralHouses client/src/gui/ModifyOfferGUI.java @@ -123,9 +123,9 @@ public class ModifyOfferGUI extends JFrame { @Override public void itemStateChanged(ItemEvent arg0) { - Vector vo = ((RuralHouse) jComboBox1.getSelectedItem()).offers; + Vector vo = ((RuralHouse) jComboBox1.getSelectedItem()).getAllOffers(); comboBox_o.removeAllItems(); - if (!((RuralHouse) jComboBox1.getSelectedItem()).offers + if (!((RuralHouse) jComboBox1.getSelectedItem()).getAllOffers() .isEmpty()) { jCalendar1.setEnabled(true); jCalendar2.setEnabled(true); diff --git a/ruralHouses client/src/gui/OwnerRegistrationGUI.java b/ruralHouses client/src/gui/OwnerRegistrationGUI.java index 5a4ffe9..62395d5 100644 --- a/ruralHouses client/src/gui/OwnerRegistrationGUI.java +++ b/ruralHouses client/src/gui/OwnerRegistrationGUI.java @@ -41,10 +41,9 @@ public class OwnerRegistrationGUI extends JFrame { * Create the frame. */ public OwnerRegistrationGUI() { - + try { - am = (AdminInterface) Naming - .lookup(___IntNames.AdminManager); + am = (AdminInterface) Naming.lookup(___IntNames.AdminManager); } catch (Exception e1) { System.out.println("Error accessing remote authentication: " + e1.toString()); @@ -139,23 +138,32 @@ public class OwnerRegistrationGUI extends JFrame { private void jButton_ActionPerformed(ActionEvent e) { - Owner own = new Owner(this.nameField.getText(), - this.bank1Field.getText() + " " + this.bank2Field.getText() - + " " + this.bank3Field.getText() + " " - + this.bank4Field.getText(), this.emailField.getText()); - - - try { - if (this.am.addAccountRequest(this.userNameField.getText(), - this.passField.getText(), own)) { - this.am.saveInstance(); - this.feedback.setText("Request sended"); - } else { - this.feedback.setText("Can't send the request"); + if (!emailField + .getText() + .matches( + "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$") + || !this.nameField.getText().isEmpty()||this.bank1Field.getText().length()!=4 || this.bank2Field.getText().length()!=4 + ||this.bank3Field.getText().length()!=2 || this.bank4Field.getText().length()!=10) { + Owner own = new Owner(this.nameField.getText(), + this.bank1Field.getText() + " " + this.bank2Field.getText() + + " " + this.bank3Field.getText() + " " + + this.bank4Field.getText(), + this.emailField.getText()); + + try { + if (this.am.addAccountRequest(this.userNameField.getText(), + this.passField.getText(), own)) { + this.am.saveInstance(); + this.feedback.setText("Request sended"); + } else { + this.feedback.setText("Can't send the request"); + } + } catch (RemoteException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); } - } catch (RemoteException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); + } else { + this.feedback.setText("Bad formatted data"); } } diff --git a/ruralHouses client/src/gui/listOfBookingRequestsGUI.java b/ruralHouses client/src/gui/listOfBookingRequestsGUI.java index 982d7f2..3db660d 100644 --- a/ruralHouses client/src/gui/listOfBookingRequestsGUI.java +++ b/ruralHouses client/src/gui/listOfBookingRequestsGUI.java @@ -1,10 +1,14 @@ package gui; +import java.awt.Color; +import java.awt.Component; import java.awt.Font; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.rmi.Naming; import java.rmi.RemoteException; +import java.util.Date; import java.util.Enumeration; import java.util.Vector; @@ -15,10 +19,12 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.border.EmptyBorder; +import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; import common.BookingInterface; - +import common.OfferInterface; +import configuration.___IntNames; import domain.Booking; import domain.Offer; @@ -31,7 +37,7 @@ public class listOfBookingRequestsGUI extends JFrame { private JPanel contentPane; private JTable table; private Offer off; - private BookingInterface bookM =null; + private BookingInterface bookM = null; private DefaultTableModel tableModel; private Vector bookings = new Vector(); @@ -56,8 +62,8 @@ public class listOfBookingRequestsGUI extends JFrame { contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); - - this.bookings= this.off.getBookings(); + + this.bookings = this.off.getBookings(); JLabel lblNewLabel = new JLabel(); lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 27)); lblNewLabel.setBounds(23, 41, 536, 33); @@ -80,18 +86,26 @@ public class listOfBookingRequestsGUI extends JFrame { }; }; scrollPane.setViewportView(table); - tableModel = new DefaultTableModel(null, new String[] { - "Booking Number", "Booking Date","Name","E-mail", "Telephone" }); + tableModel = new DefaultTableModel(null, + new String[] { "Booking Number", "Booking Date", "Name", + "E-mail", "Telephone" }); - // Maybe there is a better way to avoid interaction. - // table.setEnabled(false); table.setModel(tableModel); JButton btnNewButton = new JButton("Confirm Booking"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + try { + bookM = (BookingInterface) Naming + .lookup(___IntNames.BookingManager); + } catch (Exception e1) { + System.out + .println("Error accessing remote authentication: " + + e1.toString()); + } if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { - if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { + if (table.getRowCount() != 0 + && table.getSelectedRow() != -1) { Booking book = bookings.get(table.getSelectedRow()); try { bookM.acceptBooking(book); @@ -109,20 +123,29 @@ public class listOfBookingRequestsGUI extends JFrame { JButton btnDenyAddition = new JButton("Deny Booking"); btnDenyAddition.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { + try { + bookM = (BookingInterface) Naming + .lookup(___IntNames.BookingManager); + } catch (Exception e1) { + System.out + .println("Error accessing remote authentication: " + + e1.toString()); + } if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { Booking book = bookings.get(table.getSelectedRow()); try { - bookM.removeDenyBooking(book); + bookM.denyBooking(book); } catch (RemoteException e) { e.printStackTrace(); } + bookings.remove(book); } } }); btnDenyAddition.setBounds(390, 395, 169, 25); contentPane.add(btnDenyAddition); - + Enumeration en = this.bookings.elements(); Booking book; while (en.hasMoreElements()) { @@ -135,6 +158,38 @@ public class listOfBookingRequestsGUI extends JFrame { row.add(book.getClient().getTelephone()); tableModel.addRow(row); } + table.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() { + /** + * + */ + private static final long serialVersionUID = 1L; + + public int daysBetween(Date d1, Date d2) { + return (int) ((d2.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24)); + } + @Override + public Component getTableCellRendererComponent(JTable table, + Object value, boolean isSelected, boolean hasFocus, + int row, int col) { + + super.getTableCellRendererComponent(table, value, isSelected, + hasFocus, row, col); + + Date bookDay = (Date) table.getModel().getValueAt(row, 1); + Date currentDay = new java.util.Date(System.currentTimeMillis()); + + if (daysBetween(bookDay, currentDay) > 3) { + setBackground(Color.RED); + setForeground(Color.BLACK); + } else { + setBackground(Color.GREEN); + setForeground(Color.BLACK); + } + + return this; + } + }); } + } diff --git a/ruralHouses client/src/gui/listOfOffers.java b/ruralHouses client/src/gui/listOfOffers.java index 76006af..0792540 100644 --- a/ruralHouses client/src/gui/listOfOffers.java +++ b/ruralHouses client/src/gui/listOfOffers.java @@ -100,7 +100,6 @@ public class listOfOffers extends JFrame { row.add(of.getPrice()); row.add(of.getRuralHouse().getHouseName()); tableModel.addRow(row); - } } diff --git a/ruralHouses client/src/gui/listOfRemovalRequestsGUI.java b/ruralHouses client/src/gui/listOfRemovalRequestsGUI.java index 62daded..071ee51 100644 --- a/ruralHouses client/src/gui/listOfRemovalRequestsGUI.java +++ b/ruralHouses client/src/gui/listOfRemovalRequestsGUI.java @@ -41,8 +41,7 @@ public class listOfRemovalRequestsGUI extends JFrame { */ public listOfRemovalRequestsGUI() { try { - am = (AdminInterface) Naming - .lookup(___IntNames.AdminManager); + am = (AdminInterface) Naming.lookup(___IntNames.AdminManager); } catch (Exception e1) { System.out.println("Error accessing remote authentication: " + e1.toString()); @@ -94,51 +93,50 @@ public class listOfRemovalRequestsGUI extends JFrame { btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { - HouseInterface hm= null; + HouseInterface hm = null; try { hm = (HouseInterface) Naming .lookup(___IntNames.HouseManager); } catch (Exception e1) { - System.out.println("Error accessing remote authentication: " - + e1.toString()); + System.out + .println("Error accessing remote authentication: " + + e1.toString()); } RuralHouse rh = houses.get(table.getSelectedRow()); - ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh)); - try { - hm.removeHouse(rh, rh.getOwner()); - am.removeHouseDeletionRequests(rh); - am.saveInstance(); - } catch (RemoteException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - houses.remove(rh); - - - + + try { + hm.removeHouse(rh, rh.getOwner()); + am.removeHouseDeletionRequests(rh); + am.saveInstance(); + } catch (RemoteException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + ((DefaultTableModel) table.getModel()).removeRow(houses + .indexOf(rh)); + } } }); btnNewButton.setBounds(90, 396, 169, 25); contentPane.add(btnNewButton); - + JButton btnNewButton_1 = new JButton("Deny Deletion"); btnNewButton_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { RuralHouse rh = houses.get(table.getSelectedRow()); - ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh)); - houses.remove(rh); - try { - am.removeHouseDeletionRequests(rh); - am.saveInstance(); - } catch (RemoteException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - - + ((DefaultTableModel) table.getModel()).removeRow(houses + .indexOf(rh)); + houses.remove(rh); + try { + am.removeHouseDeletionRequests(rh); + am.saveInstance(); + } catch (RemoteException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } } }); diff --git a/ruralHouses/config.xml b/ruralHouses/config.xml index 9099bad..0ce7502 100644 --- a/ruralHouses/config.xml +++ b/ruralHouses/config.xml @@ -10,7 +10,7 @@ db/casas.db4o initialize 10 - 8 + 10 8100 softEng i4softwEngin2matx diff --git a/ruralHouses/src/businessLogic/BookingManager.java b/ruralHouses/src/businessLogic/BookingManager.java index 601eb3a..a5202c5 100644 --- a/ruralHouses/src/businessLogic/BookingManager.java +++ b/ruralHouses/src/businessLogic/BookingManager.java @@ -5,10 +5,12 @@ import java.rmi.server.UnicastRemoteObject; import java.util.Date; import java.util.Vector; +import javax.mail.MessagingException; + import com.db4o.ObjectContainer; import com.db4o.ObjectSet; -import common.BookingInterface; +import common.BookingInterface; import dataAccess.DB4oManager; import domain.Booking; import domain.Client; @@ -71,25 +73,21 @@ public final class BookingManager extends UnicastRemoteObject implements Booking return theBookingManager; } - public void removeDenyBooking(Booking b) throws RemoteException{ - b.getOffer().getBookings().remove(b); + public void denyBooking(Booking b) throws RemoteException{ this.dbMngr.removeBooking(b); } public void acceptBooking(Booking b) throws RemoteException{ b.getOffer().setBooked(true); - for(Booking boo : b.getOffer().getBookings()){ - if(!boo.equals(b)) - b.getOffer().getBookings().remove(b); - } + b.getOffer().getBookings().clear(); + b.getOffer().getBookings().add(b); this.dbMngr.acceptBooking(b.getOffer()); - /*try { + try { MailManager.getInstance().Send(b.getClient().getMailAccount(), "Your booking has been accepted","Here should be the bill"); } catch (MessagingException e) { - // TODO Auto-generated catch block e.printStackTrace(); - }*/ + } } /** diff --git a/ruralHouses/src/businessLogic/OfferManager.java b/ruralHouses/src/businessLogic/OfferManager.java index 4c01cc0..fe9cdb1 100644 --- a/ruralHouses/src/businessLogic/OfferManager.java +++ b/ruralHouses/src/businessLogic/OfferManager.java @@ -56,7 +56,7 @@ public final class OfferManager extends UnicastRemoteObject implements OfferInte public void deleteOffer(RuralHouse rh, Offer o) throws RemoteException, Exception{ - rh.offers.removeElement(o); + rh.getAllOffers().removeElement(o); dbMngr.deleteOffer( o); } diff --git a/ruralHouses/src/common/BookingInterface.java b/ruralHouses/src/common/BookingInterface.java index 8262f30..8780f2f 100644 --- a/ruralHouses/src/common/BookingInterface.java +++ b/ruralHouses/src/common/BookingInterface.java @@ -16,7 +16,7 @@ public interface BookingInterface extends Remote { public int getNumber() throws RemoteException; - public void removeDenyBooking(Booking b) throws RemoteException; + public void denyBooking(Booking b) throws RemoteException; public void acceptBooking(Booking b) throws RemoteException; diff --git a/ruralHouses/src/dataAccess/DB4oManager.java b/ruralHouses/src/dataAccess/DB4oManager.java index 6089a74..7ae4fa9 100644 --- a/ruralHouses/src/dataAccess/DB4oManager.java +++ b/ruralHouses/src/dataAccess/DB4oManager.java @@ -82,9 +82,11 @@ public class DB4oManager { configuration.common().activationDepth(c.getActivationDepth()); configuration.common().updateDepth(c.getUpdateDepth()); configuration.common().objectClass(Owner.class).cascadeOnUpdate(true); - configuration.common().objectClass(Owner.class).cascadeOnDelete(true); + configuration.common().objectClass(Booking.class).cascadeOnDelete(true); configuration.common().objectClass(RuralHouse.class) .cascadeOnUpdate(true); + configuration.common().objectClass(Offer.class) + .cascadeOnUpdate(true); configuration.common().objectClass(Account.class).cascadeOnUpdate(true); db = Db4oEmbedded.openFile(configuration, c.getDb4oFilename()); } @@ -207,7 +209,7 @@ public class DB4oManager { try { ObjectSet of = db.queryByExample(offer); RuralHouse rh = of.get(0).getRuralHouse(); - System.out.println(rh.offers.remove(of.get(0))); + System.out.println(rh.getAllOffers().remove(of.get(0))); db.store(rh); db.commit(); @@ -562,10 +564,10 @@ public class DB4oManager { return false; } - // TODO this method should be improved. public void acceptBooking(Offer of) { - Offer off = new Offer(of.getOfferNumber(), of.getRuralHouse(), - of.getFirstDay(), of.getLastDay(), of.getPrice()); + Offer off = new Offer(of.getOfferNumber(), new RuralHouse(of + .getRuralHouse().getHouseName(), null, null, null, null), null, + null, 0); if (c.isDatabaseLocal() == false) openSDB(); else @@ -573,8 +575,12 @@ public class DB4oManager { try { ObjectSet result = db.queryByExample(off); - this.deleteOffer(result.get(0)); - db.store(of); + db.delete(result.get(0)); + RuralHouse rh = result.get(0).getRuralHouse(); + of.setRuralHouse(rh); + rh.getAllOffers().remove(result.get(0)); + rh.getAllOffers().add(of); + db.store(rh); db.close(); } catch (Exception e) { @@ -590,9 +596,8 @@ public class DB4oManager { openDB(); try { ObjectSet result = db.queryByExample(b); - ObjectSet result2 = db.queryByExample(b.getClient()); - db.delete(result.get(0)); - db.delete(result2.get(0)); + result.get(0).getOffer().getBookings().remove(b); + db.store(result.get(0).getOffer()); db.commit(); } catch (Exception e) { e.printStackTrace(); diff --git a/ruralHouses/src/domain/Client.java b/ruralHouses/src/domain/Client.java index 4dd9eb2..28730df 100644 --- a/ruralHouses/src/domain/Client.java +++ b/ruralHouses/src/domain/Client.java @@ -1,7 +1,13 @@ package domain; -public class Client { +import java.io.Serializable; +public class Client implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = 1L; private String name; private String mailAccount; private String telephone; diff --git a/ruralHouses/src/domain/RuralHouse.java b/ruralHouses/src/domain/RuralHouse.java index 4245458..d988b39 100644 --- a/ruralHouses/src/domain/RuralHouse.java +++ b/ruralHouses/src/domain/RuralHouse.java @@ -14,8 +14,8 @@ public class RuralHouse implements Serializable { private Owner owner; private String district; private HouseFeatures features; - public Vector offers; - public boolean isAccepted; + private Vector offers; + private boolean isAccepted; public RuralHouse() { super(); @@ -167,4 +167,12 @@ public class RuralHouse implements Serializable { } + public boolean isAccepted() { + return isAccepted; + } + + public void setAccepted(boolean isAccepted) { + this.isAccepted = isAccepted; + } + }