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