기존 로직 key값이 안맞고, 코드정리하기엔 영향도가 크다 판단, 기존 로직 유지.
This commit is contained in:
+38
-12
@@ -7,12 +7,20 @@ import java.util.TreeMap;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
||||
import com.eactive.eai.common.TransactionContextKeys;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class SimpleFrameworkFilter implements HttpClientAdapterFilter, HttpAdapterServiceKey {
|
||||
protected static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||
|
||||
public static final String CLIENTID = "clientId";
|
||||
public static final String TRACEID = "traceId";
|
||||
public static final String GUID = "guid";
|
||||
public static final String RECEIVEDTIMESTAMP = "receivedTimestamp";
|
||||
public static final String PARTNER_TRACE_ID = "partnerTraceId";
|
||||
|
||||
public static final String PROPERTIES_GROUP_NAME = "HttpHeaderFilter";
|
||||
public static final String HEADER_KEY_NAMES = "SimpleFrameworkFilter";
|
||||
|
||||
@@ -32,9 +40,6 @@ public class SimpleFrameworkFilter implements HttpClientAdapterFilter, HttpAdapt
|
||||
|
||||
String[] headerKeyNames = propValue.split(",");
|
||||
|
||||
if( StringUtils.isAnyBlank(headerKeyNames) ) {
|
||||
headerKeyNames = new String[]{"clientId", "TRANSACTION_UUID", "GUID","INBOUND_REQUESTED_TIME","receivedTimestamp","partnerTraceId","X-LOAN-TOKEN"};
|
||||
}
|
||||
|
||||
for(String headerKeyName : headerKeyNames) {
|
||||
headerKeyName = headerKeyName.trim();
|
||||
@@ -43,15 +48,36 @@ public class SimpleFrameworkFilter implements HttpClientAdapterFilter, HttpAdapt
|
||||
Map<String, String> inboundHeaderMap = getInboundHeaderProp(tempProp);
|
||||
|
||||
try {
|
||||
for ( Object key : tempProp.keySet() ) {
|
||||
String keyName = (String) key;
|
||||
|
||||
if( StringUtils.equalsAnyIgnoreCase(keyName, headerKeyNames) ) {
|
||||
String value = (String) tempProp.get(keyName);
|
||||
filterHeaders.put(keyName, value);
|
||||
logger.debug("SimpleFrameworkFilter] Processing Key ["+keyName+"], value ["+value+"]");
|
||||
}
|
||||
}
|
||||
|
||||
/* 업체정보 */
|
||||
String clientId = tempProp.getProperty(HttpAdapterServiceSupport.PROPERTIES_NAME_CLIENT_ID);
|
||||
if (StringUtils.isEmpty(clientId)) clientId = "";
|
||||
filterHeaders.put(CLIENTID, clientId);
|
||||
logger.debug("SimpleFrameworkFilter] Processing Key ["+CLIENTID+"], value ["+clientId+"]");
|
||||
|
||||
/* APIM 거래추적자 */
|
||||
String uuid = tempProp.getProperty(TransactionContextKeys.TRANSACTION_UUID, "");
|
||||
filterHeaders.put(TRACEID, uuid);
|
||||
logger.debug("SimpleFrameworkFilter] Processing Key ["+TRACEID+"], value ["+uuid+"]");
|
||||
|
||||
/* GUID */
|
||||
String guid = tempProp.getProperty(TransactionContextKeys.GUID, "");
|
||||
filterHeaders.put(GUID, guid);
|
||||
logger.debug("SimpleFrameworkFilter] Processing Key ["+GUID+"], value ["+guid+"]");
|
||||
|
||||
/* 최초요청시간 */
|
||||
String receivedTimestamp = tempProp.getProperty(HttpAdapterServiceKey.INBOUND_REQUESTED_TIME, "");
|
||||
filterHeaders.put(RECEIVEDTIMESTAMP, receivedTimestamp);
|
||||
logger.debug("SimpleFrameworkFilter] Processing Key ["+RECEIVEDTIMESTAMP+"], value ["+receivedTimestamp+"]");
|
||||
|
||||
String partnerTraceId = inboundHeaderMap.getOrDefault(PARTNER_TRACE_ID, "");
|
||||
filterHeaders.put(PARTNER_TRACE_ID, partnerTraceId);
|
||||
logger.debug("SimpleFrameworkFilter] Processing Key ["+PARTNER_TRACE_ID+"], value ["+partnerTraceId+"]");
|
||||
|
||||
String x_loan_token = inboundHeaderMap.getOrDefault(TransactionContextKeys.X_LOAN_TOKEN, "");
|
||||
filterHeaders.put(TransactionContextKeys.X_LOAN_TOKEN, x_loan_token);
|
||||
logger.debug("SimpleFrameworkFilter] Processing Key ["+TransactionContextKeys.X_LOAN_TOKEN+"], value ["+x_loan_token+"]");
|
||||
|
||||
|
||||
for( String keyName : inboundHeaderMap.keySet() ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user