DJB 표준전문 및 오류 응답 관련 수정
This commit is contained in:
@@ -17,6 +17,7 @@ import com.eactive.eai.adapter.AdapterManager;
|
||||
import com.eactive.eai.adapter.AdapterPropManager;
|
||||
import com.eactive.eai.adapter.AdapterVO;
|
||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
||||
import com.eactive.eai.adapter.http.dynamic.filter.FilterCryptoException;
|
||||
import com.eactive.eai.adapter.http.dynamic.filter.JwtAuthException;
|
||||
import com.eactive.eai.common.message.EAIMessage;
|
||||
import com.eactive.eai.common.property.PropManager;
|
||||
@@ -429,7 +430,9 @@ public class TemplateAdapterErrorMsgHandler implements AdapterErrorMessageHandle
|
||||
String adptMsgType = adapterVO.getAdapterGroupVO().getMessageType();
|
||||
String encode = StringUtils.defaultIfBlank(adapterGroupVO.getMessageEncode(), "UTF-8");
|
||||
|
||||
if (e instanceof HttpStatusException) {
|
||||
if (e instanceof FilterCryptoException) {
|
||||
return genInboundErrorResponse(adapterGroupName, callProp, httpProp, adptMsgType, encode, e, 550);
|
||||
} else if (e instanceof HttpStatusException) {
|
||||
HttpStatusException e1 = (HttpStatusException) e;
|
||||
int httpCode = e1.getStatus();
|
||||
|
||||
|
||||
+10
-12
@@ -1,19 +1,17 @@
|
||||
package com.eactive.eai.adapter.http.dynamic.filter;
|
||||
|
||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.util.IpUtil;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Properties;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.util.IpUtil;
|
||||
|
||||
public class AdapterAllowIPListFilter implements HttpAdapterFilter {
|
||||
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||
@@ -30,9 +28,9 @@ public class AdapterAllowIPListFilter implements HttpAdapterFilter {
|
||||
}
|
||||
|
||||
if (!IpUtil.isMatchIp(allowedIps, requestIp)) {
|
||||
throw new HttpStatusException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
||||
throw new FilterException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
||||
}
|
||||
} catch (HttpStatusException e) {
|
||||
} catch (FilterException e) {
|
||||
logger.debug(e.getMessage());
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
|
||||
+3
-5
@@ -8,11 +8,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.util.IpUtil;
|
||||
|
||||
|
||||
public class AdapterBlockIpListFilter implements HttpAdapterFilter {
|
||||
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||
|
||||
@@ -28,9 +26,9 @@ public class AdapterBlockIpListFilter implements HttpAdapterFilter {
|
||||
}
|
||||
|
||||
if (IpUtil.isMatchIp(blockIps, requestIp)) {
|
||||
throw new HttpStatusException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
||||
throw new FilterException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
||||
}
|
||||
} catch (HttpStatusException e) {
|
||||
} catch (FilterException e) {
|
||||
logger.debug(e.getMessage());
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
@@ -46,7 +44,7 @@ public class AdapterBlockIpListFilter implements HttpAdapterFilter {
|
||||
if (ipAddress == null) {
|
||||
ipAddress = request.getRemoteAddr();
|
||||
}
|
||||
if(ipAddress.indexOf(",") >= 0) {
|
||||
if (ipAddress.indexOf(",") >= 0) {
|
||||
ipAddress = org.springframework.util.StringUtils.tokenizeToStringArray(ipAddress, ",")[0];
|
||||
}
|
||||
return ipAddress;
|
||||
|
||||
@@ -488,6 +488,8 @@ public final class MessageUtil {
|
||||
}
|
||||
if (EAIServiceMonitor.getInstance().isTimeOutCodes(oldErrCode) ){ //TIMEOUT일경우
|
||||
return STDMessageErrorKeys.TIMEOUT_ERROR_DESC_VALUE;
|
||||
}else if (EAIServiceMonitor.getInstance().isBizErrorCodes(oldErrCode)){ //업무오류일경우
|
||||
return STDMessageErrorKeys.BIZ_ERROR_DESC_VALUE;
|
||||
}else{
|
||||
return STDMessageErrorKeys.SYSTEM_ERROR_DESC_VALUE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.eactive.eai.inbound.error;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -54,9 +55,12 @@ public class InboundErrorInfoDAO extends BaseDAO {
|
||||
return;
|
||||
}
|
||||
|
||||
String errCode = StringUtils.substring(vo.getErrCd(), 0, 12);
|
||||
vo.setErrCd(errCode);
|
||||
|
||||
InboundErrorInfo entity = inboundErrorInfoMapper.toEntity(vo);
|
||||
inboundErrorInfoLoader.save(entity);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.error(e);
|
||||
throw new DAOException(ExceptionUtil.getErrorCode(e, "RECEAIIEI001"), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user