3 import java.rmi.RemoteException;
4 import java.rmi.server.UnicastRemoteObject;
6 import javax.mail.MessagingException;
8 import common.AccountInterface;
9 import dataAccess.DB4oManager;
10 import domain.Account;
12 public class AccountManager extends UnicastRemoteObject implements AccountInterface {
17 private static final long serialVersionUID = 1L;
18 private DB4oManager dbMngr;
21 public AccountManager() throws RemoteException {
23 dbMngr = DB4oManager.getInstance();
24 } catch (Exception e) {
30 public boolean addAccount(Account ac) throws RemoteException {
31 if(this.dbMngr.addAccount(ac)){
33 MailManager.getInstance().Send(ac.getOwner().getMailAccount(), "Entered into the system", "Congratulations");
34 } catch (MessagingException e) {
43 public boolean removeAccount(Account ac)throws RemoteException {
44 if(this.dbMngr.removeAccount(ac))