projects
/
RRRRHHHH_Code
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7999499
)
New owners now can be created properly.
author
epinzolas001
<epinzolas001@u004529.gl.ehu.es>
Mon, 18 May 2015 11:44:38 +0000
(13:44 +0200)
committer
epinzolas001
<epinzolas001@u004529.gl.ehu.es>
Mon, 18 May 2015 11:44:38 +0000
(13:44 +0200)
ruralHouses client/src/common/AccountInterface.java
patch
|
blob
|
history
ruralHouses client/src/common/AdminInterface.java
patch
|
blob
|
history
ruralHouses client/src/configuration/___IntNames.java
patch
|
blob
|
history
ruralHouses client/src/gui/listOfOwnerAddittionRequests.java
patch
|
blob
|
history
ruralHouses/src/businessLogic/AccountManager.java
patch
|
blob
|
history
ruralHouses/src/businessLogic/AdminManager.java
patch
|
blob
|
history
ruralHouses/src/common/AccountInterface.java
patch
|
blob
|
history
ruralHouses/src/common/AdminInterface.java
patch
|
blob
|
history
ruralHouses/src/launcher/RMILauncher.java
patch
|
blob
|
history
diff --git
a/ruralHouses client/src/common/AccountInterface.java
b/ruralHouses client/src/common/AccountInterface.java
index
cb53684
..
9d489d4
100644
(file)
--- a/
ruralHouses client/src/common/AccountInterface.java
+++ b/
ruralHouses client/src/common/AccountInterface.java
@@
-9,7
+9,7
@@
import domain.Owner;
public interface AccountInterface extends Remote{
public interface AccountInterface extends Remote{
- public boolean addAccount(
Account ac
) throws RemoteException;
+ public boolean addAccount(
int index
) throws RemoteException;
public boolean removeAccount(Account ac) throws RemoteException;
}
public boolean removeAccount(Account ac) throws RemoteException;
}
diff --git
a/ruralHouses client/src/common/AdminInterface.java
b/ruralHouses client/src/common/AdminInterface.java
index
c45a81c
..
5a76296
100644
(file)
--- a/
ruralHouses client/src/common/AdminInterface.java
+++ b/
ruralHouses client/src/common/AdminInterface.java
@@
-21,7
+21,7
@@
public interface AdminInterface extends Remote {
public void removeHouseDeletionRequests(RuralHouse house) throws RemoteException ;
public void removeHouseDeletionRequests(RuralHouse house) throws RemoteException ;
- public void removeOwnerAdditionRequests(
Account acc
) throws RemoteException ;
+ public void removeOwnerAdditionRequests(
int index
) throws RemoteException ;
public boolean addAdditionRequest(RuralHouse rh) throws RemoteException ;
public boolean addAdditionRequest(RuralHouse rh) throws RemoteException ;
diff --git
a/ruralHouses client/src/configuration/___IntNames.java
b/ruralHouses client/src/configuration/___IntNames.java
index
e2da70d
..
462ff65
100644
(file)
--- a/
ruralHouses client/src/configuration/___IntNames.java
+++ b/
ruralHouses client/src/configuration/___IntNames.java
@@
-1,12
+1,13
@@
package configuration;
public class ___IntNames {
package configuration;
public class ___IntNames {
- private static String serverPath = "rmi://
158.227.140.215
:9999//";
+ private static String serverPath = "rmi://
localhost
:9999//";
public static String AdminManager = serverPath+"AdM";
public static String BookingManager = serverPath+"BoM";
public static String HouseManager = serverPath+"HoM";
public static String LoginManager = serverPath+"LoM";
public static String OfferManager = serverPath+"OfM";
public static String OwnerManager = serverPath+"OwM";
public static String AdminManager = serverPath+"AdM";
public static String BookingManager = serverPath+"BoM";
public static String HouseManager = serverPath+"HoM";
public static String LoginManager = serverPath+"LoM";
public static String OfferManager = serverPath+"OfM";
public static String OwnerManager = serverPath+"OwM";
+ public static String AccountManager = serverPath+"AcM";
}
}
diff --git
a/ruralHouses client/src/gui/listOfOwnerAddittionRequests.java
b/ruralHouses client/src/gui/listOfOwnerAddittionRequests.java
index
9e1b6a3
..
1d78a53
100644
(file)
--- a/
ruralHouses client/src/gui/listOfOwnerAddittionRequests.java
+++ b/
ruralHouses client/src/gui/listOfOwnerAddittionRequests.java
@@
-106,23
+106,22
@@
public class listOfOwnerAddittionRequests extends JFrame {
try {
acm = (AccountInterface) Naming
try {
acm = (AccountInterface) Naming
- .lookup(___IntNames.A
dmin
Manager);
+ .lookup(___IntNames.A
ccount
Manager);
} catch (Exception e1) {
System.out.println("Error accessing remote authentication: "
+ e1.toString());
}
} catch (Exception e1) {
System.out.println("Error accessing remote authentication: "
+ e1.toString());
}
- Account accou = accounts.get(table.getSelectedRow());
+
try {
try {
- acm.addAccount(
accou
);
- am.removeOwnerAdditionRequests(
accou
);
+ acm.addAccount(
table.getSelectedRow()
);
+ am.removeOwnerAdditionRequests(
table.getSelectedRow()
);
am.saveInstance();
} catch (RemoteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
am.saveInstance();
} catch (RemoteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
- ((DefaultTableModel)table.getModel()).removeRow(accounts.indexOf(accou));
- accounts.remove(accou);
+ ((DefaultTableModel)table.getModel()).removeRow(table.getSelectedRow());
}
}
});
}
}
});
@@
-133,17
+132,16
@@
public class listOfOwnerAddittionRequests extends JFrame {
btnDenyAddition.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (table.getRowCount()!=0 && table.getSelectedRow() != -1) {
btnDenyAddition.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (table.getRowCount()!=0 && table.getSelectedRow() != -1) {
- Account acc = accounts.get(table.getSelectedRow());
try {
try {
- am.removeOwnerAdditionRequests(
acc
);
+ am.removeOwnerAdditionRequests(
table.getSelectedRow()
);
am.saveInstance();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
am.saveInstance();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
- ((DefaultTableModel)table.getModel()).removeRow(
accounts.indexOf(acc
));
- accounts.remove(
acc
);
+ ((DefaultTableModel)table.getModel()).removeRow(
table.getSelectedRow(
));
+ accounts.remove(
table.getSelectedRow()
);
}
}
});
}
}
});
diff --git
a/ruralHouses/src/businessLogic/AccountManager.java
b/ruralHouses/src/businessLogic/AccountManager.java
index
3f0bc5b
..
3747973
100644
(file)
--- a/
ruralHouses/src/businessLogic/AccountManager.java
+++ b/
ruralHouses/src/businessLogic/AccountManager.java
@@
-8,6
+8,7
@@
import javax.mail.MessagingException;
import common.AccountInterface;
import dataAccess.DB4oManager;
import domain.Account;
import common.AccountInterface;
import dataAccess.DB4oManager;
import domain.Account;
+import domain.Administrator;
public class AccountManager extends UnicastRemoteObject implements AccountInterface {
public class AccountManager extends UnicastRemoteObject implements AccountInterface {
@@
-27,7
+28,8
@@
public class AccountManager extends UnicastRemoteObject implements AccountInterf
}
}
}
}
- public boolean addAccount(Account ac) throws RemoteException {
+ public boolean addAccount(int index) throws RemoteException {
+ Account ac = Administrator.getInstance().getNewOwnerRequest().get(index);
if(this.dbMngr.addAccount(ac)){
try {
MailManager.getInstance().Send(ac.getOwner().getMailAccount(), "Entered into the system", "Congratulations");
if(this.dbMngr.addAccount(ac)){
try {
MailManager.getInstance().Send(ac.getOwner().getMailAccount(), "Entered into the system", "Congratulations");
diff --git
a/ruralHouses/src/businessLogic/AdminManager.java
b/ruralHouses/src/businessLogic/AdminManager.java
index
9c562fd
..
a344f2c
100644
(file)
--- a/
ruralHouses/src/businessLogic/AdminManager.java
+++ b/
ruralHouses/src/businessLogic/AdminManager.java
@@
-46,8
+46,8
@@
public class AdminManager extends UnicastRemoteObject implements AdminInterface
Administrator.getInstance().getRemoveRequest().remove(house);
}
Administrator.getInstance().getRemoveRequest().remove(house);
}
- public void removeOwnerAdditionRequests(
Account acc
) throws RemoteException {
- Administrator.getInstance().getNewOwnerRequest().remove(
acc
);
+ public void removeOwnerAdditionRequests(
int index
) throws RemoteException {
+ Administrator.getInstance().getNewOwnerRequest().remove(
index
);
}
public boolean addAdditionRequest(RuralHouse rh) throws RemoteException {
}
public boolean addAdditionRequest(RuralHouse rh) throws RemoteException {
diff --git
a/ruralHouses/src/common/AccountInterface.java
b/ruralHouses/src/common/AccountInterface.java
index
07f8ced
..
8e48aeb
100644
(file)
--- a/
ruralHouses/src/common/AccountInterface.java
+++ b/
ruralHouses/src/common/AccountInterface.java
@@
-7,7
+7,7
@@
import domain.Account;
public interface AccountInterface extends Remote{
public interface AccountInterface extends Remote{
- public boolean addAccount(
Account ac
) throws RemoteException;
+ public boolean addAccount(
int index
) throws RemoteException;
public boolean removeAccount(Account ac) throws RemoteException;
}
public boolean removeAccount(Account ac) throws RemoteException;
}
diff --git
a/ruralHouses/src/common/AdminInterface.java
b/ruralHouses/src/common/AdminInterface.java
index
c45a81c
..
5a76296
100644
(file)
--- a/
ruralHouses/src/common/AdminInterface.java
+++ b/
ruralHouses/src/common/AdminInterface.java
@@
-21,7
+21,7
@@
public interface AdminInterface extends Remote {
public void removeHouseDeletionRequests(RuralHouse house) throws RemoteException ;
public void removeHouseDeletionRequests(RuralHouse house) throws RemoteException ;
- public void removeOwnerAdditionRequests(
Account acc
) throws RemoteException ;
+ public void removeOwnerAdditionRequests(
int index
) throws RemoteException ;
public boolean addAdditionRequest(RuralHouse rh) throws RemoteException ;
public boolean addAdditionRequest(RuralHouse rh) throws RemoteException ;
diff --git
a/ruralHouses/src/launcher/RMILauncher.java
b/ruralHouses/src/launcher/RMILauncher.java
index
f5a4cf8
..
167f1e0
100644
(file)
--- a/
ruralHouses/src/launcher/RMILauncher.java
+++ b/
ruralHouses/src/launcher/RMILauncher.java
@@
-4,6
+4,7
@@
import java.rmi.Naming;
import java.rmi.RMISecurityManager;
import java.rmi.Remote;
import java.rmi.RMISecurityManager;
import java.rmi.Remote;
+import businessLogic.AccountManager;
import businessLogic.AdminManager;
import businessLogic.BookingManager;
import businessLogic.HouseManager;
import businessLogic.AdminManager;
import businessLogic.BookingManager;
import businessLogic.HouseManager;
@@
-37,13
+38,15
@@
public class RMILauncher {
boolean off = runOffer();
boolean own = runOwner();
boolean log = runLogin();
boolean off = runOffer();
boolean own = runOwner();
boolean log = runLogin();
+ boolean acc = runAccount();
System.out.println(" Admin: "+adm+
"\t Booking: "+bok+
"\t House: "+hou+
"\t Login: "+log+
"\t Offer: "+off+
System.out.println(" Admin: "+adm+
"\t Booking: "+bok+
"\t House: "+hou+
"\t Login: "+log+
"\t Offer: "+off+
- "\t Owner: "+own);
+ "\t Owner: "+own+
+ "\t Account: "+acc);
}
private static boolean runAdmin() {
}
private static boolean runAdmin() {
@@
-58,6
+61,17
@@
public class RMILauncher {
}
}
}
}
+ private static boolean runAccount() {
+ try {
+ Remote remoteObject = new AccountManager();
+ String authService = "rmi://localhost:9999//AcM";
+ Naming.rebind(authService, remoteObject);
+ return true;
+ } catch (Exception e) {
+ System.out.println(e.toString());
+ return false;
+ }
+ }
private static boolean runBooking() {
try {
private static boolean runBooking() {
try {