3 import java.rmi.RemoteException;
4 import java.rmi.server.UnicastRemoteObject;
6 import javax.mail.MessagingException;
8 import common.AccountInterface;
10 import dataAccess.DB4oManager;
11 import domain.Account;
12 import domain.Administrator;
14 public class AccountManager extends UnicastRemoteObject implements AccountInterface {
19 private static final long serialVersionUID = 1L;
20 private DB4oManager dbMngr;
23 public AccountManager() throws RemoteException {
25 dbMngr = DB4oManager.getInstance();
26 } catch (Exception e) {
32 public boolean addAccount(int index) throws RemoteException {
33 Account ac = Administrator.getInstance().getNewOwnerRequest().get(index);
34 if(this.dbMngr.addAccount(ac)){
36 MailManager.getInstance().Send(ac.getOwner().getMailAccount(), "Entered into the system", "Congratulations");
37 } catch (MessagingException e) {
46 public boolean removeAccount(Account ac)throws RemoteException {
47 if(this.dbMngr.removeAccount(ac))