| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.common.util;
|
1 |
package com.spice.profitmandi.common.util;
|
| 2 |
|
2 |
|
| 3 |
import java.util.HashMap;
|
3 |
import java.util.HashMap;
|
| 4 |
import java.util.Map;
|
4 |
import java.util.Map;
|
| 5 |
|
5 |
|
| - |
|
6 |
import org.apache.http.conn.HttpHostConnectException;
|
| - |
|
7 |
|
| 6 |
import com.spice.profitmandi.common.enumuration.SchemeType;
|
8 |
import com.spice.profitmandi.common.enumuration.SchemeType;
|
| 7 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
9 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 8 |
import com.spice.profitmandi.common.model.GadgetCopsDocumentInsuranceModel;
|
10 |
import com.spice.profitmandi.common.model.GadgetCopsDocumentInsuranceModel;
|
| 9 |
import com.spice.profitmandi.common.model.GadgetCopsInsuranceModel;
|
11 |
import com.spice.profitmandi.common.model.GadgetCopsInsuranceModel;
|
| 10 |
import com.spice.profitmandi.common.web.client.RestClient;
|
12 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| Line 57... |
Line 59... |
| 57 |
params.put(TRANSACTION_POLICY_NUMBER, gadgetCopsInsuranceModel.getPolicyNumber());
|
59 |
params.put(TRANSACTION_POLICY_NUMBER, gadgetCopsInsuranceModel.getPolicyNumber());
|
| 58 |
|
60 |
|
| 59 |
Map<String, String> headers = new HashMap<>(0);
|
61 |
Map<String, String> headers = new HashMap<>(0);
|
| 60 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
62 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
| 61 |
|
63 |
|
| - |
|
64 |
try {
|
| 62 |
restClient.post(URI, params, headers);
|
65 |
restClient.post(URI, params, headers);
|
| - |
|
66 |
} catch (HttpHostConnectException e) {
|
| - |
|
67 |
// TODO Auto-generated catch block
|
| - |
|
68 |
e.printStackTrace();
|
| - |
|
69 |
}
|
| 63 |
}
|
70 |
}
|
| 64 |
|
71 |
|
| 65 |
public static void submitToGadgetCops(GadgetCopsDocumentInsuranceModel gadgetCopsInsuranceModel) throws ProfitMandiBusinessException{
|
72 |
public static void submitToGadgetCops(GadgetCopsDocumentInsuranceModel gadgetCopsInsuranceModel) throws ProfitMandiBusinessException{
|
| 66 |
//RestClient rc = new RestClient(SchemeType.HTTP, "www.google.com", 8080);
|
73 |
//RestClient rc = new RestClient(SchemeType.HTTP, "www.google.com", 8080);
|
| 67 |
RestClient restClient = new RestClient(SchemeType.HTTP, HOST_NAME, 80);
|
74 |
RestClient restClient = new RestClient(SchemeType.HTTP, HOST_NAME, 80);
|
| Line 87... |
Line 94... |
| 87 |
params.put(TRANSACTION_POLICY_NUMBER, gadgetCopsInsuranceModel.getPolicyNumber());
|
94 |
params.put(TRANSACTION_POLICY_NUMBER, gadgetCopsInsuranceModel.getPolicyNumber());
|
| 88 |
|
95 |
|
| 89 |
Map<String, String> headers = new HashMap<>(0);
|
96 |
Map<String, String> headers = new HashMap<>(0);
|
| 90 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
97 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
| 91 |
|
98 |
|
| - |
|
99 |
try {
|
| 92 |
restClient.post(URI, params, headers);
|
100 |
restClient.post(URI, params, headers);
|
| - |
|
101 |
} catch (HttpHostConnectException e) {
|
| - |
|
102 |
// TODO Auto-generated catch block
|
| - |
|
103 |
e.printStackTrace();
|
| - |
|
104 |
}
|
| 93 |
}
|
105 |
}
|
| 94 |
}
|
106 |
}
|