|
|
|
@@ -67,7 +67,7 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|
|
|
|
"/tsb/{path:^(?!oauth).*$}", "/tsb/{path:^(?!oauth).*$}/**",
|
|
|
|
|
"/shb/{path:^(?!oauth).*$}", "/shb/{path:^(?!oauth).*$}/**",
|
|
|
|
|
"/tst/{path:^(?!oauth).*$}", "/tst/{path:^(?!oauth).*$}/**",
|
|
|
|
|
"/**/{path:^(?!oauth).*$}", "/**/{path:^(?!oauth).*$}/**",
|
|
|
|
|
"/**/{path:^(?!oauth)(?!favicon\\.ico$).*$}", "/**/{path:^(?!oauth)(?!favicon\\.ico$).*$}/**",
|
|
|
|
|
})
|
|
|
|
|
public ResponseEntity<String> callApi(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
|
|
|
|
|
throws Exception {
|
|
|
|
@@ -83,17 +83,25 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|
|
|
|
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (adptUri == null) {
|
|
|
|
|
logError(servletRequest);
|
|
|
|
|
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_SERVICE_NOT_FOUND,
|
|
|
|
|
"can not find Adapter Uri");
|
|
|
|
|
return ResponseEntity.status(HttpStatus.NOT_FOUND).contentType(MediaType.APPLICATION_JSON).body(errorMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Received time , jwhong
|
|
|
|
|
long receivedTimeMillis = System.currentTimeMillis(); // 밀리세컨 단위로 보내야함
|
|
|
|
|
String receivedTimeStr = String.valueOf(receivedTimeMillis);
|
|
|
|
|
|
|
|
|
|
ResponseEntity<String> responseEntity = null;
|
|
|
|
|
Properties transactionProp = new Properties();
|
|
|
|
|
String uuid = UUIDGenerator.getUUID().toString().replaceAll("-", "");
|
|
|
|
|
transactionProp.setProperty(TransactionContextKeys.TRANSACTION_UUID, uuid);
|
|
|
|
|
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
|
|
|
|
|
|
|
|
|
if (adptUri == null) {
|
|
|
|
|
//logError(servletRequest);
|
|
|
|
|
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_SERVICE_NOT_FOUND,
|
|
|
|
|
"can not find Adapter Uri");
|
|
|
|
|
logError(servletRequest, "HTTP_IN_NO_URI", MessageUtil.ERROR_CODE_SERVICE_NOT_FOUND,
|
|
|
|
|
errorMsg, transactionProp, null);
|
|
|
|
|
return ResponseEntity.status(HttpStatus.NOT_FOUND).contentType(MediaType.APPLICATION_JSON).body(errorMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String adapterGroupName = adptUri.getAdptGrpName();
|
|
|
|
|
String adapterName = adptUri.getAdptName();
|
|
|
|
|
AdapterGroupVO adapterGroupVO = AdapterManager.getInstance().getAdapterGroupVO(adapterGroupName);
|
|
|
|
@@ -101,6 +109,8 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|
|
|
|
if (adapterVO == null) {
|
|
|
|
|
String errorMsg = MessageUtil.makeJsonErrorMessage(MessageUtil.ERROR_CODE_AP_ERROR,
|
|
|
|
|
"Adapter not found error");
|
|
|
|
|
logError(servletRequest, adapterGroupName, MessageUtil.ERROR_CODE_AP_ERROR,
|
|
|
|
|
errorMsg, transactionProp, null);
|
|
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).contentType(MediaType.APPLICATION_JSON)
|
|
|
|
|
.body(errorMsg);
|
|
|
|
|
}
|
|
|
|
@@ -112,16 +122,10 @@ public class DJBApiAdapterController implements HttpAdapterServiceKey {
|
|
|
|
|
MediaType mediaType = MediaType.valueOf("application/json;charset=" + encode);
|
|
|
|
|
String errorResponseFormat = httpProp.getProperty(ERROR_RESPONSE_FORMAT);
|
|
|
|
|
|
|
|
|
|
ResponseEntity<String> responseEntity = null;
|
|
|
|
|
Properties transactionProp = new Properties();
|
|
|
|
|
String uuid = UUIDGenerator.getUUID().toString().replaceAll("-", "");
|
|
|
|
|
transactionProp.setProperty(TransactionContextKeys.TRANSACTION_UUID, uuid);
|
|
|
|
|
|
|
|
|
|
TxSiftContext.begin(uuid);
|
|
|
|
|
|
|
|
|
|
// jwhong, put api received time, eaiSvcCode
|
|
|
|
|
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
|
|
|
|
|
|
|
|
|
String responseData = "";
|
|
|
|
|
try {
|
|
|
|
|
responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO,
|
|
|
|
|