View Javadoc

1   /*
2    *  IAccountManager
3    *
4    *  author nambi sankaran
5    *  copyright (C) 2009 nambi sankaran
6    *
7    *  This program is free software: you can redistribute it and/or modify
8    *  it under the terms of the GNU General Public License as published by
9    *  the Free Software Foundation, either version 3 of the License, or
10   *  (at your option) any later version.
11   *
12   *  This program is distributed in the hope that it will be useful,
13   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   *  GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License
18   *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19   */
20  package net.sf.emarket.account.service;
21  
22  import java.io.Serializable;
23  import java.util.List;
24  
25  import net.sf.emarket.account.domain.Account;
26  import net.sf.emarket.account.domain.AcctPosition;
27  import net.sf.emarket.account.domain.AcctPositionSummary;
28  import net.sf.emarket.account.domain.AcctPositionTransfer;
29  import net.sf.emarket.account.domain.AcctValue;
30  import net.sf.emarket.account.domain.CashBalance;
31  import net.sf.emarket.account.domain.CashTransfer;
32  import net.sf.emarket.user.domain.User;
33  
34  public interface IAccountManagerService extends Serializable {
35  
36      public void addAccount(Account account);
37      public Account getAccountById(String acctId);
38      public int updateAccount(Account account);
39      public int deleteAccountById(String acctId);
40      public List<Account> getAccountsForUser(User user);
41      public List<Account> getAccountsOfType( String acctType );
42      
43      public CashBalance getCashBalance(Account account);
44      public void tranferCash(CashTransfer transfer) throws NotEnoughCashException, NotValidAccountException;
45      
46  	public AcctPosition getAccountPosition( long acctPositionId);
47  	public AcctPosition addAccountPosition( AcctPosition position );
48  	public AcctPosition updateAccountPosition( AcctPosition position );
49  	public void deleteAccountPosition( AcctPosition position);
50  	public void transferPosition( AcctPositionTransfer transfer ) throws NotEnoughPositionsException, NotValidAccountException;
51  	
52  	public List<AcctPosition> getAccountPositions( String acctId );
53  	public List<AcctPosition> getAccountPositions( String acctId, String symbol );
54  	public List<AcctPositionSummary> getAccountPositionsSummary( String acctId);
55      public float getTotalValueOfPositions( String acctId );
56      
57      public List<AcctValue> getTopAccounts(int count);
58  }