1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.shiro.samples.aspectj.bank; |
20 | |
|
21 | |
import java.util.Date; |
22 | |
|
23 | |
public interface BankService { |
24 | |
|
25 | |
public long[] searchAccountIdsByOwner(String anOwnerName); |
26 | |
|
27 | |
public long createNewAccount(String anOwnerName); |
28 | |
|
29 | |
public double getBalanceOf(long anAccountId) throws AccountNotFoundException; |
30 | |
|
31 | |
public String getOwnerOf(long anAccountId) throws AccountNotFoundException; |
32 | |
|
33 | |
public double depositInto(long anAccountId, double anAmount) throws AccountNotFoundException, InactiveAccountException; |
34 | |
|
35 | |
public double withdrawFrom(long anAccountId, double anAmount) throws AccountNotFoundException, NotEnoughFundsException, InactiveAccountException; |
36 | |
|
37 | |
public TxLog[] getTxHistoryFor(long anAccountId) throws AccountNotFoundException; |
38 | |
|
39 | |
public double closeAccount(long anAccountId) throws AccountNotFoundException, InactiveAccountException; |
40 | |
|
41 | |
public boolean isAccountActive(long anAccountId) throws AccountNotFoundException; |
42 | |
|
43 | |
public static class TxLog { |
44 | |
private Date _creationDate; |
45 | |
private double _amount; |
46 | |
private String _madeBy; |
47 | |
|
48 | |
public TxLog(Date aCreationDate, double aAmount, String aMadeBy) { |
49 | 102 | super(); |
50 | 102 | _creationDate = aCreationDate; |
51 | 102 | _amount = aAmount; |
52 | 102 | _madeBy = aMadeBy; |
53 | 102 | } |
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
public Date getCreationDate() { |
61 | 0 | return _creationDate; |
62 | |
} |
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
public double getAmount() { |
70 | 0 | return _amount; |
71 | |
} |
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
public String getMadeBy() { |
79 | 0 | return _madeBy; |
80 | |
} |
81 | |
} |
82 | |
|
83 | |
} |