1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.example.loanbroker.esn; |
12 | |
|
13 | |
import org.mule.example.loanbroker.DefaultLoanBroker; |
14 | |
import org.mule.example.loanbroker.LoanBrokerException; |
15 | |
import org.mule.example.loanbroker.credit.CreditAgencyService; |
16 | |
import org.mule.example.loanbroker.messages.CreditProfile; |
17 | |
import org.mule.example.loanbroker.messages.CustomerQuoteRequest; |
18 | |
import org.mule.example.loanbroker.messages.LoanBrokerQuoteRequest; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | 2046 | public class SynchronousLoanBroker extends DefaultLoanBroker |
25 | |
{ |
26 | |
|
27 | |
|
28 | |
|
29 | |
private CreditAgencyService creditAgency; |
30 | |
|
31 | |
@Override |
32 | |
public Object getLoanQuote(CustomerQuoteRequest request) throws LoanBrokerException |
33 | |
{ |
34 | 2046 | super.getLoanQuote(request); |
35 | 2046 | LoanBrokerQuoteRequest bqr = new LoanBrokerQuoteRequest(); |
36 | 2046 | bqr.setCustomerRequest(request); |
37 | |
|
38 | |
|
39 | 2046 | CreditProfile cp = creditAgency.getCreditProfile(request.getCustomer()); |
40 | 2046 | bqr.setCreditProfile(cp); |
41 | |
|
42 | 2046 | return bqr; |
43 | |
} |
44 | |
|
45 | |
public CreditAgencyService getCreditAgency() |
46 | |
{ |
47 | 0 | return creditAgency; |
48 | |
} |
49 | |
|
50 | |
public void setCreditAgency(CreditAgencyService creditAgency) |
51 | |
{ |
52 | 2046 | this.creditAgency = creditAgency; |
53 | 2046 | } |
54 | |
} |