| Line 33... |
Line 33... |
| 33 |
* @param args
|
33 |
* @param args
|
| 34 |
*/
|
34 |
*/
|
| 35 |
|
35 |
|
| 36 |
public FedExTrackingService(WarehouseLocation location){
|
36 |
public FedExTrackingService(WarehouseLocation location){
|
| 37 |
clientDetails = getFedExClientDetails(location);
|
37 |
clientDetails = getFedExClientDetails(location);
|
| 38 |
waDetails = getFedExWebAuthenticationDetails();
|
38 |
waDetails = getFedExWebAuthenticationDetails(location);
|
| 39 |
endPointAddress = getFedExEndpointAddress();
|
39 |
endPointAddress = getFedExEndpointAddress();
|
| 40 |
}
|
40 |
}
|
| 41 |
|
41 |
|
| 42 |
public ClientDetail getFedExClientDetails(WarehouseLocation whlocation){
|
42 |
public ClientDetail getFedExClientDetails(WarehouseLocation whlocation){
|
| 43 |
ClientDetail clientDetail = new ClientDetail();
|
43 |
ClientDetail clientDetail = new ClientDetail();
|
| 44 |
String accountNumber ="";
|
44 |
String accountNumber ="";
|
| 45 |
String meterNumber ="";
|
45 |
String meterNumber ="";
|
| 46 |
try {
|
46 |
try {
|
| 47 |
if(WarehouseLocation.Mumbai==whlocation){
|
47 |
if(WarehouseLocation.Mumbai==whlocation){
|
| 48 |
accountNumber = ConfigClient.getClient().get("fedex_account_number_mumbai");
|
48 |
accountNumber = ConfigClient.getClient().get("fedex_account_number_mumbai");
|
| - |
|
49 |
meterNumber = ConfigClient.getClient().get("fedex_meter_number_mumbai");
|
| 49 |
}
|
50 |
}
|
| 50 |
else{
|
51 |
else{
|
| 51 |
accountNumber = ConfigClient.getClient().get("fedex_account_number");
|
52 |
accountNumber = ConfigClient.getClient().get("fedex_account_number");
|
| - |
|
53 |
meterNumber = ConfigClient.getClient().get("fedex_meter_number");
|
| 52 |
}
|
54 |
}
|
| 53 |
meterNumber = ConfigClient.getClient().get("fedex_meter_number");
|
- |
|
| 54 |
} catch (ConfigException e) {
|
55 |
} catch (ConfigException e) {
|
| 55 |
log.error("Could not fetch Client Detail", e);
|
56 |
log.error("Could not fetch Client Detail", e);
|
| 56 |
}
|
57 |
}
|
| 57 |
log.info("fedex_account_number in Tracking Service"+accountNumber);
|
58 |
log.info("fedex_account_number in Tracking Service"+accountNumber);
|
| 58 |
log.info("fedex_meter_number in Tracking Service"+meterNumber);
|
59 |
log.info("fedex_meter_number in Tracking Service"+meterNumber);
|
| 59 |
clientDetail.setAccountNumber(accountNumber);
|
60 |
clientDetail.setAccountNumber(accountNumber);
|
| 60 |
clientDetail.setMeterNumber(meterNumber);
|
61 |
clientDetail.setMeterNumber(meterNumber);
|
| 61 |
return clientDetail;
|
62 |
return clientDetail;
|
| 62 |
}
|
63 |
}
|
| 63 |
|
64 |
|
| 64 |
public WebAuthenticationDetail getFedExWebAuthenticationDetails(){
|
65 |
public WebAuthenticationDetail getFedExWebAuthenticationDetails(WarehouseLocation whlocation){
|
| 65 |
WebAuthenticationCredential wac = new WebAuthenticationCredential();
|
66 |
WebAuthenticationCredential wac = new WebAuthenticationCredential();
|
| 66 |
String key="";
|
67 |
String key="";
|
| 67 |
String password="";
|
68 |
String password="";
|
| 68 |
try {
|
69 |
try {
|
| - |
|
70 |
if(WarehouseLocation.Mumbai==whlocation){
|
| - |
|
71 |
key = ConfigClient.getClient().get("fedex_authenication_key_mumbai");
|
| - |
|
72 |
password = ConfigClient.getClient().get("fedex_authenication_password_mumbai");
|
| - |
|
73 |
}
|
| - |
|
74 |
else{
|
| 69 |
key = ConfigClient.getClient().get("fedex_authenication_key");
|
75 |
key = ConfigClient.getClient().get("fedex_authenication_key");
|
| 70 |
password = ConfigClient.getClient().get("fedex_authenication_password");
|
76 |
password = ConfigClient.getClient().get("fedex_authenication_password");
|
| - |
|
77 |
}
|
| 71 |
} catch (ConfigException e) {
|
78 |
} catch (ConfigException e) {
|
| 72 |
log.error("Could not fetch Web Authenication Detail", e);
|
79 |
log.error("Could not fetch Web Authenication Detail", e);
|
| 73 |
}
|
80 |
}
|
| 74 |
log.info("fedex_authenication_key in Tracking Service"+key);
|
81 |
log.info("fedex_authenication_key in Tracking Service"+key);
|
| 75 |
log.info("fedex_authenication_password in Tracking Service"+password);
|
82 |
log.info("fedex_authenication_password in Tracking Service"+password);
|