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 super();
50 _creationDate = aCreationDate;
51 _amount = aAmount;
52 _madeBy = aMadeBy;
53 }
54
55
56
57
58
59
60 public Date getCreationDate() {
61 return _creationDate;
62 }
63
64
65
66
67
68
69 public double getAmount() {
70 return _amount;
71 }
72
73
74
75
76
77
78 public String getMadeBy() {
79 return _madeBy;
80 }
81 }
82
83 }